Tuscany Core

org.apache.tuscany.core.builder
Interface WireBuilder

All Known Subinterfaces:
ConfigurationContext, HierarchicalWireBuilder, RuntimeContext, SystemCompositeContext
All Known Implementing Classes:
AbstractCompositeContext, CompositeContextImpl, DefaultWireBuilder, RuntimeContextImpl, SystemCompositeContextImpl, WireBuilderSupport

public interface WireBuilder

Implementations perform the second phase of converting a logical model representing an assembly into a series of runtime or executable artifacts. Specifically, they are responsible for finalizing target-side proxy factories and bridging InvocationConfigurations held by source- and target-side proxy factories. WireBuilders generally operate by target implementation type. In other words, for a wire from a Java source to a JavaScript target, the Javascript WireBuilder will complete the wire. This is necessary as a WireBuilder must set a TargetInvoker that is responsible for dispatching to an implementation on the source side of the wire.

Runtimes are generally configured with a DefaultWireBuilder as a top-most wire builder, which delegates to other builders wired to it as part of a system configuration.

Wire builders may optimize the wire chains based on certain characteristics of th wire, such as source and target scopes.

Version:
$Rev$ $Date$
See Also:
ContextFactoryBuilder, DefaultWireBuilder

Method Summary
 void completeTargetChain(TargetWireFactory<?> targetFactory, java.lang.Class targetType, ScopeContext targetScopeContext)
          Finishes processing the target side wire chain.
 void connect(SourceWireFactory<?> sourceFactory, TargetWireFactory<?> targetFactory, java.lang.Class targetType, boolean downScope, ScopeContext targetScopeContext)
          Connects wire configurations of the source proxy factory to corresponding ones in the target proxy to factory
 

Method Detail

connect

void connect(SourceWireFactory<?> sourceFactory,
             TargetWireFactory<?> targetFactory,
             java.lang.Class targetType,
             boolean downScope,
             ScopeContext targetScopeContext)
             throws BuilderConfigException
Connects wire configurations of the source proxy factory to corresponding ones in the target proxy to factory

Parameters:
sourceFactory - the proxy factory used in constructing the source side of the wire chain
targetFactory - the proxy factory used in constructing the target side of the wire chain
targetType - the context type of the target. Used to determine if a paricular wire builder should construct the wire
downScope - true if the component containing the reference (source side) is of a lesser scope than the target service
targetScopeContext - the scope context responsible for managing intance contexts of the target component type
Throws:
BuilderConfigException - if an error occurs during the wire buildSource process

completeTargetChain

void completeTargetChain(TargetWireFactory<?> targetFactory,
                         java.lang.Class targetType,
                         ScopeContext targetScopeContext)
                         throws BuilderConfigException
Finishes processing the target side wire chain. For example, a TargetInvoker used by target-side proxies is usually set during this phase.

Parameters:
targetFactory - the target-side proxy factory
targetType - the target context type
targetScopeContext - the target scope
Throws:
BuilderConfigException - if an error occurs during the wire buildSource process

Tuscany Core

-