org.objectweb.dsrg.sofa.bootstrap
Class MIComponentImpl

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

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

TODO document


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.lang.Object getDelegatedProvided()
          Takes reference to delegated provided interface implementation.
 java.lang.Object getDelegationChain(SOFAInterfaceType type, java.lang.String name)
          Returns reference to the interface delegation chain.
 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(ComponentInstance component, java.util.Map<java.lang.String,java.lang.String> parameters)
          Initialises microcomponent.
 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(ComponentInstance 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 - Parameters from the model extended by parameters from the Sofa2 runtime.
Throws:
SOFAException

getDelegatedProvided

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

Specified by:
getDelegatedProvided in interface SOFAMicroComponent
Returns:
Reference to delegated provided interface implementation.

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.

setDelegatedRequired

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

Specified by:
setDelegatedRequired in interface SOFAMicroComponent
Parameters:
ref - Interface implementation reference to delegate to.

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.

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 java.lang.Object 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.