net.dpml.station.server
Class RemoteStation

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended byjava.rmi.server.UnicastRemoteObject
              extended bynet.dpml.station.server.RemoteStation
All Implemented Interfaces:
Manager, Remote, Serializable, Station

public class RemoteStation
extends UnicastRemoteObject
implements Station, Manager

The RemoteStation is responsible for the establishment of callback monitors to external processes established by the station manager.

Version:
1.0.1
Author:
Digital Product Meta Library
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface net.dpml.station.Station
STATION_KEY
 
Constructor Summary
RemoteStation(Logger logger, TransitModel model, int port, URL registryStorageUrl)
          Creation of a station instance.
 
Method Summary
 Application getApplication(String key)
          Return an application reference for the supplied key.
 ApplicationRegistry getApplicationRegistry()
          Return the application registry.
 Callback getCallback(String id)
          Return an callback handler for the supplied id.
 String[] getInfo()
          Return a string containing info about the general setup of the station.
static void setShutdownHook(RemoteStation station)
          Create a shutdown hook that will trigger shutdown of the supplied plugin.
 void shutdown()
          Shutdown the station.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RemoteStation

public RemoteStation(Logger logger,
                     TransitModel model,
                     int port,
                     URL registryStorageUrl)
              throws Exception
Creation of a station instance.

Parameters:
logger - the assigned logging channel
model - the transit model
port - the station port
registryStorageUrl - uri defining the registry backing store
Throws:
Exception - if a exception occurs during establishment
Method Detail

getInfo

public String[] getInfo()
Return a string containing info about the general setup of the station.

Specified by:
getInfo in interface Manager
Returns:
station configuration info

getCallback

public Callback getCallback(String id)
                     throws UnknownKeyException,
                            RemoteException
Return an callback handler for the supplied id.

Specified by:
getCallback in interface Station
Parameters:
id - the callback id
Returns:
the callback handler
Throws:
UnknownKeyException - if the id is unknown
RemoteException - if a remote error occurs

shutdown

public void shutdown()
Shutdown the station.

Specified by:
shutdown in interface Manager

getApplicationRegistry

public ApplicationRegistry getApplicationRegistry()
Return the application registry.

Specified by:
getApplicationRegistry in interface Manager
Returns:
the registry

getApplication

public Application getApplication(String key)
                           throws UnknownKeyException,
                                  RemoteException
Return an application reference for the supplied key.

Specified by:
getApplication in interface Manager
Parameters:
key - the application key
Returns:
the application
Throws:
UnknownKeyException - if the key is unknown
RemoteException - if a remote error occurs

setShutdownHook

public static void setShutdownHook(RemoteStation station)
Create a shutdown hook that will trigger shutdown of the supplied plugin.

Parameters:
station - the station