Class RmiRegistry
- 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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
LOCALHOST
protected static org.apache.log4j.Logger
LOGGER
-
Fields inherited from class java.rmi.server.RemoteObject
ref
-
Fields inherited from interface org.palladiosimulator.protocom.framework.java.se.registry.IRmiRegistry
PCM_EXPERIMENT_MANAGER_REGISTRY, PCM_RMI_REGISTRY
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bindExperimentManager(IExperimentManager experimentManager)
Binds the calling experiment manager to the registry.void
bindPort(String name, Remote portClass)
Binds the calling port to the registry.List<IExperimentManager>
getExperimentManagers()
Returns the list of associated experiment managers.static String
getIpFromArguments(String[] args)
Returns an IP from an argument string array or LOCALHOST insteadstatic int
getPortFromArguments(String[] args)
Returns an port number from an argument string array or 1099 insteadstatic int
getRegistryPort()
static String
getRemoteAddress()
static Remote
lookup(String name)
static void
main(String[] args)
static void
registerPort(String registryIP, int registryPort, Remote component, String componentName)
Registers a port to a RMI registry at the given IP.static void
setRegistryPort(int configuredRegistryPort)
static void
setRemoteAddress(String configuredRemoteAddr)
static void
startRegistry()
-
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObject
-
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
-
-
-
-
Field Detail
-
LOGGER
protected static final org.apache.log4j.Logger LOGGER
-
LOCALHOST
public static final String LOCALHOST
- See Also:
- Constant Field Values
-
-
Method Detail
-
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 interfaceIRmiRegistry
- 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 registryport
- instance of the portportName
- 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:
-
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 interfaceIRmiRegistry
- 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 interfaceIRmiRegistry
- Returns:
-
-