org.jppf.server.nio.multiplexer
Class MultiplexerNioServer

java.lang.Object
  extended by java.lang.Thread
      extended by org.jppf.server.nio.NioServer<MultiplexerState,MultiplexerTransition>
          extended by org.jppf.server.nio.multiplexer.MultiplexerNioServer
All Implemented Interfaces:
Runnable

public class MultiplexerNioServer
extends NioServer<MultiplexerState,MultiplexerTransition>

Nio server managing connections to and from the multiplexer.

Author:
Laurent Cohen

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
MultiplexerNioServer()
          Initialize this server.
 
Method Summary
protected  NioServerFactory<MultiplexerState,MultiplexerTransition> createFactory()
          Create the factory holding all the states and transition mappings.
 NioContext createNioContext()
          Define a context for a newly created channel.
 HostPort getHostPortForBoundPort(int port)
          Get the outbound remote multiplexer associated with an inbound application port.
 int getInitialInterest()
          Get the IO operations a connection is initially interested in.
static void main(String... args)
          Entry point for the multiplexer application.
 void postAccept(ChannelWrapper channel)
          Process a channel that was accepted by the server socket channel.
 void postAccept(ChannelWrapper channel, ServerSocketChannel serverChannel)
          Process a channel that was accepted by the server socket channel.
 
Methods inherited from class org.jppf.server.nio.NioServer
end, externalStopCondition, getFactory, getLock, getPorts, getSelector, getTransitionManager, go, init, isStopped, 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

MultiplexerNioServer

public MultiplexerNioServer()
                     throws JPPFException
Initialize this server.

Throws:
JPPFException - if the underlying server socket can't be opened.
Method Detail

createFactory

protected NioServerFactory<MultiplexerState,MultiplexerTransition> createFactory()
Create the factory holding all the states and transition mappings.

Specified by:
createFactory in class NioServer<MultiplexerState,MultiplexerTransition>
Returns:
an NioServerFactory instance.

createNioContext

public NioContext createNioContext()
Define a context for a newly created channel.

Specified by:
createNioContext in class NioServer<MultiplexerState,MultiplexerTransition>
Returns:
an NioContext instance.

getInitialInterest

public int getInitialInterest()
Get the IO operations a connection is initially interested in.

Specified by:
getInitialInterest in class NioServer<MultiplexerState,MultiplexerTransition>
Returns:
a bit-wise combination of the interests, taken from SelectionKey constants definitions.
See Also:
NioServer.getInitialInterest()

postAccept

public void postAccept(ChannelWrapper channel,
                       ServerSocketChannel serverChannel)
Process a channel that was accepted by the server socket channel.

Overrides:
postAccept in class NioServer<MultiplexerState,MultiplexerTransition>
Parameters:
channel - the selection key for the socket channel to process.
serverChannel - the ServerSocketChannel that accepted the channel.

postAccept

public void postAccept(ChannelWrapper channel)
Process a channel that was accepted by the server socket channel.

Specified by:
postAccept in class NioServer<MultiplexerState,MultiplexerTransition>
Parameters:
channel - the selection key for the socket channel to process.

getHostPortForBoundPort

public HostPort getHostPortForBoundPort(int port)
Get the outbound remote multiplexer associated with an inbound application port.

Parameters:
port - the application port to lookup.
Returns:
a HostPort instannce, or null if no remote multiplexer could be found.

main

public static void main(String... args)
Entry point for the multiplexer application.

Parameters:
args - not used.


Copyright © 2005-2010 JPPF Team.