wt.manager
Class ServerTable

java.lang.Object
  extended bywt.manager.ServerTable

public class ServerTable
extends Object


Field Summary
private static Method ON_REGISTER_SERVER_JMX_CB
           
private static Method ON_REMOVE_SERVER_JMX_CB
           
private static WTProperties props
           
static Object REMOVE_LOCK
           
private static String SERVER_MANAGER_JMX_HOOK_CLASSNAME
           
private  Hashtable serverTable
           
private  Hashtable serviceInstances
           
private static int STOP_TIMEOUT
           
 
Constructor Summary
ServerTable()
          Construct table to manager server references.
 
Method Summary
private  Remote checkRegistration(String service_name, Vector old_servers)
          Check for completion of new server registration.
 Vector getAllServers(String service_name)
          Get getAllServers
 Remote getNextServer(String service_name, Remote server)
          Get next server reference.
 Remote getServer(String service_name)
          Get server reference.
 Remote getServer(String service_name, Remote server)
          Get a specific server reference if it is registered.
 int getServiceInstances(String service_name)
           
private  void installServerSelector(String service_name)
           
 void registerServer(String service_name, Remote server)
          Register a new server reference.
private  void registerServerJmxCallback(String service_name, Remote server)
           
 void removeAll()
          Remove all server references from the table.
 void removeServer(String service_name, Remote server)
          Remove a server reference from the table.
 void removeServer(String service_name, Remote server, Exception report_exception)
          Remove a server reference from the table.
private  void removeServerJmxCallback(String service_name, Remote server, Exception report_exception)
           
 Remote waitForServer(String service_name, int timeout_sec, Vector old_servers)
          Block the current thread waiting for a given server to register.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STOP_TIMEOUT

private static final int STOP_TIMEOUT

SERVER_MANAGER_JMX_HOOK_CLASSNAME

private static final String SERVER_MANAGER_JMX_HOOK_CLASSNAME

ON_REGISTER_SERVER_JMX_CB

private static final Method ON_REGISTER_SERVER_JMX_CB

ON_REMOVE_SERVER_JMX_CB

private static final Method ON_REMOVE_SERVER_JMX_CB

props

private static WTProperties props

REMOVE_LOCK

public static final Object REMOVE_LOCK

serverTable

private Hashtable serverTable

serviceInstances

private Hashtable serviceInstances
Constructor Detail

ServerTable

public ServerTable()
Construct table to manager server references.

Method Detail

getServiceInstances

public int getServiceInstances(String service_name)
                        throws RemoteException
Throws:
RemoteException

installServerSelector

private void installServerSelector(String service_name)
                            throws RemoteException
Throws:
RemoteException

registerServer

public void registerServer(String service_name,
                           Remote server)
                    throws RemoteException
Register a new server reference.

Parameters:
service_name - name of the service
server - reference to a Remote server object
Throws:
RemoteException

registerServerJmxCallback

private void registerServerJmxCallback(String service_name,
                                       Remote server)

getServer

public Remote getServer(String service_name)
                 throws RemoteException
Get server reference.

Parameters:
service_name - name of the service
Throws:
RemoteException

getNextServer

public Remote getNextServer(String service_name,
                            Remote server)
                     throws RemoteException
Get next server reference.

Parameters:
service_name - name of the service
server - previous server
Throws:
RemoteException

getAllServers

public Vector getAllServers(String service_name)
                     throws RemoteException
Get getAllServers

Parameters:
service_name - name of the service
Throws:
RemoteException

getServer

public Remote getServer(String service_name,
                        Remote server)
                 throws RemoteException
Get a specific server reference if it is registered.

Parameters:
service_name - name of the service
server - desired server
Throws:
RemoteException

removeServer

public void removeServer(String service_name,
                         Remote server,
                         Exception report_exception)
                  throws RemoteException
Remove a server reference from the table. External servers that implement ManagedServer will be stopped by an asynchronous thread as a result of being removed from the table. Internal servers (those that are running in this VM) are not removed.

Parameters:
service_name - name of the service
server - reference to a Remote server object
report_exception - client reported exception to be displayed when removing this server
Throws:
RemoteException

removeServerJmxCallback

private void removeServerJmxCallback(String service_name,
                                     Remote server,
                                     Exception report_exception)

removeServer

public void removeServer(String service_name,
                         Remote server)
                  throws RemoteException
Remove a server reference from the table. External servers that implement ManagedServer will be stopped by an asynchronous thread as a result of being removed from the table. Internal servers (those that are running in this VM) are not removed.

Parameters:
service_name - name of the service
server - reference to a Remote server object
Throws:
RemoteException

removeAll

public void removeAll()
               throws RemoteException
Remove all server references from the table.

Throws:
RemoteException

waitForServer

public Remote waitForServer(String service_name,
                            int timeout_sec,
                            Vector old_servers)
                     throws InterruptedException,
                            RemoteException
Block the current thread waiting for a given server to register.

Parameters:
service_name - the service name
timeout_sec - number of seconds to wait
old_servers - vector of existing servers to overlook
Throws:
InterruptedException
RemoteException

checkRegistration

private Remote checkRegistration(String service_name,
                                 Vector old_servers)
                          throws RemoteException
Check for completion of new server registration.

Parameters:
service_name - the service name
old_servers - vector of existing servers to overlook
Throws:
RemoteException