org.apache.tuscany.sca.core.context
Class ComponentContextHelper

java.lang.Object
  extended by org.apache.tuscany.sca.core.context.ComponentContextHelper

public class ComponentContextHelper
extends java.lang.Object


Constructor Summary
ComponentContextHelper(AssemblyFactory assemblyFactory, JavaInterfaceFactory javaInterfaceFactory, StAXArtifactProcessorExtensionPoint processors)
           
 
Method Summary
 RuntimeComponentReference bindComponentReference(java.lang.Class<?> businessInterface, RuntimeComponentReference reference, RuntimeComponent component, RuntimeComponentService service)
          Bind a component reference to a component service
 ComponentReference createSelfReference(Component component, ComponentService service, java.lang.Class<?> businessInterface)
          Create a self-reference for a component service
 Component fromXML(java.lang.String xml)
           
 Component fromXML(javax.xml.stream.XMLStreamReader streamReader)
           
static RuntimeComponent getCurrentComponent()
           
static ComponentContextHelper getCurrentComponentContextHelper()
           
static CompositeActivator getCurrentCompositeActivator()
           
static ComponentService getSingleService(Component component)
           
 RuntimeComponent read(java.io.Reader reader)
           
 RuntimeComponent read(javax.xml.stream.XMLStreamReader streamReader)
           
 java.lang.String toXML(Component component, ComponentReference reference)
           
 java.lang.String toXML(Component component, ComponentService service)
           
 void write(Component component, ComponentReference reference, ComponentService service, java.io.Writer writer)
           
 void write(Component component, ComponentReference reference, java.io.Writer writer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentContextHelper

public ComponentContextHelper(AssemblyFactory assemblyFactory,
                              JavaInterfaceFactory javaInterfaceFactory,
                              StAXArtifactProcessorExtensionPoint processors)
Parameters:
assemblyFactory - The factory to create assembly models
processors - The extension point for StAX artifact processors
Method Detail

createSelfReference

public ComponentReference createSelfReference(Component component,
                                              ComponentService service,
                                              java.lang.Class<?> businessInterface)
                                       throws java.lang.CloneNotSupportedException,
                                              InvalidInterfaceException
Create a self-reference for a component service

Parameters:
component -
service -
Throws:
java.lang.CloneNotSupportedException
InvalidInterfaceException

bindComponentReference

public RuntimeComponentReference bindComponentReference(java.lang.Class<?> businessInterface,
                                                        RuntimeComponentReference reference,
                                                        RuntimeComponent component,
                                                        RuntimeComponentService service)
                                                 throws java.lang.CloneNotSupportedException,
                                                        InvalidInterfaceException
Bind a component reference to a component service

Type Parameters:
B -
Parameters:
businessInterface -
reference -
service -
Returns:
Throws:
java.lang.CloneNotSupportedException
InvalidInterfaceException

write

public void write(Component component,
                  ComponentReference reference,
                  java.io.Writer writer)
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(Component component,
                  ComponentReference reference,
                  ComponentService service,
                  java.io.Writer writer)
           throws java.io.IOException
Throws:
java.io.IOException

toXML

public java.lang.String toXML(Component component,
                              ComponentReference reference)
                       throws java.io.IOException
Throws:
java.io.IOException

toXML

public java.lang.String toXML(Component component,
                              ComponentService service)
                       throws java.io.IOException
Throws:
java.io.IOException

read

public RuntimeComponent read(java.io.Reader reader)
                      throws java.io.IOException
Throws:
java.io.IOException

read

public RuntimeComponent read(javax.xml.stream.XMLStreamReader streamReader)
                      throws java.io.IOException
Throws:
java.io.IOException

fromXML

public Component fromXML(java.lang.String xml)
                  throws java.io.IOException
Throws:
java.io.IOException

fromXML

public Component fromXML(javax.xml.stream.XMLStreamReader streamReader)
                  throws java.io.IOException
Throws:
java.io.IOException

getCurrentComponent

public static RuntimeComponent getCurrentComponent()

getCurrentCompositeActivator

public static CompositeActivator getCurrentCompositeActivator()

getCurrentComponentContextHelper

public static ComponentContextHelper getCurrentComponentContextHelper()

getSingleService

public static ComponentService getSingleService(Component component)
Parameters:
component -