Package com.swiftmq.net.protocol.smqp
Class SMQPInputHandler
- java.lang.Object
-
- com.swiftmq.net.protocol.smqp.SMQPInputHandler
-
- All Implemented Interfaces:
ProtocolInputHandler
public class SMQPInputHandler extends java.lang.Object implements ProtocolInputHandler
A SMQPInputHandler handles SMQP input.- Author:
- IIT GmbH, Bremen/Germany, Copyright (c) 2000-2002, All Rights Reserved
-
-
Constructor Summary
Constructors Constructor Description SMQPInputHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProtocolInputHandlercreate()Factory method to create a new ProtocolInputHandler.voidcreateInputBuffer(int initialSize, int ensureSize)Create the input buffer of the protocol handler.byte[]getBuffer()Returns the protocol handler input buffer.java.nio.ByteBuffergetByteBuffer()Returns the protocol handler input buffer.intgetOffset()Returns the current offset of the input buffer.voidsetBytesWritten(int written)Set the number of bytes written into the buffer.voidsetChunkListener(ChunkListener listener)Set the ChunkListener.java.lang.StringtoString()
-
-
-
Method Detail
-
create
public ProtocolInputHandler create()
Description copied from interface:ProtocolInputHandlerFactory method to create a new ProtocolInputHandler. For example, a RawInputHandler returns a RawInputHandler here.- Specified by:
createin interfaceProtocolInputHandler- Returns:
- new protocol input handler.
-
setChunkListener
public void setChunkListener(ChunkListener listener)
Description copied from interface:ProtocolInputHandlerSet the ChunkListener. The ChunkListener is implemented by the Network Swiftlet and will be set from it.- Specified by:
setChunkListenerin interfaceProtocolInputHandler- Parameters:
listener- listener.
-
createInputBuffer
public void createInputBuffer(int initialSize, int ensureSize)Description copied from interface:ProtocolInputHandlerCreate the input buffer of the protocol handler. The buffer must be created with theinitialSize. Each timegetBuffer()is called, the buffer must have a remaining size ofensureSize.- Specified by:
createInputBufferin interfaceProtocolInputHandler- Parameters:
initialSize- initial sizeensureSize- ensured size on each getBuffer call
-
getByteBuffer
public java.nio.ByteBuffer getByteBuffer()
Description copied from interface:ProtocolInputHandlerReturns the protocol handler input buffer.- Specified by:
getByteBufferin interfaceProtocolInputHandler- Returns:
- buffer.
-
getBuffer
public byte[] getBuffer()
Description copied from interface:ProtocolInputHandlerReturns the protocol handler input buffer.- Specified by:
getBufferin interfaceProtocolInputHandler- Returns:
- buffer.
-
getOffset
public int getOffset()
Description copied from interface:ProtocolInputHandlerReturns the current offset of the input buffer.- Specified by:
getOffsetin interfaceProtocolInputHandler- Returns:
- offset.
-
setBytesWritten
public void setBytesWritten(int written)
Description copied from interface:ProtocolInputHandlerSet the number of bytes written into the buffer. Called from the Network Swiftlet after it has read bytes from sockets directly into the buffer+offset.- Specified by:
setBytesWrittenin interfaceProtocolInputHandler- Parameters:
written- number of bytes written
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-