psl.worklets
Class RTU_RegistrarImpl

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--psl.worklets.RTU_RegistrarImpl
All Implemented Interfaces:
java.rmi.Remote, RTU_Registrar, java.io.Serializable

class RTU_RegistrarImpl
extends java.rmi.server.UnicastRemoteObject
implements RTU_Registrar

Acts as an intermediary between the registry and the RTU for RMI server registration purposes.


Field Summary
private  java.lang.String _host
          Hostname of the system with the associated RMI server
private  java.lang.String _name
          RMI name of the associated RMI server
private  int _port
          Port that the RMI server handle is on, usually the port of the WVM_Registry
private  java.lang.String _registrationKey
          Unique registration key to be associated with the RMI server
private  WVM_RMI_Transporter.RTU _rtu
          RTU that this registrar will handle
private  java.lang.String _WVM_URL
          Unique WVM_URL of the RMI server
 
Fields inherited from class java.rmi.server.UnicastRemoteObject
 
Fields inherited from class java.rmi.server.RemoteServer
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
(package private) RTU_RegistrarImpl(java.lang.String name, java.lang.String host, int port, java.lang.String rng, java.util.Date seed)
          Creates a RTU_Registrar
 
Method Summary
(package private)  void bind(java.lang.String rmibind, WVM_RMI_Transporter.RTU rtu)
          Binds the given RTU to the WVM_Registry
 java.lang.String getRegistrationKey()
          Gets the registration key of the RTU/RMI server
 java.rmi.Remote getServer()
          Gets the RTU/RMI server
 java.lang.String getWVM_URL()
          Gets the WVM_URL of the RTU/RMI server.
(package private)  void rebind(java.lang.String rmibind, WVM_RMI_Transporter.RTU rtu)
          Rebinds the given RTU to the WVM_Registry
 
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
 

Field Detail

_name

private final java.lang.String _name
RMI name of the associated RMI server


_host

private final java.lang.String _host
Hostname of the system with the associated RMI server


_port

private final int _port
Port that the RMI server handle is on, usually the port of the WVM_Registry


_registrationKey

private final java.lang.String _registrationKey
Unique registration key to be associated with the RMI server


_WVM_URL

private final java.lang.String _WVM_URL
Unique WVM_URL of the RMI server


_rtu

private WVM_RMI_Transporter.RTU _rtu
RTU that this registrar will handle

Constructor Detail

RTU_RegistrarImpl

RTU_RegistrarImpl(java.lang.String name,
                  java.lang.String host,
                  int port,
                  java.lang.String rng,
                  java.util.Date seed)
            throws java.rmi.RemoteException
Creates a RTU_Registrar

Throws:
java.rmi.RemoteException - if RTU_Registrar cannot be created
Method Detail

bind

void bind(java.lang.String rmibind,
          WVM_RMI_Transporter.RTU rtu)
    throws java.rmi.RemoteException,
           java.rmi.AlreadyBoundException,
           java.net.MalformedURLException
Binds the given RTU to the WVM_Registry

Throws:
java.rmi.RemoteException - if the RTU could not be bound
java.rmi.AlreadyBoundException - if the given rmibind URL is already used
java.net.MalformedURLException - if the rmibind URL is malformed

rebind

void rebind(java.lang.String rmibind,
            WVM_RMI_Transporter.RTU rtu)
      throws java.rmi.RemoteException,
             java.net.MalformedURLException
Rebinds the given RTU to the WVM_Registry

Throws:
java.rmi.RemoteException - if the RTU could not be rebound
java.net.MalformedURLException - if the rmibind URL is malformed

getServer

public java.rmi.Remote getServer()
                          throws java.rmi.RemoteException
Gets the RTU/RMI server

Specified by:
getServer in interface RTU_Registrar
Throws:
java.rmi.RemoteException - if the server cannot be reached

getRegistrationKey

public java.lang.String getRegistrationKey()
                                    throws java.rmi.RemoteException
Gets the registration key of the RTU/RMI server

Specified by:
getRegistrationKey in interface RTU_Registrar
Throws:
java.rmi.RemoteException - if we cannot get the registration key

getWVM_URL

public java.lang.String getWVM_URL()
                            throws java.rmi.RemoteException
Gets the WVM_URL of the RTU/RMI server. The WVM_URL is a URL that represents a WVM location in the form of : remote_hostname@RMI_name:remote_port where the RMI_name is optional.

Specified by:
getWVM_URL in interface RTU_Registrar
Throws:
java.rmi.RemoteException - if we cannot get the WVM_URL