Class 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:
    Serialized Form
    • Field Detail

      • LOGGER

        protected static final org.apache.log4j.Logger LOGGER
    • Method Detail

      • 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)