Tuscany Core

org.apache.tuscany.core.wire
Interface WireFactory<T>

All Known Subinterfaces:
SourceWireFactory<T>, TargetWireFactory<T>
All Known Implementing Classes:
JDKSourceWireFactory, JDKTargetWireFactory, NullWireFactory

public interface WireFactory<T>

Implementations are responsible for managing source or target sides of a wire, including creation of service proxies. Source-side wires are injected on references and may contain policy interceptors and/or handlers specified by them. Target-side wires may contain policy interceptors and/or handlers specified by the service the wire is targeted to or one of its operations. Source- and target-side WireFactorys are held in the ContextFactory associated with the source reference or target service.

When an assembly is built by the runtime, source-side and target-side wires are "bridged" on the source side (i.e. a reference to the target-side is stored in the source-side). This bridging process is done by a series of WireBuilders configured in the runtime. When a new component implementation instance is created, it will be injected with a proxy for each reference containing the bridged source- and target-side wires.

Unmanaged code, i.e. clients that are not components, that perform a locate operation are handled differently. In this case, a target-side proxy will be returned by the locate operation created by the WireFactory associated with the target service. This target-side proxy will only contain the target-side wire and its handlers/interceptors.Ê

Wires are structured by operation; that is, they contain an invocation chain per operation on a service. Note that the service specified by a reference may differ in type from the target service specified by the wire. In this case, a mediation may be performed by the runtime. Hence, source-to-target bridging is done on a per operation basis. Source- and target-side Invocation chains are accessible through the subtypes of WireFactory.

Version:
$Rev: 396284 $ $Date: 2006-04-23 11:27:42 -0400 (Sun, 23 Apr 2006) $

Method Summary
 void addInterface(java.lang.Class claz)
          Adds an interface type generated proxies implement
 T createProxy()
          Returns a proxy for a service specified by a reference or target
 java.lang.Class getBusinessInterface()
          Returns the primary interface type implemented by generated proxies
 java.lang.Class[] getImplementatedInterfaces()
          Returns an array of all interfaces implemented by generated proxies
 void initialize()
          Prepares the factory.
 void setBusinessInterface(java.lang.Class interfaze)
          Sets the primary interface type generated proxies implement
 

Method Detail

initialize

void initialize()
                throws WireFactoryInitException
Prepares the factory. This will typically be called at buildSource time, after bridging source- and target-side invocation chains.

Throws:
WireFactoryInitException - if an error is encountered during initialization

createProxy

T createProxy()
              throws ProxyCreationException
Returns a proxy for a service specified by a reference or target

Throws:
ProxyCreationException

setBusinessInterface

void setBusinessInterface(java.lang.Class interfaze)
Sets the primary interface type generated proxies implement


getBusinessInterface

java.lang.Class getBusinessInterface()
Returns the primary interface type implemented by generated proxies


addInterface

void addInterface(java.lang.Class claz)
Adds an interface type generated proxies implement


getImplementatedInterfaces

java.lang.Class[] getImplementatedInterfaces()
Returns an array of all interfaces implemented by generated proxies


Tuscany Core

-