|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.mbari.siam.registry.InstrumentRegistry
public class InstrumentRegistry
InstrumentRegistry is a facility that allows you to register DeviceServices, and to look them up by registry name. You can also register to get callbacks when registrants are added or deleted, and through those registrants, you can get callbacks when their instruments have new data.
The core class DeviceService contains
the ServiceAttributes.
These ServiceAttributes contain, in particular, an attribute named registryName,
which by default is declared as null.
The registryName attribute is used by InstrumentRegistry as a lookup key. The system integrator can use any of the normal facilities to set this attribute for any DeviceService. These facilities include building it into the service driver, setting the attribute in make/Makefile, or setting it on the fly with the utility setProperty.
Other services may look up the desired DeviceService using the find() method.
They can also register to get a callback when that service acquires data by
implementing the InstrumentDataListener interface, and registering with the registerDataCallback()
method.
| Field Summary | |
|---|---|
protected java.util.Vector |
_deferredListeners
|
protected java.util.Vector |
_entries
|
protected java.util.Vector |
_listeners
|
protected static org.apache.log4j.Logger |
_log4j
|
| Method Summary | |
|---|---|
void |
add(DeviceService service)
If the DeviceService contains a non-null Service Attribute String named registryName, then create a RegistryEntry for it and add it to the InstrumentRegistry. |
void |
add(RegistryEntry entry)
Add a RegistryEntry |
void |
addListener(RegistryListener listener)
Add a RegisryListener |
DeviceService |
find(java.lang.String registryName)
Find a DeviceService by registryName String |
RegistryEntry |
findEntry(long id)
Find a RegistryEntry by instrument ID |
RegistryEntry |
findEntry(java.lang.String registryName)
Find a RegistryEntry by registryName String |
static InstrumentRegistry |
getInstance()
Get the singleton InstrumentRegistry |
RegistryEntry |
registerDataCallback(InstrumentDataListener listener,
java.lang.String registryName)
Register for a Data Callback This function will either register a DataListener for the instrument that matches the registryName, or, if none exists yet, will retain the information and register when such an instrument becomes available. |
java.lang.String |
registryStatus()
|
void |
remove(RegistryEntry entry)
Remove a RegistryEntry and call the removeRegistrantCallbacks. |
void |
serviceInstalled(ServiceEvent e)
serviceInstalled() method for ServiceListener interface |
void |
serviceRemoved(ServiceEvent e)
serviceRemoved method for the ServiceListener interface. |
void |
serviceRequestComplete(ServiceEvent e)
serviceRequestComplete() method for ServiceListener interface |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static org.apache.log4j.Logger _log4j
protected java.util.Vector _entries
protected java.util.Vector _listeners
protected java.util.Vector _deferredListeners
| Method Detail |
|---|
public static InstrumentRegistry getInstance()
public void addListener(RegistryListener listener)
public RegistryEntry findEntry(java.lang.String registryName)
public RegistryEntry findEntry(long id)
public DeviceService find(java.lang.String registryName)
public void add(RegistryEntry entry)
throws DuplicateIdException
DuplicateIdException
public void add(DeviceService service)
throws DuplicateIdException
service - - The DeviceService to (conditionally) add to the InstrumentRegistry
DuplicateIdException
public RegistryEntry registerDataCallback(InstrumentDataListener listener,
java.lang.String registryName)
listener - - The InstrumentDataListener to register.registryName - - String identifying the DeviceService to look up. Required.
public void remove(RegistryEntry entry)
public void serviceInstalled(ServiceEvent e)
serviceInstalled in interface ServiceListenerpublic void serviceRemoved(ServiceEvent e)
serviceRemoved in interface ServiceListenerpublic void serviceRequestComplete(ServiceEvent e)
serviceRequestComplete in interface ServiceListenerpublic java.lang.String registryStatus()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||