|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.Thread
org.jppf.server.nio.NioServer<ClassState,ClassTransition>
org.jppf.server.nio.classloader.ClassNioServer
public class ClassNioServer
Instances of this class serve class loading requests from the JPPF nodes.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
protected Map<String,List<ChannelWrapper<?>>> |
providerConnections
A mapping of the remote resource provider connections handled by this socket server, to their unique uuid. |
| Fields inherited from class org.jppf.server.nio.NioServer |
|---|
CLASS_SERVER, factory, lock, NODE_SERVER, ports, resourceProvider, selector, selectTimeout, transitionManager |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
ClassNioServer(int port)
Initialize this class server with the port it will listen to. |
|
ClassNioServer(int[] ports)
Initialize this class server with a specified list of port numbers. |
|
| Method Summary | |
|---|---|
void |
addProviderConnection(String uuid,
ChannelWrapper<?> channel)
Add a provider connection to the map of existing available providers. |
static void |
closeConnection(ChannelWrapper<?> channel)
Close the specified connection. |
void |
connectionFailed(ReaperEvent event)
Called when the Reaper detects that a connection is broken. |
protected NioServerFactory<ClassState,ClassTransition> |
createFactory()
Create the factory holding all the states and transition mappings. |
NioContext<?> |
createNioContext()
Define a context for a newly created channel. |
protected boolean |
externalStopCondition()
Determine whether a stop condition external to this server has been reached. |
byte[] |
getCacheContent(String uuid,
String name)
Get a resource definition from the resource cache. |
int |
getInitialInterest()
Get the IO operations a connection is initially interested in. |
List<ChannelWrapper<?>> |
getProviderConnections(String uuid)
Get all the provider connections for the specified client uuid. |
ResourceProvider |
getResourceProvider()
Get the resource provider for this server. |
void |
initLocalChannel(ChannelWrapper<?> localChannel)
Initialize the local channel connection. |
void |
postAccept(ChannelWrapper<?> wrapper)
Process a channel that was accepted by the server socket channel. |
void |
removeAllConnections()
Close and remove all connections accepted by this server. |
void |
removeProviderConnection(String uuid,
ChannelWrapper channel)
Add a provider connection to the map of existing available providers. |
void |
setCacheContent(String uuid,
String name,
byte[] content)
Add a resource content to the class cache. |
| Methods inherited from class org.jppf.server.nio.NioServer |
|---|
end, getFactory, getLock, getPorts, getSelector, getTransitionManager, go, init, isStopped, postAccept, postSelect, run, setStopped |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Map<String,List<ChannelWrapper<?>>> providerConnections
| Constructor Detail |
|---|
public ClassNioServer(int port)
throws JPPFException
port - the port number as an int value.
JPPFException - if this server could not be initialized.
public ClassNioServer(int[] ports)
throws JPPFException
ports - the list of port this server accepts connections from.
JPPFException - if the underlying server socket can't be opened.| Method Detail |
|---|
public void initLocalChannel(ChannelWrapper<?> localChannel)
localChannel - the local channel to use.protected NioServerFactory<ClassState,ClassTransition> createFactory()
createFactory in class NioServer<ClassState,ClassTransition>NioServerFactory instance.protected boolean externalStopCondition()
externalStopCondition in class NioServer<ClassState,ClassTransition>NioServer.externalStopCondition()public NioContext<?> createNioContext()
createNioContext in class NioServer<ClassState,ClassTransition>NioContext instance.public int getInitialInterest()
getInitialInterest in class NioServer<ClassState,ClassTransition>SelectionKey
constants definitions.public void postAccept(ChannelWrapper<?> wrapper)
postAccept in class NioServer<ClassState,ClassTransition>wrapper - the selection key for the socket channel to process.public void removeAllConnections()
removeAllConnections in class NioServer<ClassState,ClassTransition>NioServer.removeAllConnections()public ResourceProvider getResourceProvider()
public void addProviderConnection(String uuid,
ChannelWrapper<?> channel)
uuid - the provider uuid as a string.channel - the provider's communication channel.
public void removeProviderConnection(String uuid,
ChannelWrapper channel)
uuid - the provider uuid as a string.channel - the provider's communication channel.public List<ChannelWrapper<?>> getProviderConnections(String uuid)
uuid - the uuid of the client for which to get connections.
public void setCacheContent(String uuid,
String name,
byte[] content)
uuid - uuid of the resource provider.name - name of the resource.content - content of the resource.
public byte[] getCacheContent(String uuid,
String name)
uuid - uuid of the reosurce provider.name - name of the resource.
public static void closeConnection(ChannelWrapper<?> channel)
channel - the channel representing the connection.public void connectionFailed(ReaperEvent event)
Reaper detects that a connection is broken.
connectionFailed in interface ReaperListenerevent - encapsulates the server-side connection to a remote peer.
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||