Apache Tuscany SCA Kernel Sub-Project

org.apache.tuscany.spi.component
Interface Component

All Superinterfaces:
EventPublisher, Lifecycle, SCAObject
All Known Subinterfaces:
AtomicComponent, CompositeComponent, RuntimeComponent, SystemAtomicComponent
All Known Implementing Classes:
AtomicComponentExtension, CompositeComponentExtension, SystemAtomicComponentExtension

public interface Component
extends SCAObject

The runtime instantiation of an SCA component

Version:
$$Rev: 441893 $$ $$Date: 2006-09-09 20:41:09 -0700 (Sat, 09 Sep 2006) $$

Field Summary
 
Fields inherited from interface org.apache.tuscany.spi.Lifecycle
CONFIG_ERROR, ERROR, INITIALIZED, INITIALIZING, RUNNING, STOPPED, STOPPING, UNINITIALIZED
 
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
 TargetInvoker createTargetInvoker(String targetName, Operation operation)
          Callback to create a TargetInvoker which dispatches to a service offered by the component
 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.
 Object getServiceInstance(String name)
          Returns a service associated with the given name
 List<Class<?>> getServiceInterfaces()
          Returns the service interfaces implemented by the component
 
Methods inherited from interface org.apache.tuscany.spi.component.SCAObject
getExtensions, getName, getParent, getScope, getServiceInstance, isSystem, prepare
 
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
 

Method Detail

getServiceInstance

Object getServiceInstance(String name)
                          throws TargetException
Returns a service associated with the given name

Throws:
TargetException - if an error occurs retrieving the service instance

getServiceInterfaces

List<Class<?>> getServiceInterfaces()
Returns the service interfaces implemented by the component


addInboundWire

void addInboundWire(InboundWire wire)
Adds a target-side wire. Target-side wire factories contain the invocation chains associated with the destination service of a wire


getInboundWire

InboundWire getInboundWire(String serviceName)
Returns the target-side wire associated with the given service name


getInboundWires

Map<String,InboundWire> getInboundWires()
Returns a map of inbound wires for a service.


addOutboundWire

void addOutboundWire(OutboundWire wire)
Adds a source-side wire for the given reference. Source-side wires contain the invocation chains for a reference in the implementation associated with the instance wrapper created by this configuration.


addOutboundWires

void addOutboundWires(Class<?> multiplicityClass,
                      List<OutboundWire> wires)
Adds a set of source-side multiplicity wires for the given reference. Source-side wires contain the invocation chains for a reference in the implementation associated with the instance wrapper created by this configuration.


getOutboundWires

Map<String,List<OutboundWire>> getOutboundWires()
Returns a map of source-side wires for references. There may be 1..n wires per reference.


createTargetInvoker

TargetInvoker createTargetInvoker(String targetName,
                                  Operation operation)
Callback to create a TargetInvoker which dispatches to a service offered by the component

Parameters:
targetName -
operation - the operation to invoke

createAsyncTargetInvoker

TargetInvoker createAsyncTargetInvoker(InboundWire wire,
                                       Operation operation)
Callback to create a TargetInvoker which dispatches to a service offered by the component

Parameters:
operation - the operation to invoke

Apache Tuscany SCA Kernel Sub-Project

-