org.objectweb.fractal.gui.model
Interface Component

All Known Implementing Classes:
AbstractComponent

public interface Component

A primitive or composite component.


Field Summary
static long ATTRIBUTE_CONTROLLER_CLASS_INVALID
          A status flag indicating that the component's attribute controller interface is invalid.
static long ATTRIBUTE_CONTROLLER_CLASS_NOT_FOUND
          A status flag indicating that the component's attribute controller interface cannot be found.
static long ATTRIBUTE_CONTROLLER_MISSING
          A status flag indicating that the component's attribute controller interface is missing.
static long IMPLEMENTATION_CLASS_INVALID
          A status flag indicating that the component's implementation class is invalid.
static long IMPLEMENTATION_CLASS_NOT_FOUND
          A status flag indicating that the component's implementation class cannot be found.
static long IMPLEMENTATION_MISSING
          A status flag indicating that the component's implementation is missing.
static long INTERFACES_INVALID
          A status flag indicating that the component's interfaces are invalid.
static long NAME_MISSING
          A status flag indicating that the component's name is missing.
static long OK
          The status flags corresponding to a valid component.
 
Method Summary
 void addClientInterface(ClientInterface itf)
          Adds the given client interface to this component.
 void addServerInterface(ServerInterface itf)
          Adds the given server interface to this component.
 void addSubComponent(Component child)
          Adds the given component as a sub component of this component.
 void bind(ClientInterface citf, java.lang.String suffix, ServerInterface sitf)
          Binds the given client interface to the given server interface.
 boolean contains(Component child)
          Returns true if this component contains the given sub component.
 boolean containsMasterOfExternalComponent(Component root)
          Returns true if the given component contains a master component but does not contain all its slaves.
 boolean containsSlaveOfExternalComponent(Component root)
          Returns true if the given component contains a slave component but does not contain its master.
 java.lang.String getAttribute(java.lang.String attributeName)
          Return the value of the given attribute of this component.
 java.lang.String getAttributeController()
          Returns the name of the attribute controller interface of this component.
 java.util.List getAttributeNames()
          Returns the names of the attributes of this component.
 Interface getClientInterface(java.lang.String name)
          Returns the external client interface of this component whose name is given.
 java.util.List getClientInterfaces()
          Returns the external client interfaces of this component.
 java.lang.String getComponentControllerDescriptor()
          Returns the component controller descriptor of this component.
 Configuration getConfiguration()
          Returns the configuration to which this component belongs.
 java.lang.String getImplementation()
          Returns the implementation of this component.
 Component getMasterComponent()
          Returns the master component of this component.
 java.lang.String getName()
          Returns the name of this component.
 Component getParent()
          Returns the parent component of this component.
 java.lang.Object[] getPath()
          Returns the path of this component from the root component.
 Component getRootComponent()
          Returns the root component of the configuration.
 Interface getServerInterface(java.lang.String name)
          Returns the external server interface of this component whose name is given.
 java.util.List getServerInterfaces()
          Returns the external server interfaces of this component.
 java.util.List getSlaveComponents()
          Returns the slave components of this component.
 long getStatus()
          Returns the status of this component.
 Component getSubComponent(java.lang.String name)
          Returns the sub component of this component whose name is given.
 java.util.List getSubComponents()
          Returns the sub components of this component.
 java.lang.String getTemplateControllerDescriptor()
          Returns the template controller descriptor of this component.
 java.lang.String getType()
          Returns the type of this component.
 boolean isComposite()
          Returns true if this component is a composite component.
 boolean isShared()
          Returns true if this component has slave component.
 void rebind(ClientInterface citf, ServerInterface sitf)
          Rebinds the given client interface to the given server interface.
 void removeClientInterface(ClientInterface itf)
          Removes the given client interface from this component.
 void removeServerInterface(ServerInterface itf)
          Removes the given server interface from this component.
 void removeSubComponent(Component child)
          Removes the given sub component from this component.
 void setAttribute(java.lang.String attributeName, java.lang.String attributeValue)
          Sets the value of an attribute of this component.
 void setAttributeController(java.lang.String attributeController)
          Sets the name of the attribute controller interface of this component.
 void setComponentControllerDescriptor(java.lang.String desc)
          Sets the component controller descriptor of this component.
 void setImplementation(java.lang.String implementation)
          Sets the implementation of this component.
 void setName(java.lang.String name)
          Sets the name of this component.
 void setStatus(long status)
          Sets the status of this component.
 void setTemplateControllerDescriptor(java.lang.String desc)
          Sets the template controller descriptor of this component.
 void setType(java.lang.String type)
          Sets the type of this component.
 void unbind(ClientInterface citf)
          Unbinds the given client interface.
 

