org.objectweb.fractal.gui.model
Class BasicComponent

java.lang.Object
  extended byorg.objectweb.fractal.gui.model.AbstractComponent
      extended byorg.objectweb.fractal.gui.model.BasicComponent
All Implemented Interfaces:
Component

public class BasicComponent
extends AbstractComponent

Basic implementation of the Component interface.


Field Summary
 
Fields inherited from class org.objectweb.fractal.gui.model.AbstractComponent
parent
 
Fields inherited from interface org.objectweb.fractal.gui.model.Component
ATTRIBUTE_CONTROLLER_CLASS_INVALID, ATTRIBUTE_CONTROLLER_CLASS_NOT_FOUND, ATTRIBUTE_CONTROLLER_MISSING, IMPLEMENTATION_CLASS_INVALID, IMPLEMENTATION_CLASS_NOT_FOUND, IMPLEMENTATION_MISSING, INTERFACES_INVALID, NAME_MISSING, OK
 
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.
 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.
 BasicConfiguration getOwner()
          Returns the configuration to which this component belongs.
 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.
 
Methods inherited from class org.objectweb.fractal.gui.model.AbstractComponent
contains, containsMasterOfExternalComponent, containsSlaveOfExternalComponent, getParent, getPath, getRootComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getOwner

public BasicConfiguration getOwner()
Returns the configuration to which this component belongs.

Returns:
the configuration to which this component belongs.

getConfiguration

public Configuration getConfiguration()
Description copied from class: AbstractComponent
Returns the configuration to which this component belongs.

Specified by:
getConfiguration in interface Component
Overrides:
getConfiguration in class AbstractComponent
Returns:
the configuration to which this component belongs.

getStatus

public long getStatus()
Description copied from interface: Component
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:
Component.setStatus(long)

setStatus

public void setStatus(long status)
Description copied from interface: Component
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:
Component.getStatus()

getName

public java.lang.String getName()
Description copied from interface: Component
Returns the name of this component.

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

setName

public void setName(java.lang.String name)
Description copied from interface: Component
Sets the name of this component. This method notifies the configuration listeners, via the nameChanged method.

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

getType

public java.lang.String getType()
Description copied from interface: Component
Returns the type of this component.

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

setType

public void setType(java.lang.String type)
Description copied from interface: Component
Sets the type of this component. This method notifies the configuration listeners, via the typeChanged method.

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

getImplementation

public java.lang.String getImplementation()
Description copied from interface: Component
Returns the implementation of this component.

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

setImplementation

public void setImplementation(java.lang.String implementation)
Description copied from interface: Component
Sets the implementation of this component. This method notifies the configuration listeners, via the implementationChanged method.

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

getClientInterfaces

public java.util.List getClientInterfaces()
Description copied from interface: Component
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)
Description copied from interface: Component
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)
Description copied from interface: Component
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)
Description copied from interface: Component
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()
Description copied from interface: Component
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)
Description copied from interface: Component
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)
Description copied from interface: Component
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)
Description copied from interface: Component
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)
Description copied from interface: Component
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)
Description copied from interface: Component
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)
Description copied from interface: Component
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()
Description copied from interface: Component
Returns the name of the attribute controller interface of this component.

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

setAttributeController

public void setAttributeController(java.lang.String attributeController)
Description copied from interface: Component
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:
Component.getAttributeController()

getAttributeNames

public java.util.List getAttributeNames()
Description copied from interface: Component
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)
Description copied from interface: Component
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:
Component.setAttribute(java.lang.String, java.lang.String)

setAttribute

public void setAttribute(java.lang.String attributeName,
                         java.lang.String attributeValue)
Description copied from interface: Component
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:
Component.getAttribute(java.lang.String)

getTemplateControllerDescriptor

public java.lang.String getTemplateControllerDescriptor()
Description copied from interface: Component
Returns the template controller descriptor of this component.

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

setTemplateControllerDescriptor

public void setTemplateControllerDescriptor(java.lang.String desc)
Description copied from interface: Component
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:
Component.getTemplateControllerDescriptor()

getComponentControllerDescriptor

public java.lang.String getComponentControllerDescriptor()
Description copied from interface: Component
Returns the component controller descriptor of this component.

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

setComponentControllerDescriptor

public void setComponentControllerDescriptor(java.lang.String desc)
Description copied from interface: Component
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:
Component.getComponentControllerDescriptor()

isShared

public boolean isShared()
Description copied from interface: Component
Returns true if this component has slave component.

Returns:
true if the getSlaveComponent list is empty.

getMasterComponent

public Component getMasterComponent()
Description copied from interface: Component
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()
Description copied from interface: Component
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()
Description copied from interface: Component
Returns true if this component is a composite component.

Returns:
true if the getSubComponents list is empty.

getSubComponents

public java.util.List getSubComponents()
Description copied from interface: Component
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)
Description copied from interface: Component
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)
Description copied from interface: Component
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)
Description copied from interface: Component
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.