java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
org.palladiosimulator.protocom.framework.java.se.registry.RmiRegistry
All Implemented Interfaces:
Serializable, Remote, IRmiRegistry

public class RmiRegistry extends UnicastRemoteObject implements IRmiRegistry, Serializable
RMI registry service for ProtoCom. It can be started on any hardware node of the ProtoCom system. Ports register themselves at this service using their name and assembly context. TODO: Split this class into two parts: One for managing remote connection to the registry and one for the registry service itself.
See Also:
  • Field Details

    • LOGGER

      protected static final org.apache.log4j.Logger LOGGER
    • LOCALHOST

      public static final String LOCALHOST
      See Also:
  • Method Details

    • bindPort

      public void bindPort(String name, Remote portClass) throws RemoteException
      Description copied from interface: IRmiRegistry
      Binds the calling port to the registry.
      Specified by:
      bindPort in interface IRmiRegistry
      Parameters:
      name - name of the port, including assembly context.
      portClass - the port
      Throws:
      RemoteException
    • startRegistry

      public static void startRegistry()
    • registerPort

      public static void registerPort(String registryIP, int registryPort, Remote component, String componentName)
      Registers a port to a RMI registry at the given IP. This method remotely calls bindPort.
      Parameters:
      registryIP - IP of the registry
      port - instance of the port
      portName - unique name of the port, using assembly context
    • getIpFromArguments

      public static String getIpFromArguments(String[] args)
      Returns an IP from an argument string array or LOCALHOST instead
      Parameters:
      args -
      Returns:
    • getPortFromArguments

      public static int getPortFromArguments(String[] args)
      Returns an port number from an argument string array or 1099 instead
      Parameters:
      args -
      Returns:
    • lookup

      public static Remote lookup(String name)
      Parameters:
      name -
      Returns:
    • getRemoteAddress

      public static String getRemoteAddress()
    • setRemoteAddress

      public static void setRemoteAddress(String configuredRemoteAddr)
    • getRegistryPort

      public static int getRegistryPort()
    • setRegistryPort

      public static void setRegistryPort(int configuredRegistryPort)
    • main

      public static void main(String[] args)
    • bindExperimentManager

      public void bindExperimentManager(IExperimentManager experimentManager) throws RemoteException
      Description copied from interface: IRmiRegistry
      Binds the calling experiment manager to the registry.
      Specified by:
      bindExperimentManager in interface IRmiRegistry
      Parameters:
      experimentManager - the manager
      Throws:
      RemoteException
    • getExperimentManagers

      public List<IExperimentManager> getExperimentManagers()
      Description copied from interface: IRmiRegistry
      Returns the list of associated experiment managers.
      Specified by:
      getExperimentManagers in interface IRmiRegistry
      Returns: