org.objectweb.dsrg.sofa.microarchitecture
Class ComponentFactory

java.lang.Object
  extended by org.objectweb.dsrg.sofa.microarchitecture.ComponentFactory

public class ComponentFactory
extends java.lang.Object

Static class used to instantiate instance of a component. This is main interface to microarchitecture used by deployment code. Note: compilation of this class causes deprecation warnings which cannot be suppressed by using SuppressWarnings annotation because of bug in Java 6. And also deprecated code used in non-used deprecated code should not causes deprecation warning (bug of Java 5, Java 6). For more information - see bug 6569079 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6569079


Constructor Summary
ComponentFactory()
           
 
Method Summary
static MIComponent createComponent(Architecture arch, Frame frame, FramePlaceholder fBinder, ContentPlaceholder cBinder, java.lang.Iterable<Aspect> aspects)
          Creates new instance of specified component and returns reference to its control interface.
static MIComponent createComponent(Architecture arch, Frame frame, java.lang.Iterable<Aspect> aspects, java.lang.Iterable<Bindable> units)
          Deprecated.  
static java.lang.Object createContentObject(Architecture arch)
          Creates instance of the content class of the primitive component.
static ContentPlaceholder createContentPlaceholder(java.lang.Object o)
          Wraps the content class object into ContentPlaceholder.
static MIComponent rebindComponent(MIComponent target, ContentPlaceholder cBinder)
          Updates component content with different implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentFactory

public ComponentFactory()
Method Detail

createComponent

@Deprecated
public static MIComponent createComponent(Architecture arch,
                                                     Frame frame,
                                                     java.lang.Iterable<Aspect> aspects,
                                                     java.lang.Iterable<Bindable> units)
                                   throws InstantiationException
Deprecated. 

Transition method to new microarchitecture interface.

Parameters:
arch - Architecture of the component instance to instantiate.
frame - Frame which the new instance should implement.
aspects - Aspects to apply to created component.
units - Bindables representing connector units or business interfaces.
Returns:
Reference to Component control interface.
Throws:
InstantiationException

createComponent

public static MIComponent createComponent(Architecture arch,
                                          Frame frame,
                                          FramePlaceholder fBinder,
                                          ContentPlaceholder cBinder,
                                          java.lang.Iterable<Aspect> aspects)
                                   throws InstantiationException
Creates new instance of specified component and returns reference to its control interface.

Parameters:
arch - Architecture to be instantiated.
frame - Frame of the architecture to be used.
fBinder - Binder for the outer side of the component boundary.
cBinder - Binder for the inner side of the component boundary.
aspects - Aspects to be applied to the component.
Returns:
Returns reference to the "component" control interface of the component.
Throws:
InstantiationException

rebindComponent

public static MIComponent rebindComponent(MIComponent target,
                                          ContentPlaceholder cBinder)
                                   throws InstantiationException
Updates component content with different implementation.

Parameters:
target - Target component.
cBinder - New component content.
Returns:
Reference to updated component.
Throws:
InstantiationException

createContentObject

public static java.lang.Object createContentObject(Architecture arch)
                                            throws InstantiationException
Creates instance of the content class of the primitive component.

Parameters:
arch - Architecture of the component.
Returns:
Reference to newly created object.
Throws:
InstantiationException

createContentPlaceholder

public static ContentPlaceholder createContentPlaceholder(java.lang.Object o)
                                                   throws SOFAException
Wraps the content class object into ContentPlaceholder.

Parameters:
o - Content object of the component.
Returns:
ContentPlaceholder wrapping the content object.
Throws:
SOFAException