| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tuscany.sca.core.context.ComponentContextImpl
public class ComponentContextImpl
Implementation of ComponentContext that delegates to a ComponentContextProvider.
| Constructor Summary | |
|---|---|
ComponentContextImpl(CompositeActivator compositeActivator,
                     AssemblyFactory assemblyFactory,
                     ProxyFactory proxyFactory,
                     InterfaceContractMapper interfaceContractMapper,
                     RequestContextFactory requestContextFactory,
                     JavaInterfaceFactory javaInterfaceFactory,
                     RuntimeComponent component)
 | 
|
| Method Summary | ||
|---|---|---|
 | 
cast(B target)
Cast a type-safe reference to a CallableReference.  | 
|
 | 
createSelfReference(java.lang.Class<B> businessInterface)
Returns a ServiceReference that can be used to invoke this component over the default service.  | 
|
 | 
createSelfReference(java.lang.Class<B> businessInterface,
                    ComponentService service)
 | 
|
 | 
createSelfReference(java.lang.Class<B> businessInterface,
                    java.lang.String serviceName)
Returns a ServiceReference that can be used to invoke this component over the designated service.  | 
|
 | 
getCallableReference(java.lang.Class<B> businessInterface,
                     RuntimeComponent component,
                     RuntimeComponentService service)
Create a CallableReference for the given component service  | 
|
 CompositeActivator | 
getCompositeActivator()
 | 
|
 | 
getProperty(java.lang.Class<B> type,
            java.lang.String propertyName)
Gets the value for the specified property with the specified type.  | 
|
 org.osoa.sca.RequestContext | 
getRequestContext()
Returns the context for the current SCA service request, or null if there is no current request or if the context is unavailable.  | 
|
 | 
getService(java.lang.Class<B> businessInterface,
           java.lang.String referenceName)
Returns a proxy for a reference defined by this component.  | 
|
 | 
getServiceReference(java.lang.Class<B> businessInterface,
                    RuntimeComponentReference reference,
                    Binding binding)
Get the CallableReference for a given component reference  | 
|
 | 
getServiceReference(java.lang.Class<B> businessInterface,
                    RuntimeComponentReference reference,
                    RuntimeComponent component,
                    RuntimeComponentService service)
Bind a component reference to a component service  | 
|
 | 
getServiceReference(java.lang.Class<B> businessInterface,
                    java.lang.String referenceName)
Returns a ServiceReference for a reference defined by this component.  | 
|
 | 
getServiceReferences(java.lang.Class<B> businessInterface,
                     java.lang.String referenceName)
Returns a Collection of typed service reference for a business interface type and a reference name.  | 
|
 | 
getServices(java.lang.Class<B> businessInterface,
            java.lang.String referenceName)
Returns a Collection of typed service proxies for a business interface type and a reference name.  | 
|
 java.lang.String | 
getURI()
Returns the absolute URI of the component within the SCA Domain.  | 
|
 RuntimeComponent | 
read(java.io.Reader reader)
Deserialize the component reference  | 
|
 void | 
setPropertyValueFactory(PropertyValueFactory factory)
The Implementation is responsible for calling this method to set the PropertyValueFactory that is used to get the Property Value from a Tuscany Property object.  | 
|
 void | 
start(RuntimeComponentReference reference)
Activate the reference (creating runtime wires)  | 
|
 void | 
write(RuntimeComponentReference reference,
      java.io.Writer writer)
Serialize the component reference  | 
|
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public ComponentContextImpl(CompositeActivator compositeActivator,
                            AssemblyFactory assemblyFactory,
                            ProxyFactory proxyFactory,
                            InterfaceContractMapper interfaceContractMapper,
                            RequestContextFactory requestContextFactory,
                            JavaInterfaceFactory javaInterfaceFactory,
                            RuntimeComponent component)
| Method Detail | 
|---|
public java.lang.String getURI()
org.osoa.sca.ComponentContext
getURI in interface org.osoa.sca.ComponentContext
public <B,R extends org.osoa.sca.CallableReference<B>> R cast(B target)
                                                 throws java.lang.IllegalArgumentException
org.osoa.sca.ComponentContext
cast in interface org.osoa.sca.ComponentContextB - the Java type of the business interface for the referenceR - the type of reference to be returnedtarget - a reference proxy provided by the SCA runtime
java.lang.IllegalArgumentException - if the supplied instance is not a reference supplied by the SCA runtime
public <B> B getService(java.lang.Class<B> businessInterface,
                        java.lang.String referenceName)
org.osoa.sca.ComponentContext
getService in interface org.osoa.sca.ComponentContextB - the Java type of the business interface for the referencebusinessInterface - the interface that will be used to invoke the servicereferenceName - the name of the reference
public <B> org.osoa.sca.ServiceReference<B> getServiceReference(java.lang.Class<B> businessInterface,
                                                                java.lang.String referenceName)
