Remote System Explorer DataStore
Release 3.0

org.eclipse.dstore.core.server
Class ServerLauncher.ConnectionListener

java.lang.Object
  extended by java.lang.Thread
      extended by org.eclipse.dstore.core.server.ServerLauncher.ConnectionListener
All Implemented Interfaces:
Runnable, EventListener, HandshakeCompletedListener
Enclosing class:
ServerLauncher

public class ServerLauncher.ConnectionListener
extends Thread
implements HandshakeCompletedListener

An instances of this class get loaded whenever a client requests access to a DataStore server. The ConnectionListener attempts to launch a server under the client user's ID, communicating back information to the client so that if may connect to the launched server. If the authentification and connection to the server are successful, ConnectionListener continues to monitor the server connection until it is terminated.


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ServerLauncher.ConnectionListener(Socket socket)
          Constructor
 
Method Summary
 void finalize()
          Called when shutdown
 String getServerPort()
          Returns the DataStore server port used
 void handshakeCompleted(HandshakeCompletedEvent event)
           
 boolean isDone()
          Indicates whether the connection has terminated or not
 boolean listen()
          Attempt to start a new DataStore server.
 void run()
          Listens to the connection and prints any output while the connection is active
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServerLauncher.ConnectionListener

public ServerLauncher.ConnectionListener(Socket socket)
Constructor

Parameters:
socket - a socket to the daemon
Method Detail

finalize

public void finalize()
              throws Throwable
Called when shutdown

Overrides:
finalize in class Object
Throws:
Throwable

run

public void run()
Listens to the connection and prints any output while the connection is active

Specified by:
run in interface Runnable
Overrides:
run in class Thread

isDone

public boolean isDone()
Indicates whether the connection has terminated or not

Returns:
true if the connection has terminated

getServerPort

public String getServerPort()
Returns the DataStore server port used

Returns:
the server port

listen

public boolean listen()
Attempt to start a new DataStore server. The port and the ticket for a newly started DataStore are captured and sent back to the client so that it may connect to the server.

Returns:
whether the server started successfully

handshakeCompleted

public void handshakeCompleted(HandshakeCompletedEvent event)
Specified by:
handshakeCompleted in interface HandshakeCompletedListener

Remote System Explorer DataStore
Release 3.0

Guidelines for using DataStore APIs.