|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.distributed.client.ClientServerInteractionManager
public class ClientServerInteractionManager
Manager that handles and eases the discovery of services using JINI. Helps the client service discovery. It discovers the lookup service. A configuration file can be provided in the constructor to specify unicast locators, groups to join and the service to be located. After discovering a lookup service it queries for the given service and filters the dead services.
Red (cxh) |
Red (kapokasa) |
Field Summary | |
---|---|
private java.util.LinkedList |
aliveServices
List of alive services discovered and filtered. |
private net.jini.lookup.LookupCache |
cache
Cache of registrars. |
private static java.lang.String |
CLIENT
Key to be loaded from the configuration file. |
private net.jini.core.entry.Entry[] |
entries
Information entries. |
private java.lang.String[] |
groups
Groups. |
private int |
requiredServices
Number of required services. |
private java.rmi.Remote |
service
Service that we look for. |
private net.jini.core.discovery.LookupLocator[] |
unicastLocators
Array of unicastLocators. |
private boolean |
VERBOSE
Shows debug messages when true. |
private static long |
WAITFOR
Waiting time to receive responses when finding services. |
Constructor Summary | |
---|---|
ClientServerInteractionManager(boolean verbose)
Construct a ClientServerInteractionManager initializing it with a given VERBOSE option. |
Method Summary | |
---|---|
void |
discarded(net.jini.discovery.DiscoveryEvent evt)
Required by DiscoveryListener interface. |
void |
discovered(net.jini.discovery.DiscoveryEvent evt)
Required by DiscoveryListener interface. |
private void |
filterCacheServices()
Construct the list of aliveServices. |
private void |
getConfiguration(java.lang.String configFileName)
Loads the configuration file. |
java.util.LinkedList |
getServices()
Returns the list of alive services. |
void |
init(java.lang.String configFileName)
Initializes the ClientServerInteractionManager. |
void |
serviceAdded(net.jini.lookup.ServiceDiscoveryEvent evt)
Required by ServiceDiscoveryListener interface. |
void |
serviceChanged(net.jini.lookup.ServiceDiscoveryEvent evt)
Required by ServiceDiscoveryListener interface. |
void |
serviceRemoved(net.jini.lookup.ServiceDiscoveryEvent evt)
Required by ServiceDiscoveryListener interface. |
void |
setRequiredServices(int requiredServices)
Specify the number of required services. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int requiredServices
private static final java.lang.String CLIENT
private static final long WAITFOR
private java.rmi.Remote service
private net.jini.core.discovery.LookupLocator[] unicastLocators
private net.jini.core.entry.Entry[] entries
private java.lang.String[] groups
private net.jini.lookup.LookupCache cache
private java.util.LinkedList aliveServices
private boolean VERBOSE
Constructor Detail |
---|
public ClientServerInteractionManager(boolean verbose)
verbose
- If true, flag messages will be printed in the standard
output.Method Detail |
---|
public void discarded(net.jini.discovery.DiscoveryEvent evt)
discarded
in interface net.jini.discovery.DiscoveryListener
evt
- The event that describes the discarded registrarspublic void discovered(net.jini.discovery.DiscoveryEvent evt)
discovered
in interface net.jini.discovery.DiscoveryListener
evt
- The event that describes the discovered registrarspublic java.util.LinkedList getServices()
public void init(java.lang.String configFileName)
configFileName
- String containing the name and/or path of the
configuration file to be loaded.public void serviceAdded(net.jini.lookup.ServiceDiscoveryEvent evt)
serviceAdded
in interface net.jini.lookup.ServiceDiscoveryListener
evt
- a ServiceDiscoveryEvent object containing references to the
service item corresponding to the event, including representations of
the service's state both before and after the event.public void serviceChanged(net.jini.lookup.ServiceDiscoveryEvent evt)
serviceChanged
in interface net.jini.lookup.ServiceDiscoveryListener
evt
- a ServiceDiscoveryEvent object containing references to the
service item corresponding to the event, including representations of
the service's state both before and after the event.public void serviceRemoved(net.jini.lookup.ServiceDiscoveryEvent evt)
serviceRemoved
in interface net.jini.lookup.ServiceDiscoveryListener
evt
- a ServiceDiscoveryEvent object containing references to the
service item corresponding to the event, including representations of
the service's state both before and after the event.public void setRequiredServices(int requiredServices)
requiredServices
- The number of requiredServices.private void filterCacheServices()
private void getConfiguration(java.lang.String configFileName)
configFileName
- A string containing the name and/or path of the
configuration file.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |