com.sun.sgs.impl.client.comm
Class ClientConnector

java.lang.Object
  extended by com.sun.sgs.impl.client.comm.ClientConnector
Direct Known Subclasses:
SimpleClientConnector

public abstract class ClientConnector
extends Object

An abstract mechanism for actively initiating a ClientConnection.


Constructor Summary
protected ClientConnector()
          Only allow construction by subclasses.
 
Method Summary
abstract  void cancel()
          Cancels a pending connect operation on this ClientConnecton.
abstract  void connect(ClientConnectionListener listener)
          Actively initates a connection to the target remote address.
static ClientConnector create(Properties properties)
          Creates a ClientConnector according to the given properties.
protected static void setConnectorFactory(ClientConnectorFactory factory)
          Sets the ClientConnectorFactory that will be used to create new ClientConnectors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientConnector

protected ClientConnector()
Only allow construction by subclasses.

Method Detail

create

public static ClientConnector create(Properties properties)
Creates a ClientConnector according to the given properties.

Parameters:
properties - which affect the implementation of ClientConnector returned
Returns:
a ClientConnector

setConnectorFactory

protected static void setConnectorFactory(ClientConnectorFactory factory)
Sets the ClientConnectorFactory that will be used to create new ClientConnectors.

Parameters:
factory - the factory to create new ClientConnectors

connect

public abstract void connect(ClientConnectionListener listener)
                      throws IOException
Actively initates a connection to the target remote address. This call is non-blocking. ClientConnectionListener.connected(com.sun.sgs.impl.client.comm.ClientConnection) will be called asynchronously on the listener upon successful connection, or ClientConnectionListener.disconnected(boolean, byte[]) if it fails.

Parameters:
listener - the listener for all IO events on the connection, including the result of the connection attempt
Throws:
IOException - if an IO error occurs synchronously
SecurityException - if a security manager has been installed and it does not permit access to the remote endpoint

cancel

public abstract void cancel()
                     throws IOException
Cancels a pending connect operation on this ClientConnecton.

Throws:
IOException - if an IO error occurs synchronously

Project Darkstar, Version 0.9.11.3
2013-07-29 21:53:29

Copyright © 2007-2013 Sun Microsystems, Inc. All rights reserved