Apache Tuscany SCA Kernel Sub-Project

org.apache.tuscany.spi.extension
Class ReferenceExtension

java.lang.Object
  extended by org.apache.tuscany.spi.AbstractLifecycle
      extended by org.apache.tuscany.spi.component.AbstractSCAObject
          extended by org.apache.tuscany.spi.extension.ReferenceExtension
All Implemented Interfaces:
Reference, SCAObject, EventPublisher, Lifecycle

public abstract class ReferenceExtension
extends AbstractSCAObject
implements Reference

The default implementation of an SCA reference

Version:
$Rev: 449938 $ $Date: 2006-09-26 00:37:10 -0700 (Tue, 26 Sep 2006) $

Field Summary
protected  ServiceContract<?> bindingServiceContract
           
protected  InboundWire inboundWire
           
protected  OutboundWire outboundWire
           
protected  Class<?> referenceInterface
           
protected  WireService wireService
           
 
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 ReferenceExtension(String name, Class<?> referenceInterface, CompositeComponent parent, WireService wireService)
           
 
Method Summary
 TargetInvoker createAsyncTargetInvoker(OutboundWire wire, Operation operation)
          Callback to create a TargetInvoker which issues a non-blocking dispatch
 TargetInvoker createCallbackTargetInvoker(ServiceContract contract, Operation operation)
          Creates a target invoker for callbacks
 ServiceContract<?> getBindingServiceContract()
          Get the ServiceContract for the binding
 WireInvocationHandler getHandler()
          Returns the handler responsible for flowing a request through the reference
 InboundWire getInboundWire()
          Returns the inbound wire for flowing a request through the reference
 Class<?> getInterface()
          Returns the service interface configured for the reference
 OutboundWire getOutboundWire()
          Returns the outbound wire used by the reference to connect to a target
 Scope getScope()
          Returns the artifact scope
 Object getServiceInstance()
          Returns an instance associated with the default service
 void setBindingServiceContract(ServiceContract<?> serviceContract)
          Set the ServiceContract for the binding.
 void setInboundWire(InboundWire wire)
          Sets the inbound wire for flowing a request through the reference
 void setOutboundWire(OutboundWire outboundWire)
          Sets the outbound wire used by the reference to connect to a target
 
Methods inherited from class org.apache.tuscany.spi.component.AbstractSCAObject
addListener, addListener, getExtensions, getListeners, getName, getParent, isSystem, prepare, 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.Reference
createTargetInvoker
 
Methods inherited from interface org.apache.tuscany.spi.component.SCAObject
getExtensions, getName, getParent, 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
 

Field Detail

inboundWire

protected InboundWire inboundWire

outboundWire

protected OutboundWire outboundWire

referenceInterface

protected Class<?> referenceInterface

wireService

protected WireService wireService

bindingServiceContract

protected ServiceContract<?> bindingServiceContract
Constructor Detail

ReferenceExtension

protected ReferenceExtension(String name,
                             Class<?> referenceInterface,
                             CompositeComponent parent,
                             WireService wireService)
Method Detail

getScope

public Scope getScope()
Description copied from interface: SCAObject
Returns the artifact scope

Specified by:
getScope in interface SCAObject

setInboundWire

public void setInboundWire(InboundWire wire)
Description copied from interface: Reference
Sets the inbound wire for flowing a request through the reference

Specified by:
setInboundWire in interface Reference

getInboundWire

public InboundWire getInboundWire()
Description copied from interface: Reference
Returns the inbound wire for flowing a request through the reference

Specified by:
getInboundWire in interface Reference

getOutboundWire

public OutboundWire getOutboundWire()
Description copied from interface: Reference
Returns the outbound wire used by the reference to connect to a target

Specified by:
getOutboundWire in interface Reference

setOutboundWire

public void setOutboundWire(OutboundWire outboundWire)
Description copied from interface: Reference
Sets the outbound wire used by the reference to connect to a target

Specified by:
setOutboundWire in interface Reference

getInterface

public Class<?> getInterface()
Description copied from interface: Reference
Returns the service interface configured for the reference

Specified by:
getInterface in interface Reference

getServiceInstance

public Object getServiceInstance()
                          throws TargetException
Description copied from interface: SCAObject
Returns an instance associated with the default service

Specified by:
getServiceInstance in interface SCAObject
Throws:
TargetException - if an error occurs retrieving the instance

getHandler

public WireInvocationHandler getHandler()
                                 throws TargetException
Description copied from interface: Reference
Returns the handler responsible for flowing a request through the reference

Specified by:
getHandler in interface Reference
Throws:
TargetException

createCallbackTargetInvoker

public TargetInvoker createCallbackTargetInvoker(ServiceContract contract,
                                                 Operation operation)
Description copied from interface: Reference
Creates a target invoker for callbacks

Specified by:
createCallbackTargetInvoker in interface Reference

createAsyncTargetInvoker

public TargetInvoker createAsyncTargetInvoker(OutboundWire wire,
                                              Operation operation)
Description copied from interface: Reference
Callback to create a TargetInvoker which issues a non-blocking dispatch

Specified by:
createAsyncTargetInvoker in interface Reference
Parameters:
wire - the outbound wire of the invocation source, used for callbacks
operation - the operation to invoke

getBindingServiceContract

public ServiceContract<?> getBindingServiceContract()
Description copied from interface: Reference
Get the ServiceContract for the binding

Specified by:
getBindingServiceContract in interface Reference
Returns:

setBindingServiceContract

public void setBindingServiceContract(ServiceContract<?> serviceContract)
Description copied from interface: Reference
Set the ServiceContract for the binding. This contract will be used for the outbound wire. If not set, it will be the same as the ServideContract from the interface.

Specified by:
setBindingServiceContract in interface Reference

Apache Tuscany SCA Kernel Sub-Project

-