Apache Tuscany SCA Kernel Sub-Project

org.apache.tuscany.spi.wire
Interface WireService

All Known Implementing Classes:
WireServiceExtension

public interface WireService

Creates proxies that implement Java interfaces and invocation handlers for fronting wires

Version:
$$Rev: 452795 $$ $$Date: 2006-10-04 01:38:22 -0700 (Wed, 04 Oct 2006) $$

Method Summary
 void checkCompatibility(ServiceContract<?> source, ServiceContract<?> target, boolean ignoreCallback)
          Check the compatiblity of the source and the target service contracts.
 WireInvocationHandler createCallbackHandler(InboundWire wire)
          Creates a wire invocation handler for flowing invocations through a callback
 Object createCallbackProxy(ServiceContract<?> contract, InboundWire wire)
          Creates a Java proxy for the service contract callback
 WireInvocationHandler createHandler(RuntimeWire wire)
          Creates an WireInvocationHandler for the given wire
 InboundInvocationChain createInboundChain(Operation<?> operation)
          Creates an inbound invocation chain for a given operation
 OutboundInvocationChain createOutboundChain(Operation<?> operation)
          Creates an outbound invocation chain for a given operation
 Object createProxy(RuntimeWire wire)
          Creates a Java proxy for the given wire
 OutboundWire createWire(ReferenceTarget reference, ReferenceDefinition def)
          Creates a wire for flowing outbound invocations to a reference
 InboundWire createWire(ServiceDefinition service)
          Creates a wire for flowing inbound invocations to a service
 void createWires(Component component, ComponentDefinition<?> definition)
          Creates wires for a component and injects them on the component
 void createWires(Reference reference, ServiceContract<?> contract)
          Creates wires for a reference and injects them on the reference
 void createWires(Service service, String targetName, ServiceContract<?> contract)
          Creates wires for a service and injects them on the service
 

Method Detail

createProxy

Object createProxy(RuntimeWire wire)
                   throws ProxyCreationException
Creates a Java proxy for the given wire

Parameters:
wire - the wire to proxy
Returns:
the proxy
Throws:
ProxyCreationException

createCallbackProxy

Object createCallbackProxy(ServiceContract<?> contract,
                           InboundWire wire)
                           throws ProxyCreationException
Creates a Java proxy for the service contract callback

Parameters:
contract - the service contract
Returns:
the proxy
Throws:
ProxyCreationException

createHandler

WireInvocationHandler createHandler(RuntimeWire wire)
Creates an WireInvocationHandler for the given wire

Parameters:
wire - the wire to create the invocation handler for
Returns:
the invocation handler

createCallbackHandler

WireInvocationHandler createCallbackHandler(InboundWire wire)
Creates a wire invocation handler for flowing invocations through a callback

Returns:
the invocation handler for flowing invocations through a callback

createOutboundChain

OutboundInvocationChain createOutboundChain(Operation<?> operation)
Creates an outbound invocation chain for a given operation

Parameters:
operation - the operation to create the chain for
Returns:
the outbound invocation chain for a given operation

createInboundChain

InboundInvocationChain createInboundChain(Operation<?> operation)
Creates an inbound invocation chain for a given operation

Parameters:
operation - the operation to create the chain for
Returns:
the inbound invocation chain for a given operation

createWire

InboundWire createWire(ServiceDefinition service)
Creates a wire for flowing inbound invocations to a service

Parameters:
service - the model representation of the service
Returns:
the wire for flowing inbound invocations to a service

createWire

OutboundWire createWire(ReferenceTarget reference,
                        ReferenceDefinition def)
Creates a wire for flowing outbound invocations to a reference

Parameters:
reference - the model artifact representing the reference on the source side
def - the model artifact representing the target reference
Returns:
the wire for flowing outbound invocations to a reference

createWires

void createWires(Component component,
                 ComponentDefinition<?> definition)
Creates wires for a component and injects them on the component

Parameters:
component - the component
definition - the model artifact representing the component

createWires

void createWires(Reference reference,
                 ServiceContract<?> contract)
Creates wires for a reference and injects them on the reference

Parameters:
reference - the reference
contract - the model artifact representing the service contract for the reference

createWires

void createWires(Service service,
                 String targetName,
                 ServiceContract<?> contract)
Creates wires for a service and injects them on the service

Parameters:
service - the service
targetName - the target nane
contract - the service contract

checkCompatibility

void checkCompatibility(ServiceContract<?> source,
                        ServiceContract<?> target,
                        boolean ignoreCallback)
                        throws IncompatibleServiceContractException
Check the compatiblity of the source and the target service contracts.

A wire may only connect a source to a target if the target implements an interface that is compatible with the interface required by the source. The source and the target are compatible if:

  1. the source interface and the target interface MUST either both be remotable or they are both local
  2. the methods on the target interface MUST be the same as or be a superset of the methods in the interface specified on the source
  3. compatibility for the individual method is defined as compatibility of the signature, that is method name, input types, and output types MUST BE the same.
  4. the order of the input and output types also MUST BE the same.
  5. the set of Faults and Exceptions expected by the source MUST BE the same or be a superset of those specified by the service.
  6. other specified attributes of the two interfaces MUST match, including Scope and Callback interface

Please note this test is not symetric: the success of checkCompatibility(A, B) does NOT imply that checkCompatibility(B, A)

Parameters:
source - The source service contract
target - The target service contract
ignoreCallback - Indicate the callback should be checked
Throws:
IncompatibleServiceContractException - If the source service contract is not compatible with the target one

Apache Tuscany SCA Kernel Sub-Project

-