Class AsyncClientClassNioServer
java.lang.Object
java.lang.Thread
org.jppf.nio.NioServer
org.jppf.nio.StatelessNioServer<AsyncClientClassContext>
org.jppf.server.nio.classloader.client.AsyncClientClassNioServer
- All Implemented Interfaces:
Runnable
public final class AsyncClientClassNioServer
extends org.jppf.nio.StatelessNioServer<AsyncClientClassContext>
The NIO server that handles asynchronous client connections, which can handle multiple jobs concurrently.
- Author:
- Laurent Cohen
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jppf.nio.StatelessNioServer
org.jppf.nio.StatelessNioServer.ContextAction<C extends org.jppf.nio.AbstractNioContext>, org.jppf.nio.StatelessNioServer.ContextFilter<C extends org.jppf.nio.AbstractNioContext>, org.jppf.nio.StatelessNioServer.KeysetHandler<C extends org.jppf.nio.AbstractNioContext>Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
Fields inherited from class org.jppf.nio.StatelessNioServer
acceptHandler, messageReader, messageWriter, readHandler, writeHandlerFields inherited from class org.jppf.nio.NioServer
attachment, configuration, identifier, requestShutdown, selecting, selector, selectTimeout, sslContext, sslHelper, stopped, sync, wakeUpActionFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionAsyncClientClassNioServer(JPPFDriver driver, int identifier, boolean useSSL) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(ServerSocketChannel serverSocketChannel, SocketChannel channel, org.jppf.nio.SSLHandler sslHandler, boolean ssl, boolean peer, Object... params) voidaddProviderConnection(String uuid, AsyncClientClassContext context) Add a provider connection to the map of existing available providers.voidcloseConnection(AsyncClientClassContext channel) Close the specified connection.voidcloseConnection(AsyncClientClassContext context, boolean removeJobConnection) Close the specified connection.createNioContext(Object... params) Get all the provider connections handled by this server.getProviderConnections(String uuid) Get all the provider connections for the specified client uuid.protected voidprotected voidprotected voidvoidClose and remove all connections accepted by this server.voidremoveProviderConnection(String uuid, AsyncClientClassContext context) Add a provider connection to the map of existing available providers.voidRemove all the provider connections for the specified client uuid.Methods inherited from class org.jppf.nio.StatelessNioServer
doOperation, getAllContexts, go, handleRead, handleWrite, init, isKeyValid, performContextAction, registerChannel, run, toString, toString, updateInterestOps, updateInterestOpsNoWakeupMethods inherited from class org.jppf.nio.NioServer
addServer, configurePeerSSL, configureSSLEngine, createSSLContext, doAccept, end, externalStopCondition, getConfiguration, getIdentifier, getSelector, isStopped, removeServer, setConfiguration, shutdown, wakeUpSelectorIfNeededMethods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, yield
-
Constructor Details
-
AsyncClientClassNioServer
public AsyncClientClassNioServer(JPPFDriver driver, int identifier, boolean useSSL) throws Exception - Parameters:
driver- reference to the driver.identifier- the channel identifier for channels handled by this server.useSSL- determines whether an SSLContext should be created for this server.- Throws:
Exception- if any error occurs.
-
-
Method Details
-
initReaderAndWriter
protected void initReaderAndWriter()- Specified by:
initReaderAndWriterin classorg.jppf.nio.StatelessNioServer<AsyncClientClassContext>
-
handleSelectionException
- Specified by:
handleSelectionExceptionin classorg.jppf.nio.StatelessNioServer<AsyncClientClassContext>
-
accept
public void accept(ServerSocketChannel serverSocketChannel, SocketChannel channel, org.jppf.nio.SSLHandler sslHandler, boolean ssl, boolean peer, Object... params) - Specified by:
acceptin classorg.jppf.nio.NioServer
-
createNioContext
- Specified by:
createNioContextin classorg.jppf.nio.NioServer
-
closeConnection
Close the specified connection.- Parameters:
channel- the channel representing the connection.
-
closeConnection
Close the specified connection.- Parameters:
context- the channel representing the connection.removeJobConnection-trueto remove the corresponding job connection as well,falseotherwise.
-
addProviderConnection
Add a provider connection to the map of existing available providers.- Parameters:
uuid- the provider uuid as a string.context- the provider's communication channel.
-
removeProviderConnection
Add a provider connection to the map of existing available providers.- Parameters:
uuid- the provider uuid as a string.context- the provider's communication channel.
-
getProviderConnections
Get all the provider connections for the specified client uuid.- Parameters:
uuid- the uuid of the client for which to get connections.- Returns:
- a list of connection channels.
-
removeProviderConnections
Remove all the provider connections for the specified client uuid.- Parameters:
uuid- the uuid of the client for which to remove connections.
-
getAllProviderConnections
Get all the provider connections handled by this server.- Returns:
- a list of connection channels.
-
removeAllConnections
public void removeAllConnections()Close and remove all connections accepted by this server.- Overrides:
removeAllConnectionsin classorg.jppf.nio.NioServer
-
getMessageHandler
- Returns:
- the message handler for this server.
-
initNioHandlers
protected void initNioHandlers()- Overrides:
initNioHandlersin classorg.jppf.nio.StatelessNioServer<AsyncClientClassContext>
-
getDriver
- Returns:
- a reference to the driver.
-
getClassCache
- Returns:
- the cache of class definitions.
-