org.objectweb.dsrg.sofa.microarchitecture
Class DelegationChain

java.lang.Object
  extended by org.objectweb.dsrg.sofa.microarchitecture.DelegationChain
Direct Known Subclasses:
CollectionChain

public class DelegationChain
extends java.lang.Object

Represents chain of delegating microcomponents inside of the component control part.

Methods of the delegation chains have to be called in the following order: (add?, insert?)+, setEndpoint, (add?, insert?)+, (getEntrypoint)+


Constructor Summary
DelegationChain(SOFAInterfaceType type, java.lang.String name, java.lang.Class c)
          Creates new instance
 
Method Summary
 SOFAMicroComponent add(MicroComponentInstance instance, java.util.HashMap<java.lang.String,java.lang.String> parameters)
          Adds microcomponent instance to the end of the delegation chain.
 java.lang.Object getEntrypoint()
          Returns reference to the provided delegated interface of the first microcomponent (or endpoint object if no microcomponent is contained) in the delegation chain.
 java.lang.Class<?> getInterfaceClass()
          Returns java Class of the delegated component interface.
 java.lang.String getInterfaceName()
          Returns conponent interface name represented by this delegation chain.
 SOFAInterfaceType getInterfaceType()
          Returns SOFA interface type of the represented component interface.
 SOFAMicroComponent insert(MicroComponentInstance instance, java.util.HashMap<java.lang.String,java.lang.String> parameters)
          Inserts microcomponent instance to the beginning of the delegation chain.
 void setEndpoint(java.lang.Object ref)
          Sets the endpoint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegationChain

public DelegationChain(SOFAInterfaceType type,
                       java.lang.String name,
                       java.lang.Class c)
                throws DelegationChainException
Creates new instance

Parameters:
type - SOFA interface type of the component interface represented by this instance.
name - Name of the component interface represented by this instance.
c - Java Class object for the delegated interface.
Throws:
DelegationChainException
Method Detail

getInterfaceClass

public java.lang.Class<?> getInterfaceClass()
Returns java Class of the delegated component interface.

Returns:
Java Class object of delegated interface.

getInterfaceName

public java.lang.String getInterfaceName()
Returns conponent interface name represented by this delegation chain.

Returns:
Interface name.

getInterfaceType

public SOFAInterfaceType getInterfaceType()
Returns SOFA interface type of the represented component interface.

Returns:
SOFA interface type.

add

public SOFAMicroComponent add(MicroComponentInstance instance,
                              java.util.HashMap<java.lang.String,java.lang.String> parameters)
                       throws DelegationChainException
Adds microcomponent instance to the end of the delegation chain.

Parameters:
ref - MicroComponent instance to be added.
Throws:
DelegationChainException

insert

public SOFAMicroComponent insert(MicroComponentInstance instance,
                                 java.util.HashMap<java.lang.String,java.lang.String> parameters)
                          throws DelegationChainException
Inserts microcomponent instance to the beginning of the delegation chain.

Parameters:
ref - MicroComponent instance to be inserted.
Throws:
DelegationChainException

setEndpoint

public void setEndpoint(java.lang.Object ref)
                 throws DelegationChainException
Sets the endpoint. Endpoint is the object called by the last microcomponent in the delegation chain.

Parameters:
ref - Reference to the endpoint object.
Throws:
DelegationChainException

getEntrypoint

public java.lang.Object getEntrypoint()
                               throws DelegationChainException
Returns reference to the provided delegated interface of the first microcomponent (or endpoint object if no microcomponent is contained) in the delegation chain.

Returns:
Reference to delegated interface of the chain.
Throws:
DelegationChainException