ch.epfl.lsr.apex.connection
Class APEXConnectionListener

java.lang.Object
  extended bych.epfl.lsr.apex.connection.APEXConnectionListener
All Implemented Interfaces:
Runnable

public class APEXConnectionListener
extends Object
implements Runnable

The APEXConnectionListener is a connection listener thread for a relay, either apex-edge or apex-mesh connection.

Author:
Marc Stoecklin

Field Summary
static int CONNECTION_LISTENER
          internal state: listening
static String EDGECONNECTION
          connection type: edge connection
static int IDLE
          internal state: idle
static String MESHCONNECTION
          connection type: mesh connection
 
Constructor Summary
APEXConnectionListener(APEXManager manager, int port, String type)
          Instantiates a new APEX connection listener which uses the APEXProfile and listens on the specified port.
 
Method Summary
 boolean initListener()
          Initiates a listener with the APEXProfile
 void run()
          State machine for the connection thread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IDLE

public static final int IDLE
internal state: idle

See Also:
Constant Field Values

CONNECTION_LISTENER

public static final int CONNECTION_LISTENER
internal state: listening

See Also:
Constant Field Values

EDGECONNECTION

public static final String EDGECONNECTION
connection type: edge connection

See Also:
Constant Field Values

MESHCONNECTION

public static final String MESHCONNECTION
connection type: mesh connection

See Also:
Constant Field Values
Constructor Detail

APEXConnectionListener

public APEXConnectionListener(APEXManager manager,
                              int port,
                              String type)

Instantiates a new APEX connection listener which uses the APEXProfile and listens on the specified port.

The listener is initiated by the method initListener().

Parameters:
manager - APEXManager which accepts call-backs on incoming messages
port - the port to open for this connection listener
type - specifies the type for this APEX connection listener (either APEXConnectionListener.EDGECONNECTION or APEXConnectionListener.MESHCONNECTION)
See Also:
EDGECONNECTION, MESHCONNECTION
Method Detail

initListener

public boolean initListener()
Initiates a listener with the APEXProfile

Returns:
returns status if the listener could have been startet correctly

run

public void run()
State machine for the connection thread

Specified by:
run in interface Runnable