org.objectweb.dsrg.sofa.bootstrap
Class MIComponentImpl

java.lang.Object
  extended by org.objectweb.dsrg.sofa.bootstrap.MIComponentImpl
All Implemented Interfaces:
MIComponent, SOFAMicroComponent, SOFAMicroInterceptor

public class MIComponentImpl
extends java.lang.Object
implements SOFAMicroInterceptor, MIComponent

This microcomponent implements Componet aspect. It is connected to the Component control interface.


Constructor Summary
MIComponentImpl()
           
 
Method Summary
 java.lang.Object getContent()
          Returns reference to the component business code.
 java.lang.Object getControlInterface(java.lang.String name)
          Returns reference to the control interface implementation.
 java.util.Set<java.lang.String> getControlInterfaces()
          Returns names of control interfaces on the component.
 java.lang.Object getDelegatedProvided()
          Takes reference to delegated provided interface implementation.
 DelegationChain getDelegationChain(SOFAInterfaceType type, java.lang.String name)
          Returns reference to the interface delegation chain.
 java.util.Set<DelegationChain> getDelegationChains()
          Returns delegation chains for all business interfaces.
 java.lang.Object getFrame()
          Returns model object of the frame implemented by component.
 java.lang.Object getProvided(java.lang.String name)
          Takes reference to implementation of provided interface with given name.
 void init(ComponentDescription component, java.util.Map<java.lang.String,java.lang.String> parameters)
          Initialises microcomponent.
 void setContent(java.lang.Object o)
          Set reference to component content class.
 void setDelegatedRequired(java.lang.Object ref)
          Gives the microcomponent reference to interface where to delegate calls.
 void setRequired(java.lang.String name, java.lang.Object ref)
          Gives the microcomponent reference to destination of its required interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MIComponentImpl

public MIComponentImpl()
Method Detail

init

public void init(ComponentDescription component,
                 java.util.Map<java.lang.String,java.lang.String> parameters)
          throws SOFAException
Description copied from interface: SOFAMicroComponent
Initialises microcomponent. This method is called after all microcomponents are instantiated and bound.

Specified by:
init in interface SOFAMicroComponent
Parameters:
component - Containing component description.
parameters - Parameters from the model extended by parameters from the Sofa2 runtime.
Throws:
SOFAException

getProvided

public java.lang.Object getProvided(java.lang.String name)
Description copied from interface: SOFAMicroComponent
Takes reference to implementation of provided interface with given name.

Specified by:
getProvided in interface SOFAMicroComponent
Parameters:
name - Name of the provided interface.
Returns:
Reference to the provided interface implementation.

setRequired

public void setRequired(java.lang.String name,
                        java.lang.Object ref)
Description copied from interface: SOFAMicroComponent
Gives the microcomponent reference to destination of its required interface.

Specified by:
setRequired in interface SOFAMicroComponent
Parameters:
name - Name of the required interface.
ref - Reference to the destination interface implementation.

getDelegatedProvided

public java.lang.Object getDelegatedProvided()
                                      throws SOFAException
Description copied from interface: SOFAMicroInterceptor
Takes reference to delegated provided interface implementation.

Specified by:
getDelegatedProvided in interface SOFAMicroInterceptor
Returns:
Reference to delegated provided interface implementation.
Throws:
SOFAException

setDelegatedRequired

public void setDelegatedRequired(java.lang.Object ref)
                          throws SOFAException
Description copied from interface: SOFAMicroInterceptor
Gives the microcomponent reference to interface where to delegate calls.

Specified by:
setDelegatedRequired in interface SOFAMicroInterceptor
Parameters:
ref - Interface implementation reference to delegate to.
Throws:
SOFAException

getControlInterface

public java.lang.Object getControlInterface(java.lang.String name)
Description copied from interface: MIComponent
Returns reference to the control interface implementation.

Specified by:
getControlInterface in interface MIComponent
Parameters:
name - Name of control interface you want to get reference.
Returns:
Reference to the interface implementation or null.

getDelegationChain

public DelegationChain getDelegationChain(SOFAInterfaceType type,
                                          java.lang.String name)
                                   throws SOFAException
Description copied from interface: MIComponent
Returns reference to the interface delegation chain.

Specified by:
getDelegationChain in interface MIComponent
Parameters:
type - Type of the interface. Can be CONTROL, BUSINESS_PROVIDED or BUSINESS_REQUIRED.
name - Name of interface you want to get delegation chain.
Returns:
Reference to the interface delegation chain.
Throws:
SOFAException

getFrame

public java.lang.Object getFrame()
Description copied from interface: MIComponent
Returns model object of the frame implemented by component.

Specified by:
getFrame in interface MIComponent
Returns:
Reference to model object or null if Component control interface has not been initialisated.

getContent

public java.lang.Object getContent()
Description copied from interface: MIComponent
Returns reference to the component business code.

Specified by:
getContent in interface MIComponent
Returns:
Reference to the component content.

getControlInterfaces

public java.util.Set<java.lang.String> getControlInterfaces()
Description copied from interface: MIComponent
Returns names of control interfaces on the component.

Specified by:
getControlInterfaces in interface MIComponent
Returns:
Names of control interfaces.

getDelegationChains

public java.util.Set<DelegationChain> getDelegationChains()
Description copied from interface: MIComponent
Returns delegation chains for all business interfaces.

Specified by:
getDelegationChains in interface MIComponent
Returns:
Delegation chains for business interfaces.

setContent

public void setContent(java.lang.Object o)
Description copied from interface: MIComponent
Set reference to component content class.

Specified by:
setContent in interface MIComponent