Package ptolemy.distributed.rmi
Class DistributedServerRMIGeneric
- java.lang.Object
-
- ptolemy.distributed.rmi.DistributedServerRMIGeneric
-
- All Implemented Interfaces:
java.util.EventListener
,net.jini.discovery.DiscoveryListener
,net.jini.lookup.ServiceIDListener
public class DistributedServerRMIGeneric extends java.lang.Object implements net.jini.lookup.ServiceIDListener, net.jini.discovery.DiscoveryListener
A distributed server to execute ptolemy actors in a distributed manner. It uses Jini as discovery protocol. It performs the following tasks:- Prepares for discovery of a service locator.
- Loading of various settings as Unicast locators and service class.
- Discovers the service locator (unicast, multicast or both).
- Creates and exports the service proxy (that allows for RMI calls).
- Stays alive.
- Since:
- Ptolemy II 5.1
- Version:
- $Id$
- Author:
- Daniel Lazaro Cuadrado (kapokasa@kom.aau.dk)
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Red (kapokasa)
-
-
Constructor Summary
Constructors Constructor Description DistributedServerRMIGeneric(java.lang.String configFileName)
Construct a DistributedServerRMIGeneric with a configuration file.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
discarded(net.jini.discovery.DiscoveryEvent evt)
Called when one or more lookup service registrars has been discarded.void
discovered(net.jini.discovery.DiscoveryEvent evt)
Called when one or more lookup service registrars has been discovered.static void
main(java.lang.String[] args)
Create a new instance of this application, passing it the first command-line argument (configuration file).void
serviceIDNotify(net.jini.core.lookup.ServiceID serviceID)
Required by the ServiceIDListener interface.void
tryRetrieveServiceId(java.io.File serviceIdFile)
Try to load the service ID from file.
-
-
-
Constructor Detail
-
DistributedServerRMIGeneric
public DistributedServerRMIGeneric(java.lang.String configFileName)
Construct a DistributedServerRMIGeneric with a configuration file. It performs the following tasks:- Prepares for discovery of a service locator.
- Loading of various settings as Unicast locators and service class.
- Discovers the service locator (unicast, multicast or both).
- Creates and exports the service proxy (that allows for RMI calls).
- Stays alive.
- Parameters:
configFileName
- The configuration file.
-
-
Method Detail
-
discarded
public void discarded(net.jini.discovery.DiscoveryEvent evt)
Called when one or more lookup service registrars has been discarded. The method should return quickly; e.g., it should not make remote calls.- Specified by:
discarded
in interfacenet.jini.discovery.DiscoveryListener
- Parameters:
evt
- The event that describes the discovered registrars.
-
discovered
public void discovered(net.jini.discovery.DiscoveryEvent evt)
Called when one or more lookup service registrars has been discovered. The method should return quickly; e.g., it should not make remote calls.- Specified by:
discovered
in interfacenet.jini.discovery.DiscoveryListener
- Parameters:
evt
- The event that describes the discovered registrars.
-
main
public static void main(java.lang.String[] args)
Create a new instance of this application, passing it the first command-line argument (configuration file). It stays alive.- Parameters:
args
- The command-line arguments.
-
serviceIDNotify
public void serviceIDNotify(net.jini.core.lookup.ServiceID serviceID)
Required by the ServiceIDListener interface. Called when the JoinManager gets a valid ServiceID from a lookup service.- Specified by:
serviceIDNotify
in interfacenet.jini.lookup.ServiceIDListener
- Parameters:
serviceID
- the service ID assigned by the lookup service.
-
tryRetrieveServiceId
public void tryRetrieveServiceId(java.io.File serviceIdFile)
Try to load the service ID from file. It isn't an error if we can't load it, because maybe this is the first time this service was run.- Parameters:
serviceIdFile
- name of the file where the serviceID is stored.
-
-