stsci.client
Class JiniArcClient

java.lang.Object
  |
  +--stsci.client.JiniArcClient
All Implemented Interfaces:
ArchiveServer, net.jini.discovery.DiscoveryListener, java.util.EventListener, java.rmi.Remote

public class JiniArcClient
extends java.lang.Object
implements net.jini.discovery.DiscoveryListener, ArchiveServer

Im plemne tthe clinet side to look for JINI archives and the Jini Archive Server Then just behave like and ArchiveServer


Field Summary
protected  java.lang.String[] groups
          The lookup groups (or an empty array).
protected  java.lang.String lookupURL
          The lookup URL (or null).
protected static int MAX_RETRIES
          Maximum number of retries of nextMessage.
protected static int MAX_WAIT
          How long to wait for matches before giving up.
protected  java.util.List registrars
          The list of unexamined registrars.
protected static ArchiveServer serv
           
protected  java.lang.String[] typeArgs
          The stream and attribute types.
 
Constructor Summary
JiniArcClient()
          Create a new JiniArcClient object
 
Method Summary
 void discarded(net.jini.discovery.DiscoveryEvent ev)
          Notified by LookupDiscovery code when one or more found registries vanishes.
 void discovered(net.jini.discovery.DiscoveryEvent ev)
          Notified by LookupDiscovery code when it finds one or more registries.
 void execute()
           
 ArchiveDescriptor[] listArchives()
          List the names of the known archives.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

groups

protected java.lang.String[] groups
The lookup groups (or an empty array).

lookupURL

protected java.lang.String lookupURL
The lookup URL (or null).

typeArgs

protected java.lang.String[] typeArgs
The stream and attribute types.

registrars

protected java.util.List registrars
The list of unexamined registrars.

MAX_WAIT

protected static final int MAX_WAIT
How long to wait for matches before giving up.

MAX_RETRIES

protected static final int MAX_RETRIES
Maximum number of retries of nextMessage.

serv

protected static ArchiveServer serv
Constructor Detail

JiniArcClient

public JiniArcClient()
Create a new JiniArcClient object
Method Detail

execute

public void execute()
             throws java.lang.Exception

discovered

public void discovered(net.jini.discovery.DiscoveryEvent ev)
Notified by LookupDiscovery code when it finds one or more registries. This implementation adds it to the list of known registries and notifies any waiting thread.
Specified by:
discovered in interface net.jini.discovery.DiscoveryListener

discarded

public void discarded(net.jini.discovery.DiscoveryEvent ev)
Notified by LookupDiscovery code when one or more found registries vanishes. Eventually we might like to deal with this.
Specified by:
discarded in interface net.jini.discovery.DiscoveryListener

listArchives

public ArchiveDescriptor[] listArchives()
                                 throws java.rmi.RemoteException
Description copied from interface: ArchiveServer
List the names of the known archives. This could probly be held in a properties file.
Specified by:
listArchives in interface ArchiveServer