com.mooapi.server.protocol.codec
Class MooServerProtocolEncoder

java.lang.Object
  extended by org.apache.mina.filter.codec.ProtocolEncoderAdapter
      extended by com.mooapi.server.protocol.codec.MooServerProtocolEncoder
All Implemented Interfaces:
org.apache.mina.filter.codec.ProtocolEncoder

public class MooServerProtocolEncoder
extends org.apache.mina.filter.codec.ProtocolEncoderAdapter

An encoder for commands from the server to clients

Author:
Steve Taylor

Constructor Summary
MooServerProtocolEncoder()
          Delegate initialization to the appropriate property setters.
MooServerProtocolEncoder(MooServer mooServer)
          Initialize.
 
Method Summary
 void encode(org.apache.mina.common.IoSession session, java.lang.Object input, org.apache.mina.filter.codec.ProtocolEncoderOutput output)
          Encode an AbstractOutputCommand into a ByteBuffer.
 MooServer getMooServer()
          Get the MooAPI server instance.
 void setDebug(boolean debug)
          Set the debugging status.
 void setMooServer(MooServer mooServer)
          Set the MooAPI server instance.
 
Methods inherited from class org.apache.mina.filter.codec.ProtocolEncoderAdapter
dispose
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MooServerProtocolEncoder

public MooServerProtocolEncoder(MooServer mooServer)
Initialize.

Parameters:
mooServer - A MooAPI server instance.

MooServerProtocolEncoder

public MooServerProtocolEncoder()
Delegate initialization to the appropriate property setters.

Method Detail

getMooServer

public MooServer getMooServer()
Get the MooAPI server instance.

Returns:
The MooAPI server.

setMooServer

public void setMooServer(MooServer mooServer)
Set the MooAPI server instance.

Parameters:
mooServer - A MooAPI server.

setDebug

public void setDebug(boolean debug)
Set the debugging status.

Parameters:
debug - The debugging status.

encode

public void encode(org.apache.mina.common.IoSession session,
                   java.lang.Object input,
                   org.apache.mina.filter.codec.ProtocolEncoderOutput output)
            throws java.lang.Exception
Encode an AbstractOutputCommand into a ByteBuffer.

Parameters:
session - The MooAPI connection's peer.
input - The MooAPI command to encode.
output - The protocol encoder.
Throws:
java.lang.Exception - On buffer overflow.


Copyright © 2009. All Rights Reserved.