edu.UCL.satin.impl.localhost
Class SimpleLocalHost
java.lang.Object
edu.UCL.satin.arch.components.Component
edu.UCL.satin.impl.localhost.SimpleLocalHost
- All Implemented Interfaces:
- ComponentFacet, ComponentListener, Facet, HasLocation, LocalHost
- public class SimpleLocalHost
- extends Component
- implements LocalHost, ComponentListener, HasLocation
SimpleLocalHost is an extremely simple LocalHost implementation. It uses a random integer to denote the host identity. The ID of this component is STN:RANDOMHOSTID
It automatically attaches itself to any advertiser. It also stores a series of ip addresses for the local host, separated by commas
- Author:
- Stefanos Zachariadis
Constructor Summary |
SimpleLocalHost()
Creates a new Host Identification component |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
id
private final java.lang.String id
address
private java.lang.String address
ip
private Location ip
SimpleLocalHost
public SimpleLocalHost()
- Creates a new Host Identification component
isEnabled
public boolean isEnabled()
- Description copied from class:
Component
- Returns whether this component is enabled/active or not.
Note that unless overloaded, the component is assumed to always be enabled
- Specified by:
isEnabled
in interface ComponentFacet
- Overrides:
isEnabled
in class Component
- Returns:
setEnabled
public void setEnabled(boolean b)
- Description copied from class:
Component
- Activates or deactivates this component (if applicable).
Note that unless overloaded, the component is assumed to always be enabled.
- Specified by:
setEnabled
in interface ComponentFacet
- Overrides:
setEnabled
in class Component
- Parameters:
b
-
getHostID
public java.lang.String getHostID()
- Specified by:
getHostID
in interface LocalHost
- Returns:
- the host's identifier
getMessage
public java.lang.Object getMessage()
setAddress
public void setAddress(java.lang.String address)
componentFound
public void componentFound(Component c)
- Description copied from interface:
ComponentListener
- This method is called by a Discovery service if a new component that matches a given query is found.
- Specified by:
componentFound
in interface ComponentListener
- Parameters:
c
- The component found
getLocation
public Location getLocation()
- Specified by:
getLocation
in interface HasLocation