Apache Tuscany SCA Kernel Sub-Project

org.apache.tuscany.spi.extension
Class ServiceExtension

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.ServiceExtension
All Implemented Interfaces:
SCAObject, Service, EventPublisher, Lifecycle

public class ServiceExtension
extends AbstractSCAObject
implements Service

The default implementation of an SCA service

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

Field Summary
protected  ServiceContract<?> bindingServiceContract
           
protected  InboundWire inboundWire
           
protected  Class<?> interfaze
           
protected  OutboundWire outboundWire
           
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
ServiceExtension(String name, Class<?> interfaze, CompositeComponent parent, WireService wireService)
           
 
Method Summary
 TargetInvoker createCallbackTargetInvoker(ServiceContract contract, Operation operation)
          Returns the target invoker for dispatching callback invocations
 ServiceContract<?> getBindingServiceContract()
          Get the ServiceContract for the binding
 WireInvocationHandler getHandler()
          Returns the handler responsible for flowing a request through the service
 InboundWire getInboundWire()
          Returns the inbound wire for flowing a request through the service
 Class<?> getInterface()
          Returns the service interface configured for the service
 OutboundWire getOutboundWire()
          Returns the outbound wire for flowing a request out of the service
 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 service
 void setOutboundWire(OutboundWire outboundWire)
          Sets the outbound wire for flowing a request out of the service
 
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.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

interfaze

protected Class<?> interfaze

inboundWire

protected InboundWire inboundWire

outboundWire

protected OutboundWire outboundWire

wireService

protected WireService wireService

bindingServiceContract

protected ServiceContract<?> bindingServiceContract
Constructor Detail

ServiceExtension

public ServiceExtension(String name,
                        Class<?> interfaze,
                        CompositeComponent parent,
                        WireService wireService)
                 throws CoreRuntimeException
Throws:
CoreRuntimeException
Method Detail

getScope

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

Specified by:
getScope in interface SCAObject

getInboundWire

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

Specified by:
getInboundWire in interface Service
Returns:
the inbound wire for flowing a request through the service

setInboundWire

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

Specified by:
setInboundWire in interface Service
Parameters:
wire - the inbound wire for flowing a request through the service

getOutboundWire

public OutboundWire getOutboundWire()
Description copied from interface: Service
Returns the outbound wire for flowing a request out of the service

Specified by:
getOutboundWire in interface Service
Returns:
the outbound wire for flowing a request out of the service

setOutboundWire

public void setOutboundWire(OutboundWire outboundWire)
Description copied from interface: Service
Sets the outbound wire for flowing a request out of the service

Specified by:
setOutboundWire in interface Service
Parameters:
outboundWire - the outbound wire for flowing a request out of the service

createCallbackTargetInvoker

public TargetInvoker createCallbackTargetInvoker(ServiceContract contract,
                                                 Operation operation)
Description copied from interface: Service
Returns the target invoker for dispatching callback invocations

Specified by:
createCallbackTargetInvoker in interface Service
Parameters:
contract - the callback contract
operation - the callback operation the target invoker dispatches to

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()
Description copied from interface: Service
Returns the handler responsible for flowing a request through the service

Specified by:
getHandler in interface Service

getInterface

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

Specified by:
getInterface in interface Service

getBindingServiceContract

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

Specified by:
getBindingServiceContract in interface Service
Returns:

setBindingServiceContract

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

Specified by:
setBindingServiceContract in interface Service

Apache Tuscany SCA Kernel Sub-Project

-