Field Detail

OK

public static final long OK
The status flags corresponding to a valid component.

See Also:
Constant Field Values

NAME_MISSING

public static final long NAME_MISSING
A status flag indicating that the component's name is missing.

See Also:
Constant Field Values

IMPLEMENTATION_MISSING

public static final long IMPLEMENTATION_MISSING
A status flag indicating that the component's implementation is missing.

See Also:
Constant Field Values

IMPLEMENTATION_CLASS_NOT_FOUND

public static final long IMPLEMENTATION_CLASS_NOT_FOUND
A status flag indicating that the component's implementation class cannot be found.

See Also:
Constant Field Values

IMPLEMENTATION_CLASS_INVALID

public static final long IMPLEMENTATION_CLASS_INVALID
A status flag indicating that the component's implementation class is invalid.

See Also:
Constant Field Values

INTERFACES_INVALID

public static final long INTERFACES_INVALID
A status flag indicating that the component's interfaces are invalid.

See Also:
Constant Field Values

ATTRIBUTE_CONTROLLER_MISSING

public static final long ATTRIBUTE_CONTROLLER_MISSING
A status flag indicating that the component's attribute controller interface is missing.

See Also:
Constant Field Values

ATTRIBUTE_CONTROLLER_CLASS_NOT_FOUND

public static final long ATTRIBUTE_CONTROLLER_CLASS_NOT_FOUND
A status flag indicating that the component's attribute controller interface cannot be found.

See Also:
Constant Field Values

ATTRIBUTE_CONTROLLER_CLASS_INVALID

public static final long ATTRIBUTE_CONTROLLER_CLASS_INVALID
A status flag indicating that the component's attribute controller interface is invalid.

See Also:
Constant Field Values
Method Detail

getConfiguration

public Configuration getConfiguration()
Returns the configuration to which this component belongs.

Returns:
the configuration to which this component belongs.

getStatus

public long getStatus()
Returns the status of this component.

Returns:
the status flags of this component. Each flag, i.e., each bit of the returned value is independent from the other, and indicates an error if it is set.
See Also:
setStatus(long)

setStatus

public void setStatus(long status)
Sets the status of this component. This method is reserved for model providers, and must not be called by model users.

Parameters:
status - the new status of this component.
See Also:
getStatus()

getParent

public Component getParent()
Returns the parent component of this component.

Returns:
the parent component of this component, or null if this component is the root component.

getRootComponent

public Component getRootComponent()
Returns the root component of the configuration. This method just calls getParent until the root component is found.

Returns:
the root component of the configuration.

getPath

public java.lang.Object[] getPath()
Returns the path of this component from the root component.

Returns:
an ordered array of all the ancestors of this component, from the root component to this component, included.

getName

public java.lang.String getName()
Returns the name of this component.

Returns:
the name of this component.
See Also:
setName(java.lang.String)

setName

public void setName(java.lang.String name)
Sets the name of this component. This method notifies the configuration listeners, via the nameChanged method.

Parameters:
name - the new component name.
See Also:
getName()

getType

public java.lang.String getType()
Returns the type of this component.

Returns:
the type of this component.
See Also:
setType(java.lang.String)

setType

