Package com.gigaspaces.lrmi.nio
Class Reader
java.lang.Object
com.gigaspaces.lrmi.nio.Reader
A Reader is capable of reading Request Packets and Reply Packets from a Socket Channel. An NIO
Client Peer uses an instance of a Reader to read Reply Packets while an NIO Server uses an
instance of a Reader to read Request Packets.
- Since:
- 4.0
- Author:
- Igor Goldenberg
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionReader(SocketChannel sockChannel, int slowConsumerRetries) Reader(SocketChannel sockChannel, SystemRequestHandler systemRequestHandler) -
Method Summary
Modifier and TypeMethodDescriptionvoidlongstatic LongAdderreadBytesFromChannelBlocking(boolean createNewBuffer, int slowConsumerLatency, int sizeLimit) <T> ReplyPacket<T><T> ReplyPacket<T>readReply(boolean createNewBuffer) <T> ReplyPacket<T>readReply(int slowConsumerTimeout, int sizeLimit) readReply(Reader.Context ctx) <T> voidreadReply(ReplyPacket<T> packet) readRequest(boolean createNewBuffer) voidvoidsetFilterManager(IOFilterManager filterManager) <T> ReplyPacket<T>unmarshallReply(MarshalInputStream stream) unmarshallRequest(MarshalInputStream stream)
-
Field Details
-
SUSPICIOUS_THRESHOLD
public static final long SUSPICIOUS_THRESHOLD
-
-
Constructor Details
-
Reader
-
Reader
-
-
Method Details
-
getReceivedTrafficCounter
-
readRequest
- Throws:
IOExceptionIOFilterException
-
readRequest
public RequestPacket readRequest(boolean createNewBuffer) throws IOException, ClassNotFoundException, IOFilterException -
readRequest
-
readReply
- Throws:
IOExceptionIOFilterException
-
readReply
public <T> ReplyPacket<T> readReply(boolean createNewBuffer) throws IOException, ClassNotFoundException, IOFilterException -
readReply
-
readReply
public <T> void readReply(ReplyPacket<T> packet) throws IOException, ClassNotFoundException, IOFilterException -
readReply
public <T> ReplyPacket<T> readReply(int slowConsumerTimeout, int sizeLimit) throws IOException, ClassNotFoundException, IOFilterException -
setFilterManager
-
readBytesFromChannelBlocking
public ByteBuffer readBytesFromChannelBlocking(boolean createNewBuffer, int slowConsumerLatency, int sizeLimit) throws IOException - Throws:
IOException
-
unmarshallRequest
public RequestPacket unmarshallRequest(MarshalInputStream stream) throws ClassNotFoundException, NoSuchObjectException -
unmarshallReply
public <T> ReplyPacket<T> unmarshallReply(MarshalInputStream stream) throws ClassNotFoundException, NoSuchObjectException -
closeContext
public void closeContext() -
resetContext
public void resetContext() -
getReceivedTraffic
public long getReceivedTraffic() -
readProtocolValidationHeader
public String readProtocolValidationHeader(Reader.ProtocolValidationContext context) throws IOException - Throws:
IOException
-