edu.UCL.satin.impl.advertising.central.server
Class AdvertisingServer
java.lang.Object
edu.UCL.satin.arch.components.Component
edu.UCL.satin.impl.advertising.central.server.AdvertisingServer
- All Implemented Interfaces:
- Advertisable, ComponentFacet, Facet, java.lang.Runnable
- public class AdvertisingServer
- extends Component
- implements java.lang.Runnable, Advertisable
- Author:
- Stefanos Zachariadis
Method Summary |
java.util.Vector |
getComponents()
Returns the list of components that this server has |
java.lang.Object |
getMessage()
Returns the message that will be used to advertise this component |
int |
getPort()
Returns the port that this advertising server is listening to |
private boolean |
isActive()
|
boolean |
isEnabled()
Returns whether this component is enabled/active or not. |
void |
run()
|
void |
setEnabled(boolean enable)
Activates or deactivates this component (if applicable). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
components
private java.util.Vector components
querySocket
private java.net.ServerSocket querySocket
socket
private java.net.Socket socket
_PORT
public static final int _PORT
- See Also:
- Constant Field Values
running
private boolean running
debug
private DebugFacet debug
active
private boolean active
AdvertisingServer
public AdvertisingServer()
- Creates a new Advertigsing server
getMessage
public java.lang.Object getMessage()
- Description copied from interface:
Advertisable
- Returns the message that will be used to advertise this component
- Specified by:
getMessage
in interface Advertisable
- Returns:
- The message that will be used to advertise this component
run
public void run()
- Specified by:
run
in interface java.lang.Runnable
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:
isActive
private boolean isActive()
setEnabled
public void setEnabled(boolean enable)
- 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:
enable
-
getPort
public int getPort()
- Returns the port that this advertising server is listening to
- Returns:
- the port that this server is listening to, or -1 if it is disabled
getComponents
public java.util.Vector getComponents()
- Returns the list of components that this server has
- Returns:
- The list of components of this server