|
|
||||||||||
| 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<NodeState,NodeTransition>
org.jppf.server.nio.nodeserver.NodeNioServer
public class NodeNioServer
Instances of this class serve task execution requests to the JPPF nodes.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| 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 | |
|---|---|
NodeNioServer(int port)
Initialize this server with a specified port number. |
|
NodeNioServer(int[] ports)
Initialize this server with the specified port numbers. |
|
| Method Summary | |
|---|---|
void |
addIdleChannel(ChannelWrapper<?> channel)
Add a channel to the list of idle channels. |
static void |
closeNode(ChannelWrapper<?> channel,
AbstractNodeContext context)
Close a connection to a node. |
void |
connectionFailed(ReaperEvent event)
Called when the Reaper detects that a connection is broken. |
protected NioServerFactory<NodeState,NodeTransition> |
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. |
Bundler |
getBundler()
Get the algorithm that dynamically computes the task bundle size. |
JPPFBundlerFactory |
getBundlerFactory()
Get the factory object used to create bundler instances. |
List<ChannelWrapper<?>> |
getIdleChannels()
Get the list of currently idle channels. |
int |
getInitialInterest()
Get the IO operations a connection is initially interested in. |
protected JPPFJobManager |
getJobManager()
Get a reference to the driver's job manager. |
protected JPPFQueue |
getQueue()
Get a reference to the driver's tasks queue. |
void |
initLocalChannel(ChannelWrapper<?> localChannel)
Initialize the local channel connection. |
void |
postAccept(ChannelWrapper<?> channel)
Process a channel that was accepted by the server socket channel. |
ChannelWrapper<?> |
removeIdleChannel(ChannelWrapper<?> channel)
Remove a channel from the list of idle channels. |
ChannelWrapper<?> |
removeIdleChannel(int index)
Remove the channel at the specified index from the list of idle channels. |
void |
setBundler(Bundler bundler)
Set the algorithm that dynamically computes the task bundle size. |
| Methods inherited from class org.jppf.server.nio.NioServer |
|---|
end, getFactory, getLock, getPorts, getSelector, getTransitionManager, go, init, isStopped, postAccept, postSelect, removeAllConnections, 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 |
| Constructor Detail |
|---|
public NodeNioServer(int port)
throws Exception
port - the port this socket server is listening to.
Exception - if the underlying server socket can't be opened.
public NodeNioServer(int[] ports)
throws Exception
ports - the ports this socket server is listening to.
Exception - if the underlying server socket can't be opened.| Method Detail |
|---|
public void initLocalChannel(ChannelWrapper<?> localChannel)
localChannel - the local channel to use.protected NioServerFactory<NodeState,NodeTransition> createFactory()
createFactory in class NioServer<NodeState,NodeTransition>NioServerFactory instance.protected boolean externalStopCondition()
externalStopCondition in class NioServer<NodeState,NodeTransition>public void postAccept(ChannelWrapper<?> channel)
postAccept in class NioServer<NodeState,NodeTransition>channel - the selection key for the socket channel to process.public void addIdleChannel(ChannelWrapper<?> channel)
channel - the channel to add to the list.public ChannelWrapper<?> removeIdleChannel(ChannelWrapper<?> channel)
channel - the channel to remove from the list.
public ChannelWrapper<?> removeIdleChannel(int index)
index - the index of the channel to remove from the list.
public NioContext<?> createNioContext()
createNioContext in class NioServer<NodeState,NodeTransition>NioContext instance.NioServer.createNioContext()public int getInitialInterest()
getInitialInterest in class NioServer<NodeState,NodeTransition>SelectionKey constants definitions.NioServer.getInitialInterest()
public static void closeNode(ChannelWrapper<?> channel,
AbstractNodeContext context)
channel - a SocketChannel that encapsulates the connection.context - the context data associated with the channel.public Bundler getBundler()
Bundler instance.public void setBundler(Bundler bundler)
bundler - a Bundler instance.protected JPPFQueue getQueue()
JPPFQueue instance.protected JPPFJobManager getJobManager()
JPPFQueue instance.public JPPFBundlerFactory getBundlerFactory()
JPPFBundlerFactory.public List<ChannelWrapper<?>> getIdleChannels()
SelectableChannel instances.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 | ||||||||||