edu.UCL.satin.arch.facets
Interface ComponentFacet

All Superinterfaces:
Facet
All Known Subinterfaces:
Advertiser, ContainerFacet, DebugFacet, DeployerFacet, RegistrarFacet
All Known Implementing Classes:
CentralAdvertising, Component, Container, Debug, Deployer, Registrar

public interface ComponentFacet
extends Facet

The component facet. Contains various lifecycle operations, as well as methods to access the properties

Author:
Stefanos Zachariadis

Field Summary
static boolean DISABLED
           
static boolean ENABLED
           
 
Method Summary
 boolean addAttribute(GenericAttribute attr)
          Adds an attribute to the component's propeties
 boolean construct()
          The component constructor.
 void destroy()
          Destroys the component.
 GenericAttribute getAttribute(java.lang.Object key)
          Gets an attribute from the properties of this component
 java.util.Hashtable getProperties()
          Returns the properties (i.e.
 boolean hasAttribute(java.lang.Object id)
          Checks if the component has an attribute with the given identifier
 boolean isEnabled()
          Checks whether this component is enabled or not.
 void setEnabled(boolean b)
          Enables or disables the component
 

Field Detail

ENABLED

public static final boolean ENABLED
See Also:
Constant Field Values

DISABLED

public static final boolean DISABLED
See Also:
Constant Field Values
Method Detail

getAttribute

public GenericAttribute getAttribute(java.lang.Object key)
Gets an attribute from the properties of this component

Parameters:
key - The key of this attribute
Returns:
a GenericAttribute, representing the attribute identified by key or null otherwise

hasAttribute

public boolean hasAttribute(java.lang.Object id)
Checks if the component has an attribute with the given identifier

Parameters:
id - The identifier of the attribute
Returns:
true if the component has the attribute, false otherwise

getProperties

public java.util.Hashtable getProperties()
Returns the properties (i.e. the set of all attributes) of the component.

Returns:
A hashtable containing the propeties of the component.

addAttribute

public boolean addAttribute(GenericAttribute attr)
Adds an attribute to the component's propeties

Returns:
true if the operation was successful, false otherwise

isEnabled

public boolean isEnabled()
Checks whether this component is enabled or not.

Returns:
ENABLED if the component is enabled, or DISABLED otherwise

construct

public boolean construct()
The component constructor. This is where the component should obtain any references to other components/resources it needs.

Returns:
true of the constrution was succesful, or false otherwise.

destroy

public void destroy()
Destroys the component. Done before removal. This is supposed to free up any resources etc that this component uses.


setEnabled

public void setEnabled(boolean b)
Enables or disables the component