org.jppf.server.nio.multiplexer
Class MultiplexerChannelHandler

java.lang.Object
  extended by org.jppf.server.nio.AbstractSocketChannelHandler
      extended by org.jppf.server.nio.multiplexer.MultiplexerChannelHandler

public class MultiplexerChannelHandler
extends AbstractSocketChannelHandler

Instances of this class are used when a client or node is connecting to the multiplexer. They create a connection to the corresponding JPPF driver that will forward any data received or sent on either side.

Author:
Laurent Cohen

Field Summary
 
Fields inherited from class org.jppf.server.nio.AbstractSocketChannelHandler
host, port, server, socketClient, socketInitializer
 
Constructor Summary
MultiplexerChannelHandler(NioServer server, String host, int port, ChannelWrapper<?> initialKey)
          Initialize the channel with the specified host and port.
 
Method Summary
protected  SocketChannelClient initSocketChannel()
          Initialize the channel client.
protected  void postInit()
          This method is called after the channel is successfully conntected.
 
Methods inherited from class org.jppf.server.nio.AbstractSocketChannelHandler
getSocketClient, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiplexerChannelHandler

public MultiplexerChannelHandler(NioServer server,
                                 String host,
                                 int port,
                                 ChannelWrapper<?> initialKey)
Initialize the channel with the specified host and port.

Parameters:
server - the NioServer to which the channel is registred.
host - the remote host to connect to.
port - the port to connect to on the remote host.
initialKey - the key associated with the initial connection.
Method Detail

initSocketChannel

protected SocketChannelClient initSocketChannel()
                                         throws Exception
Initialize the channel client.

Specified by:
initSocketChannel in class AbstractSocketChannelHandler
Returns:
a non-connected SocketChannelClient instance.
Throws:
Exception - if an error is raised during initialization.
See Also:
AbstractSocketChannelHandler.initSocketChannel()

postInit

protected void postInit()
                 throws Exception
This method is called after the channel is successfully conntected.

Specified by:
postInit in class AbstractSocketChannelHandler
Throws:
Exception - if an error is raised while performing the initialization.
See Also:
AbstractSocketChannelHandler.postInit()


Copyright © 2005-2010 JPPF Team.