org.glassfish.grizzly
Class AbstractSocketConnectorHandler

java.lang.Object
  extended by org.glassfish.grizzly.AbstractSocketConnectorHandler
All Implemented Interfaces:
SocketConnectorHandler
Direct Known Subclasses:
TCPNIOConnectorHandler, UDPNIOConnectorHandler

public abstract class AbstractSocketConnectorHandler
extends Object
implements SocketConnectorHandler

Abstract class simplifies the implementation of SocketConnectorHandler interface by preimplementing some of its methods.

Author:
Alexey Stashok

Field Summary
protected  Processor defaultProcessor
           
protected  ProcessorSelector defaultProcessorSelector
           
protected  Transport transport
           
 
Constructor Summary
AbstractSocketConnectorHandler(Transport transport)
           
 
Method Summary
 Future<Connection> connect(SocketAddress remoteAddress)
          Creates, initializes and connects socket to the specific SocketAddress and returns Connection, representing socket.
abstract  Future<Connection> connect(SocketAddress remoteAddress, SocketAddress localAddress)
          Creates, initializes socket, binds it to the specific local and remote SocketAddress and returns Connection, representing socket.
 Future<Connection> connect(String host, int port)
          Creates, initializes and connects socket to the specific remote host and port and returns Connection, representing socket.
 Processor getProcessor()
          Get the default Processor to process IOEvent, occuring on connection phase.
 ProcessorSelector getProcessorSelector()
          Gets the default ProcessorSelector, which will be used to get Processor to process I/O events, occuring on connection phase.
 void setProcessor(Processor defaultProcessor)
          Set the default Processor to process IOEvent, occuring on connection phase.
 void setProcessorSelector(ProcessorSelector defaultProcessorSelector)
          Sets the default ProcessorSelector, which will be used to get Processor to process I/O events, occuring on connection phase.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transport

protected Transport transport

defaultProcessor

protected Processor defaultProcessor

defaultProcessorSelector

protected ProcessorSelector defaultProcessorSelector
Constructor Detail

AbstractSocketConnectorHandler

public AbstractSocketConnectorHandler(Transport transport)
Method Detail

connect

public Future<Connection> connect(String host,
                                  int port)
                           throws IOException
Description copied from interface: SocketConnectorHandler
Creates, initializes and connects socket to the specific remote host and port and returns Connection, representing socket.

Specified by:
connect in interface SocketConnectorHandler
Parameters:
host - remote host to connect to.
port - remote port to connect to.
Returns:
Future of connect operation, which could be used to get resulting Connection.
Throws:
IOException

connect

public Future<Connection> connect(SocketAddress remoteAddress)
                           throws IOException
Description copied from interface: SocketConnectorHandler
Creates, initializes and connects socket to the specific SocketAddress and returns Connection, representing socket.

Specified by:
connect in interface SocketConnectorHandler
Parameters:
remoteAddress - remote address to connect to.
Returns:
Future of connect operation, which could be used to get resulting Connection.
Throws:
IOException

connect

public abstract Future<Connection> connect(SocketAddress remoteAddress,
                                           SocketAddress localAddress)
                                    throws IOException
Description copied from interface: SocketConnectorHandler
Creates, initializes socket, binds it to the specific local and remote SocketAddress and returns Connection, representing socket.

Specified by:
connect in interface SocketConnectorHandler
Parameters:
remoteAddress - remote address to connect to.
localAddress - local address to bind socket to.
Returns:
Future of connect operation, which could be used to get resulting Connection.
Throws:
IOException

getProcessor

public Processor getProcessor()
Description copied from interface: SocketConnectorHandler
Get the default Processor to process IOEvent, occuring on connection phase.

Specified by:
getProcessor in interface SocketConnectorHandler
Returns:
the default Processor to process IOEvent, occuring on connection phase.

setProcessor

public void setProcessor(Processor defaultProcessor)
Description copied from interface: SocketConnectorHandler
Set the default Processor to process IOEvent, occuring on connection phase.

Specified by:
setProcessor in interface SocketConnectorHandler
Parameters:
defaultProcessor - the default Processor to process IOEvent, occuring on connection phase.

getProcessorSelector

public ProcessorSelector getProcessorSelector()
Description copied from interface: SocketConnectorHandler
Gets the default ProcessorSelector, which will be used to get Processor to process I/O events, occuring on connection phase.

Specified by:
getProcessorSelector in interface SocketConnectorHandler
Returns:
the default ProcessorSelector, which will be used to get Processor to process I/O events, occuring on connection phase.

setProcessorSelector

public void setProcessorSelector(ProcessorSelector defaultProcessorSelector)
Description copied from interface: SocketConnectorHandler
Sets the default ProcessorSelector, which will be used to get Processor to process I/O events, occuring on connection phase.

Specified by:
setProcessorSelector in interface SocketConnectorHandler
Parameters:
defaultProcessorSelector - the default ProcessorSelector, which will be used to get Processor to process I/O events, occuring on connection phase.


Copyright © 2009 SUN Microsystems. All Rights Reserved.