public void setType(java.lang.String type)
Sets the type of this component. This method notifies the configuration listeners, via the typeChanged method.

Parameters:
type - the new component type.
See Also:
getType()

getImplementation

public java.lang.String getImplementation()
Returns the implementation of this component.

Returns:
the implementation of this component.
See Also:
setImplementation(java.lang.String)

setImplementation

public void setImplementation(java.lang.String implementation)
Sets the implementation of this component. This method notifies the configuration listeners, via the implementationChanged method.

Parameters:
implementation - the new component implementation.
See Also:
getImplementation()

getClientInterfaces

public java.util.List getClientInterfaces()
Returns the external client interfaces of this component.

Returns:
an unmodifiable list of ClientInterface objects corresponding to the external client interfaces of this component.

getClientInterface

public Interface getClientInterface(java.lang.String name)
Returns the external client interface of this component whose name is given.

Parameters:
name - the name of the interface that must be returned.
Returns:
the external client interface of this component whose name is given, or null if there is no such interface.

addClientInterface

public void addClientInterface(ClientInterface itf)
Adds the given client interface to this component. Does nothing if the given interface already belongs to this component. This method notifies the configuration listeners, via the clientInterfaceAdded method.

Parameters:
itf - the interface that must be added to this component. This interface must have been created for this specific component (see createClientInterface).

removeClientInterface

public void removeClientInterface(ClientInterface itf)
Removes the given client interface from this component. Does nothing if the given interface does not belong to this component. This method notifies the configuration listeners, via the clientInterfaceRemoved method.

Parameters:
itf - the interface that must be removed from this component.

getServerInterfaces

public java.util.List getServerInterfaces()
Returns the external server interfaces of this component.

Returns:
an unmodifiable list of ServerInterface objects corresponding to the external server interfaces of this component.

getServerInterface

public Interface getServerInterface(java.lang.String name)
Returns the external server interface of this component whose name is given.

Parameters:
name - the name of the interface that must be returned.
Returns:
the external server interface of this component whose name is given, or null if there is no such interface.

addServerInterface

public void addServerInterface(ServerInterface itf)
Adds the given server interface to this component. Does nothing if the given interface already belongs to this component. This method notifies the configuration listeners, via the serverInterfaceAdded method.

Parameters:
itf - the interface that must be added to this component. This interface must have been created for this specific component (see createServerInterface).

removeServerInterface

public void removeServerInterface(ServerInterface itf)
Removes the given server interface from this component. Does nothing if the given interface does not belong to this component. This method notifies the configuration listeners, via the serverInterfaceRemoved method.

Parameters:
itf - the interface that must be removed from this component.

bind

public void bind(ClientInterface citf,
                 java.lang.String suffix,
                 ServerInterface sitf)
Binds the given client interface to the given server interface. This method notifies the configuration listeners, via the interfaceBound method.

Parameters:
citf - a client interface of this component.
sitf - a server interface.

rebind

public void rebind(ClientInterface citf,
                   ServerInterface sitf)
Rebinds the given client interface to the given server interface. This method notifies the configuration listeners, via the interfaceRebound method.

Parameters:
citf - a client interface of this component.
sitf - a server interface.

unbind

public void unbind(ClientInterface citf)
Unbinds the given client interface. This method notifies the configuration listeners, via the interfaceUnbound method.

Parameters:
citf - a client interface of this component.

getAttributeController

public java.lang.String getAttributeController()
Returns the name of the attribute controller interface of this component.

Returns:
the name of the attribute controller interface of this component.
See Also:
setAttributeController(java.lang.String)

setAttributeController

public void setAttributeController(java.lang.String attributeController)
Sets the name of the attribute controller interface of this component. This method notifies the configuration listeners, via the attributeControllerChanged method.

Parameters:
attributeController - the new attribute controller interface name.
See Also:
getAttributeController()

getAttributeNames

public java.util.List getAttributeNames()
Returns the names of the attributes of this component.

Returns:
an unmodifiable list of String objects corresponding to the names of the attributes of this component.

