Class AbstractZeroEngine
java.lang.Object
com.tenio.common.logger.AbstractLogger
com.tenio.common.logger.SystemLogger
com.tenio.core.manager.AbstractManager
com.tenio.core.network.zero.engine.implement.AbstractZeroEngine
- All Implemented Interfaces:
ZeroEngine
,Service
,ServiceListener
,Runnable
- Direct Known Subclasses:
ZeroAcceptorImpl
,ZeroReaderImpl
,ZeroWriterImpl
The abstract engine.
-
Field Summary
Fields inherited from class com.tenio.core.manager.AbstractManager
eventManager
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractZeroEngine
(EventManager eventManager) Initialization. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the datagram IO handler.int
Retrieves the max buffer size.getName()
Retrieves the service's name.Retrieves the session manager.Retrieves the socket IO handler.int
Retrieves the thread pool size.void
Initializes a new service.boolean
Determines whether the service is activated.void
run()
void
setDatagramIoHandler
(DatagramIoHandler datagramIoHandler) Set the datagram IO handler.void
setMaxBufferSize
(int maxSize) Set the max buffer size.void
Set the service's name.void
setSessionManager
(SessionManager sessionManager) Set the session manager.void
setSocketIoHandler
(SocketIoHandler socketIoHandler) Set the socket IO handler.void
setThreadPoolSize
(int maxSize) Set the thread pool size.void
shutdown()
Shutdown the service.void
start()
Start the service.Methods inherited from class com.tenio.common.logger.SystemLogger
debug, trace, trace
Methods inherited from class com.tenio.common.logger.AbstractLogger
buildgen, error, error, info, info, info, info, info, info, info, info
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.service.ServiceListener
onDestroyed, onInitialized, onRunning, onShutdown, onStarted
-
Constructor Details
-
AbstractZeroEngine
Initialization.- Parameters:
eventManager
- the event manger
-
-
Method Details
-
run
public void run() -
getSocketIoHandler
Description copied from interface:ZeroEngine
Retrieves the socket IO handler.- Specified by:
getSocketIoHandler
in interfaceZeroEngine
- Returns:
- the socket IO handler
-
setSocketIoHandler
Description copied from interface:ZeroEngine
Set the socket IO handler.- Specified by:
setSocketIoHandler
in interfaceZeroEngine
- Parameters:
socketIoHandler
- the socket IO handler
-
getDatagramIoHandler
Description copied from interface:ZeroEngine
Retrieves the datagram IO handler.- Specified by:
getDatagramIoHandler
in interfaceZeroEngine
- Returns:
- the datagram IO handler
-
setDatagramIoHandler
Description copied from interface:ZeroEngine
Set the datagram IO handler.- Specified by:
setDatagramIoHandler
in interfaceZeroEngine
- Parameters:
datagramIoHandler
- the datagram IO handler
-
getSessionManager
Description copied from interface:ZeroEngine
Retrieves the session manager.- Specified by:
getSessionManager
in interfaceZeroEngine
- Returns:
- the session manager
-
setSessionManager
Description copied from interface:ZeroEngine
Set the session manager.- Specified by:
setSessionManager
in interfaceZeroEngine
- Parameters:
sessionManager
- the session manager
-
getThreadPoolSize
public int getThreadPoolSize()Description copied from interface:ZeroEngine
Retrieves the thread pool size.- Specified by:
getThreadPoolSize
in interfaceZeroEngine
- Returns:
- the thread pool size
-
setThreadPoolSize
public void setThreadPoolSize(int maxSize) Description copied from interface:ZeroEngine
Set the thread pool size.- Specified by:
setThreadPoolSize
in interfaceZeroEngine
- Parameters:
maxSize
- the thread pool size
-
getMaxBufferSize
public int getMaxBufferSize()Description copied from interface:ZeroEngine
Retrieves the max buffer size.- Specified by:
getMaxBufferSize
in interfaceZeroEngine
- Returns:
- the max buffer size
-
setMaxBufferSize
public void setMaxBufferSize(int maxSize) Description copied from interface:ZeroEngine
Set the max buffer size.- Specified by:
setMaxBufferSize
in interfaceZeroEngine
- Parameters:
maxSize
- the max buffer size
-
initialize
public void initialize()Description copied from interface:Service
Initializes a new service.- Specified by:
initialize
in interfaceService
-
start
public void start()Description copied from interface:Service
Start the service. -
shutdown
public void shutdown()Description copied from interface:Service
Shutdown the service. -
isActivated
public boolean isActivated()Description copied from interface:Service
Determines whether the service is activated.- Specified by:
isActivated
in interfaceService
- Returns:
- true if the service is activated, false otherwise
-
getName
Description copied from interface:Service
Retrieves the service's name. -
setName
Description copied from interface:Service
Set the service's name.
-