Class RemoteHost

java.lang.Object
de.mid.innovator.m2msdk.model.remote.RemoteHost

public class RemoteHost extends Object
Host managing and creating RMI server, RMI registry and RMI objects. For each class, only one instance can be handled.
Version:
11.3.2
Author:
jmback
  • Constructor Details

    • RemoteHost

      public RemoteHost(SessionInterface iSession)
      Initialize the security.
      Parameters:
      iSession -
  • Method Details

    • register

      public void register(RemoteServerFactory remoteServerFactory) throws RemoteException
      Register a remote server factory at RMI registry. Ensure that RMI registry is started. This method is used by the server.
      Parameters:
      remoteServerFactory - remote object, already created and to be published
      Throws:
      RemoteException
    • register

      public void register(SkeletonSession skeletonSession) throws RemoteException
      Register a skeleton session at RMI registry. Ensure that RMI registry is started. This method is used by the server.
      Parameters:
      skeletonSession - remote object, already created and to be published
      Throws:
      RemoteException
    • export

      public Remote export(Remote skeletonObject)
      Export a skeleton object for use in remote client.
      Parameters:
      skeletonObject - skeleton object
      Returns:
      remote object
    • getSession

      public SessionInterface getSession()
      For requests from client. This method returns an instance of the specified class. If option RMIServer is set, the RMI server is requested for the requested object. If the requested object has been registered,it will be returned. In all other cases, a null is returned. This method is used by the client.
      Returns:
      Instance living remote or null
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getFirstPortNumber

      public int getFirstPortNumber()
      Get minimum number of port for RMI server, not for RMI server factory.
      Returns:
      port number
    • getLastPortNumber

      public int getLastPortNumber()
      Get maximum number of port for RMI server, not for RMI server factory.
      Returns:
      port number
    • getFactoryPortNumber

      public int getFactoryPortNumber()
      Get factory number of port for RMI server, not for RMI server factory.
      Returns:
      port number
    • checkPort

      public boolean checkPort(int iPort)
      Check if the port is used for RMI.
      Parameters:
      iPort - port number
      Returns:
      true if port is free to use.
    • unregister

      public void unregister(boolean bForce)
    • getProcess

      public RemoteProcessInterface getProcess(int iPort)
      Get process registered on this port.
      Parameters:
      iPort -
      Returns:
      null means no process is registered here.