org.osoa.sca.ComponentContext
getServiceReference in interface org.osoa.sca.ComponentContextB - the Java type of the business interface for the referencebusinessInterface - the interface that will be used to invoke the servicereferenceName - the name of the reference
public void setPropertyValueFactory(PropertyValueFactory factory)
factory - The PropertyValueFactory to usegetProperty(Class, String)
public <B> B getProperty(java.lang.Class<B> type,
                         java.lang.String propertyName)
getProperty in interface org.osoa.sca.ComponentContextB - the Java type of the propertytype - The type of the property value we are gettingpropertyName - The name of the property we are gettingB - The class of the property value we are getting
org.osoa.sca.ServiceRuntimeException - If a Property for the specified propertyName
         is not foundsetPropertyValueFactory(PropertyValueFactory)public <B> org.osoa.sca.ServiceReference<B> createSelfReference(java.lang.Class<B> businessInterface)
org.osoa.sca.ComponentContext
createSelfReference in interface org.osoa.sca.ComponentContextB - the Java type of the business interface for the referencebusinessInterface - the interface that will be used to invoke the service
public <B> org.osoa.sca.ServiceReference<B> createSelfReference(java.lang.Class<B> businessInterface,
                                                                java.lang.String serviceName)
org.osoa.sca.ComponentContext
createSelfReference in interface org.osoa.sca.ComponentContextB - the Java type of the business interface for the referencebusinessInterface - the interface that will be used to invoke the serviceserviceName - the name of the service to invoke
public <B> org.osoa.sca.ServiceReference<B> createSelfReference(java.lang.Class<B> businessInterface,
                                                                ComponentService service)
createSelfReference in interface RuntimeComponentContextB - businessInterface - service - 
public org.osoa.sca.RequestContext getRequestContext()
org.osoa.sca.ComponentContext
getRequestContext in interface org.osoa.sca.ComponentContext
public <B> org.osoa.sca.ServiceReference<B> getServiceReference(java.lang.Class<B> businessInterface,
                                                                RuntimeComponentReference reference,
                                                                Binding binding)
RuntimeComponentContext
getServiceReference in interface RuntimeComponentContextbusinessInterface - reference - binding - The binding to be used, if it's null, either binding.sca or the 1st binding
 will be selected
java.lang.CloneNotSupportedException
InvalidInterfaceException
public <B> org.osoa.sca.ServiceReference<B> getServiceReference(java.lang.Class<B> businessInterface,
                                                                RuntimeComponentReference reference,
                                                                RuntimeComponent component,
                                                                RuntimeComponentService service)
getServiceReference in interface RuntimeComponentContextB - businessInterface - reference - service - component - The target component
java.lang.CloneNotSupportedException
InvalidInterfaceException
public <B> org.osoa.sca.CallableReference<B> getCallableReference(java.lang.Class<B> businessInterface,
                                                                  RuntimeComponent component,
                                                                  RuntimeComponentService service)
RuntimeComponentContext
getCallableReference in interface RuntimeComponentContextpublic CompositeActivator getCompositeActivator()
public void start(RuntimeComponentReference reference)
RuntimeComponentContext
start in interface RuntimeComponentContextRuntimeComponentContext.start(org.apache.tuscany.sca.runtime.RuntimeComponentReference)
public RuntimeComponent read(java.io.Reader reader)
                      throws java.io.IOException
RuntimeComponentContext
read in interface RuntimeComponentContextjava.io.IOExceptionRuntimeComponentContext.read(java.io.Reader)
public void write(RuntimeComponentReference reference,
                  java.io.Writer writer)
           throws java.io.IOException
RuntimeComponentContext
write in interface RuntimeComponentContextjava.io.IOExceptionRuntimeComponentContext.write(org.apache.tuscany.sca.runtime.RuntimeComponentReference, java.io.Writer)
public <B> java.util.Collection<B> getServices(java.lang.Class<B> businessInterface,
                                               java.lang.String referenceName)
ComponentContextExtension
getServices in interface ComponentContextExtensionB - the Java type of the business interface for the referencebusinessInterface - the interface that will be used to invoke the servicereferenceName - the name of the reference
ComponentContext#getServices(Class, String)
public <B> java.util.Collection<org.osoa.sca.ServiceReference<B>> getServiceReferences(java.lang.Class<B> businessInterface,
                                                                                       java.lang.String referenceName)
ComponentContextExtension
getServiceReferences in interface ComponentContextExtensionB - the Java type of the business interface for the referencebusinessInterface - the interface that will be used to invoke the servicereferenceName - the name of the reference
ComponentContext#getServiceReferences(Class, String)
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||