com.sun.sgs.impl.client.simple
Class SimpleClientConnector

java.lang.Object
  extended by com.sun.sgs.impl.client.comm.ClientConnector
      extended by com.sun.sgs.impl.client.simple.SimpleClientConnector

 class SimpleClientConnector
extends ClientConnector

A basic implementation of a ClientConnector which uses an Connector to establish connections.

The constructor supports the following properties:


Field Summary
static String DEFAULT_CONNECT_FAILURE_MESSAGE
          The default connect failure message: "Unable to connect to server"
static long DEFAULT_CONNECT_TIMEOUT
          The default timeout for connect operations: 5000L ms
 
Constructor Summary
SimpleClientConnector(Properties properties)
          Creates a new connector with the given properties.
 
Method Summary
 void cancel()
          Cancels a pending connect operation on this ClientConnecton.
 void connect(ClientConnectionListener connectionListener)
          Actively initates a connection to the target remote address.
 
Methods inherited from class com.sun.sgs.impl.client.comm.ClientConnector
create, setConnectorFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CONNECT_TIMEOUT

public static final long DEFAULT_CONNECT_TIMEOUT
The default timeout for connect operations: 5000L ms

See Also:
Constant Field Values

DEFAULT_CONNECT_FAILURE_MESSAGE

public static final String DEFAULT_CONNECT_FAILURE_MESSAGE
The default connect failure message: "Unable to connect to server"

See Also:
Constant Field Values
Constructor Detail

SimpleClientConnector

SimpleClientConnector(Properties properties)
Creates a new connector with the given properties.

Parameters:
properties - the properties for this connector
Method Detail

cancel

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

Specified by:
cancel in class ClientConnector
Throws:
IOException - if an IO error occurs synchronously

connect

public void connect(ClientConnectionListener connectionListener)
             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.

Specified by:
connect in class ClientConnector
Parameters:
connectionListener - the listener for all IO events on the connection, including the result of the connection attempt
Throws:
IOException - if an IO error occurs synchronously

Project Darkstar, Version 0.9.10.7
2013-07-29 21:20:19

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