|
Apache Tuscany SCA Kernel Sub-Project | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tuscany.spi.AbstractLifecycle
org.apache.tuscany.spi.component.AbstractSCAObject
org.apache.tuscany.spi.extension.CompositeComponentExtension
public abstract class CompositeComponentExtension
An extension point for composite components, which new types may extend
Field Summary | |
---|---|
protected Map<Class,Service> |
autowireExternal
|
protected Map<Class,SCAObject> |
autowireInternal
|
protected Map<String,SCAObject> |
children
|
protected Connector |
connector
|
protected Map<String,Document> |
propertyValues
|
protected List<Reference> |
references
|
protected List<Service> |
services
|
protected Map<Class,Service> |
systemAutowireExternal
|
protected Map<Class,SCAObject> |
systemAutowireInternal
|
protected Map<String,SCAObject> |
systemChildren
|
protected List<Reference> |
systemReferences
|
protected List<Service> |
systemServices
|
Fields inherited from class org.apache.tuscany.spi.component.AbstractSCAObject |
---|
listeners, parent, TRUE_FILTER |
Fields inherited from class org.apache.tuscany.spi.AbstractLifecycle |
---|
lifecycleState |
Fields inherited from interface org.apache.tuscany.spi.Lifecycle |
---|
CONFIG_ERROR, ERROR, INITIALIZED, INITIALIZING, RUNNING, STOPPED, STOPPING, UNINITIALIZED |
Constructor Summary | |
---|---|
protected |
CompositeComponentExtension(String name,
CompositeComponent parent,
Connector connector,
Map<String,Document> propertyValues)
|
Method Summary | ||
---|---|---|
void |
addInboundWire(InboundWire wire)
Adds a target-side wire. |
|
void |
addOutboundWire(OutboundWire wire)
Adds a source-side wire for the given reference. |
|
void |
addOutboundWires(Class<?> multiplicityClass,
List<OutboundWire> wires)
Adds a set of source-side multiplicity wires for the given reference. |
|
TargetInvoker |
createAsyncTargetInvoker(InboundWire wire,
Operation operation)
Callback to create a TargetInvoker which dispatches to a service offered by
the component |
|
SCAObject |
getChild(String name)
Returns the child associated with a given name |
|
List<SCAObject> |
getChildren()
Returns the children contained by the composite |
|
InboundWire |
getInboundWire(String serviceName)
Returns the target-side wire associated with the given service name |
|
Map<String,InboundWire> |
getInboundWires()
Returns a map of inbound wires for a service. |
|
Map<String,List<OutboundWire>> |
getOutboundWires()
Returns a map of source-side wires for references. |
|
Document |
getPropertyValue(String name)
Returns the value of a Property of this composite. |
|
List<Reference> |
getReferences()
Returns the references contained by the composite |
|
Scope |
getScope()
Returns the artifact scope |
|
Service |
getService(String name)
Returns the service associated with the given name |
|
Object |
getServiceInstance()
Returns an instance associated with the default service |
|
Object |
getServiceInstance(String name)
Returns a service associated with the given name |
|
List<Class<?>> |
getServiceInterfaces()
Returns the service interfaces implemented by the component |
|
List<Service> |
getServices()
Returns the services contained by the composite |
|
SCAObject |
getSystemChild(String name)
Returns the system child associated with a given name |
|
List<SCAObject> |
getSystemChildren()
Returns the system children contained by the composite |
|
List<Reference> |
getSystemReferences()
Returns the system references contained by the composite |
|
Service |
getSystemService(String name)
Returns the system service associated with the given name |
|
Object |
getSystemServiceInstance(String name)
Returns a system service associated with the given name |
|
List<Service> |
getSystemServices()
Returns the system services contained by the composite |
|
|
locateService(Class<T> serviceInterface,
String name)
Returns the service instance for associated with the child registered for the given name |
|
|
locateSystemService(Class<T> serviceInterface,
String name)
Returns the system service instance for associated with the child registered for the given name |
|
void |
onEvent(Event event)
|
|
void |
prepare()
Called to signal that the composite should perform and required steps prior to registration with its parent such as wiring of its children |
|
void |
register(SCAObject child)
Registers a child of this composite. |
|
protected void |
registerAutowire(AtomicComponent component)
|
|
protected void |
registerAutowire(CompositeComponent component)
|
|
protected void |
registerAutowire(Reference reference)
|
|
protected void |
registerAutowire(Service service)
|
|
protected void |
registerAutowireExternal(Class<?> interfaze,
Service service)
|
|
protected void |
registerAutowireInternal(Class<?> interfaze,
SCAObject object)
|
|
|
registerJavaObject(String name,
Class<S> service,
I instance)
Register a simple Java Object as a system component. |
|
|
resolveExternalInstance(Class<T> instanceInterface)
Invoked by a parent component to return an autowire target in a child. |
|
|
resolveInstance(Class<T> instanceInterface)
Invoked by child components to return an an autowire target. |
|
|
resolveSystemExternalInstance(Class<T> instanceInterface)
Invoked by a parent component to return a system autowire target in a child. |
|
|
resolveSystemInstance(Class<T> instanceInterface)
Invoked by system child components to return an an autowire target. |
Methods inherited from class org.apache.tuscany.spi.component.AbstractSCAObject |
---|
addListener, addListener, getExtensions, getListeners, getName, getParent, isSystem, publish, removeListener, toString |
Methods inherited from class org.apache.tuscany.spi.AbstractLifecycle |
---|
getLifecycleState, setLifecycleState, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.tuscany.spi.component.CompositeComponent |
---|
setScopeContainer |
Methods inherited from interface org.apache.tuscany.spi.component.Component |
---|
createTargetInvoker |
Methods inherited from interface org.apache.tuscany.spi.component.SCAObject |
---|
getExtensions, getName, getParent, isSystem |
Methods inherited from interface org.apache.tuscany.spi.event.EventPublisher |
---|
addListener, addListener, publish, removeListener |
Methods inherited from interface org.apache.tuscany.spi.Lifecycle |
---|
getLifecycleState, start, stop |
Field Detail |
---|
protected final Map<String,SCAObject> children
protected final List<Service> services
protected final List<Reference> references
protected final Map<String,Document> propertyValues
protected final Connector connector
protected final Map<String,SCAObject> systemChildren
protected final List<Service> systemServices
protected final List<Reference> systemReferences
protected final Map<Class,SCAObject> autowireInternal
protected final Map<Class,Service> autowireExternal
protected final Map<Class,SCAObject> systemAutowireInternal
protected final Map<Class,Service> systemAutowireExternal
Constructor Detail |
---|
protected CompositeComponentExtension(String name, CompositeComponent parent, Connector connector, Map<String,Document> propertyValues)
Method Detail |
---|
public Scope getScope()
SCAObject
getScope
in interface SCAObject
public void onEvent(Event event)
onEvent
in interface RuntimeEventListener
public <S,I extends S> void registerJavaObject(String name, Class<S> service, I instance) throws ObjectRegistrationException
CompositeComponent
registerJavaObject
in interface CompositeComponent
name
- the name of the resulting componentservice
- the service interface the component should exposeinstance
- the Object that will become the component's implementation
ObjectRegistrationException
public Document getPropertyValue(String name)
CompositeComponent
getPropertyValue
in interface CompositeComponent
name
- the name of the Property
public SCAObject getChild(String name)
CompositeComponent
getChild
in interface CompositeComponent
public SCAObject getSystemChild(String name)
CompositeComponent
getSystemChild
in interface CompositeComponent
public List<SCAObject> getSystemChildren()
CompositeComponent
getSystemChildren
in interface CompositeComponent
public List<Service> getSystemServices()
CompositeComponent
getSystemServices
in interface CompositeComponent
public List<Reference> getSystemReferences()
CompositeComponent
getSystemReferences
in interface CompositeComponent
public List<SCAObject> getChildren()
CompositeComponent
getChildren
in interface CompositeComponent
public List<Service> getServices()
CompositeComponent
getServices
in interface CompositeComponent
public List<Reference> getReferences()
CompositeComponent
getReferences
in interface CompositeComponent
public void register(SCAObject child)
CompositeComponent
register
in interface CompositeComponent
child
- the context to add as a childpublic void addOutboundWire(OutboundWire wire)
Component
addOutboundWire
in interface Component
public void addOutboundWires(Class<?> multiplicityClass, List<OutboundWire> wires)
Component
addOutboundWires
in interface Component
public Map<String,List<OutboundWire>> getOutboundWires()
Component
getOutboundWires
in interface Component
public void addInboundWire(InboundWire wire)
Component
addInboundWire
in interface Component
public InboundWire getInboundWire(String serviceName)
Component
getInboundWire
in interface Component
public Map<String,InboundWire> getInboundWires()
Component
getInboundWires
in interface Component
public TargetInvoker createAsyncTargetInvoker(InboundWire wire, Operation operation)
Component
TargetInvoker
which dispatches to a service offered by
the component
createAsyncTargetInvoker
in interface Component
operation
- the operation to invokepublic Service getService(String name)
CompositeComponent
getService
in interface CompositeComponent
public Object getServiceInstance() throws TargetException
SCAObject
getServiceInstance
in interface SCAObject
TargetException
- if an error occurs retrieving the instancepublic Service getSystemService(String name)
CompositeComponent
getSystemService
in interface CompositeComponent
public <T> T locateService(Class<T> serviceInterface, String name)
CompositeComponent
locateService
in interface CompositeComponent
public <T> T locateSystemService(Class<T> serviceInterface, String name)
CompositeComponent
locateSystemService
in interface CompositeComponent
public Object getServiceInstance(String name) throws TargetException
Component
getServiceInstance
in interface Component
TargetException
- if an error occurs retrieving the service instancepublic Object getSystemServiceInstance(String name) throws TargetException
CompositeComponent
getSystemServiceInstance
in interface CompositeComponent
TargetException
- if an error occurs retrieving the service instancepublic List<Class<?>> getServiceInterfaces()
Component
getServiceInterfaces
in interface Component
public <T> T resolveInstance(Class<T> instanceInterface) throws AutowireResolutionException
CompositeComponent
resolveInstance
in interface CompositeComponent
instanceInterface
- the type of service being requested
AutowireResolutionException
- if an error occurs attempting to resolve an autowirepublic <T> T resolveSystemInstance(Class<T> instanceInterface) throws AutowireResolutionException
CompositeComponent
resolveSystemInstance
in interface CompositeComponent
instanceInterface
- the type of service being requested
AutowireResolutionException
- if an error occurs attempting to resolve an autowirepublic <T> T resolveExternalInstance(Class<T> instanceInterface) throws AutowireResolutionException
CompositeComponent
#resolveInstance(Class)
on P, which in turn could invoke the present method on B in order to resolve a
target.
resolveExternalInstance
in interface CompositeComponent
instanceInterface
- the type of service being requested
AutowireResolutionException
- if an error occurs attempting to resolve an autowirepublic <T> T resolveSystemExternalInstance(Class<T> instanceInterface) throws AutowireResolutionException
CompositeComponent
#resolveInstance(Class)
on P, which in turn could invoke the present method on B in order to resolve a
target.
resolveSystemExternalInstance
in interface CompositeComponent
instanceInterface
- the type of service being requested
AutowireResolutionException
- if an error occurs attempting to resolve an autowirepublic void prepare()
SCAObject
prepare
in interface SCAObject
prepare
in class AbstractSCAObject
protected void registerAutowireExternal(Class<?> interfaze, Service service)
protected void registerAutowireInternal(Class<?> interfaze, SCAObject object)
protected void registerAutowire(CompositeComponent component)
protected void registerAutowire(AtomicComponent component)
protected void registerAutowire(Reference reference)
protected void registerAutowire(Service service)
|
Apache Tuscany SCA Kernel Sub-Project | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |