|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.UCL.satin.arch.components.Component
edu.UCL.satin.impl.arch.components.comms.Discovery
edu.UCL.satin.impl.advertising.central.clients.discovery.CentralDiscovery
This Discovery component interfaces with AdvertisingServer.java
Field Summary | |
private DebugFacet |
debug
|
private boolean |
enabled
|
private java.lang.String |
ip
|
private java.util.Vector |
listeners
|
private int |
port
|
private java.util.Vector |
repo
|
private long |
sleep
|
Fields inherited from class edu.UCL.satin.arch.components.Component |
immutable, properties |
Fields inherited from interface edu.UCL.satin.arch.facets.ComponentFacet |
DISABLED, ENABLED |
Constructor Summary | |
CentralDiscovery()
Initialises the component. |
Method Summary | |
void |
addListener(ComponentListener c)
Adds a listener that will be notified when any new component is discovered. |
void |
addListener(ComponentListener c,
java.util.Hashtable filter)
Adds a listener that will be notified when any new component matching the filter given is discovered. |
private void |
checkListeners(Component c)
Method to notify any listeners about a component found |
Component[] |
getComponents(java.util.Hashtable properties)
Returns an array of Components found that match the given property set |
java.lang.String |
getIp()
|
int |
getPort()
|
private java.util.Vector |
getRemoteComponents()
This method returns all the components available at a remote server. |
long |
getSleep()
|
boolean |
isEnabled()
Returns whether this component is enabled/active or not. |
void |
removeListener(ComponentListener c)
Removes all instances of the given listener (including any different filters) from the list of listeners to be notified. |
void |
removeListener(ComponentListener c,
java.util.Hashtable filter)
Removes the particular listener+filter pair from the list of listeners to be notified. |
void |
run()
|
void |
setEnabled(boolean enabled)
Activates or deactivates this component (if applicable). |
void |
setIP(java.lang.String string)
Sets the IP address of the CentralDiscovery server |
void |
setPort(int i)
Sets the port that the CentralDiscovery server is listening to |
void |
setSleep(long sleep)
Sets the period between poling the registry for new components |
Methods inherited from class edu.UCL.satin.arch.components.Component |
addAttribute, construct, destroy, getAttribute, getProperties, hasAttribute, match, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private java.util.Vector repo
private java.util.Vector listeners
private java.lang.String ip
private int port
private boolean enabled
private long sleep
private DebugFacet debug
Constructor Detail |
public CentralDiscovery()
Method Detail |
public void run()
run
in interface java.lang.Runnable
public void addListener(ComponentListener c)
Discovery
addListener
in interface DiscoveryFacet
addListener
in class Discovery
c
- the listener that will be notifiedpublic void addListener(ComponentListener c, java.util.Hashtable filter)
Discovery
addListener
in interface DiscoveryFacet
addListener
in class Discovery
c
- the listener to be notifiedfilter
- The filter, as a hashtable of attributespublic void removeListener(ComponentListener c)
Discovery
removeListener
in interface DiscoveryFacet
removeListener
in class Discovery
c
- The listener to be removed.public void setSleep(long sleep)
sleep
- public long getSleep()
public void removeListener(ComponentListener c, java.util.Hashtable filter)
Discovery
removeListener
in interface DiscoveryFacet
removeListener
in class Discovery
c
- The listener to be removedfilter
- The filter matches of which this listener will not be notified any more.public Component[] getComponents(java.util.Hashtable properties)
Discovery
getComponents
in interface DiscoveryFacet
getComponents
in class Discovery
properties
- The properties that the returned components need to match
public boolean isEnabled()
Component
isEnabled
in interface ComponentFacet
isEnabled
in class Component
public void setEnabled(boolean enabled)
Component
setEnabled
in interface ComponentFacet
setEnabled
in class Component
enabled
- private java.util.Vector getRemoteComponents()
private void checkListeners(Component c)
c
- the new component foundpublic java.lang.String getIp()
public int getPort()
public void setIP(java.lang.String string)
string
- public void setPort(int i)
i
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |