Tuscany Core

org.apache.tuscany.core.builder.impl
Class DefaultWireBuilder

java.lang.Object
  extended by org.apache.tuscany.core.builder.impl.DefaultWireBuilder
All Implemented Interfaces:
HierarchicalWireBuilder, WireBuilder

public class DefaultWireBuilder
extends Object
implements HierarchicalWireBuilder

The top-most WireBuilder configured in a runtime. Responsible for constructing wires from source and target chains, this implementation first bridges the chains and then delegates to any other wire builders.

Version:
$Rev$ $Date$

Constructor Summary
DefaultWireBuilder()
           
 
Method Summary
 void addWireBuilder(WireBuilder builder)
          Adds a wire builder to delegate to
 void completeTargetChain(TargetWireFactory targetFactory, Class targetType, ScopeContext targetScopeContext)
          Finishes processing the target side wire chain.
 void connect(SourceWireFactory<?> sourceFactory, TargetWireFactory<?> targetFactory, Class targetType, boolean downScope, ScopeContext targetScopeContext)
          Connects wire configurations of the source proxy factory to corresponding ones in the target proxy to factory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultWireBuilder

public DefaultWireBuilder()
Method Detail

addWireBuilder

public void addWireBuilder(WireBuilder builder)
Adds a wire builder to delegate to

Specified by:
addWireBuilder in interface HierarchicalWireBuilder

connect

public void connect(SourceWireFactory<?> sourceFactory,
                    TargetWireFactory<?> targetFactory,
                    Class targetType,
                    boolean downScope,
                    ScopeContext targetScopeContext)
Description copied from interface: WireBuilder
Connects wire configurations of the source proxy factory to corresponding ones in the target proxy to factory

Specified by:
connect in interface WireBuilder
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

completeTargetChain

public void completeTargetChain(TargetWireFactory targetFactory,
                                Class targetType,
                                ScopeContext targetScopeContext)
                         throws BuilderConfigException
Description copied from interface: WireBuilder
Finishes processing the target side wire chain. For example, a TargetInvoker used by target-side proxies is usually set during this phase.

Specified by:
completeTargetChain in interface WireBuilder
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

-