Class AbstractWriterHandler
java.lang.Object
com.tenio.common.logger.AbstractLogger
com.tenio.common.logger.SystemLogger
com.tenio.core.network.zero.engine.writer.implement.AbstractWriterHandler
- All Implemented Interfaces:
WriterHandler
- Direct Known Subclasses:
DatagramWriterHandler
,SocketWriterHandler
public abstract class AbstractWriterHandler
extends com.tenio.common.logger.SystemLogger
implements WriterHandler
The abstract writer handler.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
allocateBuffer
(int capacity) Allocates a byte buffer capacity.Retrieves a byte buffer which a socket can read/write binaries data from/down.Retrieves a network writer statistic instance which takes responsibility recording the sending data from the network.Retrieves a blocking queue of all sessions.void
setNetworkWriterStatistic
(NetworkWriterStatistic networkWriterStatistic) Sets a network writer statistic instance which takes responsibility recording the sending data from the network.void
setSessionTicketsQueue
(BlockingQueue<Session> sessionTicketsQueue) Sets a blocking queue of sessions.Methods inherited from class com.tenio.common.logger.SystemLogger
debug, debugEvent, isDebugEnabled, isTraceEnabled, trace, trace
Methods inherited from class com.tenio.common.logger.AbstractLogger
buildgen, error, error, error, info, info, info, info, info, info, info, info, isErrorEnabled, isInfoEnabled
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.tenio.core.network.zero.engine.writer.WriterHandler
send
-
Constructor Details
-
AbstractWriterHandler
public AbstractWriterHandler()
-
-
Method Details
-
getSessionTicketsQueue
Description copied from interface:WriterHandler
Retrieves a blocking queue of all sessions.- Specified by:
getSessionTicketsQueue
in interfaceWriterHandler
- Returns:
- the blocking queue of all
Session
s - See Also:
-
setSessionTicketsQueue
Description copied from interface:WriterHandler
Sets a blocking queue of sessions.- Specified by:
setSessionTicketsQueue
in interfaceWriterHandler
- Parameters:
sessionTicketsQueue
- a blocking queue of allSession
s- See Also:
-
getNetworkWriterStatistic
Description copied from interface:WriterHandler
Retrieves a network writer statistic instance which takes responsibility recording the sending data from the network.- Specified by:
getNetworkWriterStatistic
in interfaceWriterHandler
- Returns:
- a
NetworkWriterStatistic
instance
-
setNetworkWriterStatistic
Description copied from interface:WriterHandler
Sets a network writer statistic instance which takes responsibility recording the sending data from the network.- Specified by:
setNetworkWriterStatistic
in interfaceWriterHandler
- Parameters:
networkWriterStatistic
- aNetworkWriterStatistic
instance
-
getBuffer
Description copied from interface:WriterHandler
Retrieves a byte buffer which a socket can read/write binaries data from/down.- Specified by:
getBuffer
in interfaceWriterHandler
- Returns:
- an instance of
ByteBuffer
-
allocateBuffer
public void allocateBuffer(int capacity) Description copied from interface:WriterHandler
Allocates a byte buffer capacity.- Specified by:
allocateBuffer
in interfaceWriterHandler
- Parameters:
capacity
- the capacity of a byte buffer (integer
value)- See Also:
-