getAttribute

public java.lang.String getAttribute(java.lang.String attributeName)
Return the value of the given attribute of this component.

Parameters:
attributeName - the name of an attribute of this component.
Returns:
the value of the given attribute, or null if this attribute does not exist.
See Also:
setAttribute(java.lang.String, java.lang.String)

setAttribute

public void setAttribute(java.lang.String attributeName,
                         java.lang.String attributeValue)
Sets the value of an attribute of this component. This method notifies the configuration listeners, via the attributeChanged method.

Parameters:
attributeName - the name of an existing or of a new attribute of this component.
attributeValue - the new value of this attribute.
See Also:
getAttribute(java.lang.String)

getTemplateControllerDescriptor

public java.lang.String getTemplateControllerDescriptor()
Returns the template controller descriptor of this component.

Returns:
the template controller descriptor of this component.
See Also:
setTemplateControllerDescriptor(java.lang.String)

setTemplateControllerDescriptor

public void setTemplateControllerDescriptor(java.lang.String desc)
Sets the template controller descriptor of this component. This method notifies the configuration listeners, via the templateControllerDescriptorChanged method.

Parameters:
desc - the new template controller descriptor of this component.
See Also:
getTemplateControllerDescriptor()

getComponentControllerDescriptor

public java.lang.String getComponentControllerDescriptor()
Returns the component controller descriptor of this component.

Returns:
the component controller descriptor of this component.
See Also:
setComponentControllerDescriptor(java.lang.String)

setComponentControllerDescriptor

public void setComponentControllerDescriptor(java.lang.String desc)
Sets the component controller descriptor of this component. This method notifies the configuration listeners, via the componentControllerDescriptorChanged method.

Parameters:
desc - the new component controller descriptor of this component.
See Also:
getComponentControllerDescriptor()

isShared

public boolean isShared()
Returns true if this component has slave component.

Returns:
true if the getSlaveComponent list is empty.

getMasterComponent

public Component getMasterComponent()
Returns the master component of this component.

Returns:
the master component of this component, or null if this component is not a slave component.

getSlaveComponents

public java.util.List getSlaveComponents()
Returns the slave components of this component.

Returns:
an unmodifiable list of Component objects that correspond to the slave components of this component. This list is empty is this component is not a master component.

isComposite

public boolean isComposite()
Returns true if this component is a composite component.

Returns:
true if the getSubComponents list is empty.

contains

public boolean contains(Component child)
Returns true if this component contains the given sub component.

Parameters:
child - a component.
Returns:
true if this component contains the given sub component.

containsSlaveOfExternalComponent

public boolean containsSlaveOfExternalComponent(Component root)
Returns true if the given component contains a slave component but does not contain its master.

Parameters:
root - a component.
Returns:
true if the given component contains a slave component but does not contain its master.

containsMasterOfExternalComponent

public boolean containsMasterOfExternalComponent(Component root)
Returns true if the given component contains a master component but does not contain all its slaves.

Parameters:
root - a component.
Returns:
true if the given component contains a master component but does not contain all its slaves.

getSubComponents

public java.util.List getSubComponents()
Returns the sub components of this component.

Returns:
an unmodifiable list of Component objects that correspond to the sub components of this component. This list is empty if this component is a primitive component.

getSubComponent

public Component getSubComponent(java.lang.String name)
Returns the sub component of this component whose name is given.

Parameters:
name - the name of a sub component of this component.
Returns:
the sub component of this component whose name is given, or null if there is no such sub component.

addSubComponent

public void addSubComponent(Component child)
Adds the given component as a sub component of this component. Does nothing if the given component is already a sub component of this component. This method notifies the configuration listeners, via the subComponentAdded method.

Parameters:
child - a component.

removeSubComponent

public void removeSubComponent(Component child)
Removes the given sub component from this component. Does nothing if the given component is not a sub component of this component. This method notifies the configuration listeners, via the subComponentRemoved method.

Parameters:
child - a sub component of this component.