com.ls.lars.communication
Class RMIConnector

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--com.ls.lars.communication.RMIConnector
All Implemented Interfaces:
IRMIConnector, Remote, Serializable

public class RMIConnector
extends UnicastRemoteObject
implements IRMIConnector

This Class is running on the platform and builds the connection between a remote agent and the platform using RMI. The function included in this class will be called remote from the remote agent.

Version:
$Revision: 1.7 $
Author:
Last modified by $Author: ODrugan $
See Also:
Serialized Form

Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
RMIConnector(com.ls.lars.communication.RMIMessenger rmiMessenger)
          Sets the message router to the local message router from the platform
 
Method Summary
 void closeConnection()
          closes the remote connection that the remote object can unbind itself from rmi registry
 void pushMessageToRemoteSide(Message message)
          Transfers a message to the remote side.
 void securityCheck(String clientIpAddress, String clientAgentName)
          checks the permission to connect for the specified agent from the given IP address
 void setCallbackReference(IRMIConnector reference)
          The object referenze of a RMI object is set thus callbacks can be done.
 void verifyConnectionStatus()
          This method will be called by the 'remote' side in order to verify the current connection status Note: This method returns nothing, as the success of this method depends on the fact whether or not the caller catches a RemoteException.
 
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

RMIConnector

public RMIConnector(com.ls.lars.communication.RMIMessenger rmiMessenger)
             throws RemoteException
Sets the message router to the local message router from the platform
Parameters:
rmiMessenger -  
Throws:
RemoteException - if remote method invocation fails
Method Detail

securityCheck

public void securityCheck(String clientIpAddress,
                          String clientAgentName)
                   throws ConnectionException
checks the permission to connect for the specified agent from the given IP address
Specified by:
securityCheck in interface IRMIConnector
Parameters:
clientIpAddress - ip address of the agent
clientAgentName - name of the agent
Throws:
ConnectionException - If the security check fails

setCallbackReference

public void setCallbackReference(IRMIConnector reference)
                          throws RemoteException
The object referenze of a RMI object is set thus callbacks can be done.
Specified by:
setCallbackReference in interface IRMIConnector
Parameters:
reference - object reference used with callbacks
Throws:
RemoteException - If remote method invocation fails

pushMessageToRemoteSide

public void pushMessageToRemoteSide(Message message)
                             throws RemoteException
Transfers a message to the remote side.
Specified by:
pushMessageToRemoteSide in interface IRMIConnector
Parameters:
message - message to be sent
Throws:
RemoteException - If remote method invocation fails

closeConnection

public void closeConnection()
closes the remote connection that the remote object can unbind itself from rmi registry
Specified by:
closeConnection in interface IRMIConnector
Following copied from interface: com.ls.lars.communication.IRMIConnector
Throws:
RemoteException - if remote method invocation fails

verifyConnectionStatus

public void verifyConnectionStatus()
                            throws RemoteException
This method will be called by the 'remote' side in order to verify the current connection status Note: This method returns nothing, as the success of this method depends on the fact whether or not the caller catches a RemoteException.
Specified by:
verifyConnectionStatus in interface IRMIConnector
Throws:
RemoteException - If the the verification fails