Tuscany Core

org.apache.tuscany.core.extension
Class ContextFactoryBuilderSupport<T extends org.apache.tuscany.model.assembly.Implementation>

java.lang.Object
  extended by org.apache.tuscany.core.extension.ContextFactoryBuilderSupport<T>
All Implemented Interfaces:
ContextFactoryBuilder

public abstract class ContextFactoryBuilderSupport<T extends org.apache.tuscany.model.assembly.Implementation>
extends java.lang.Object
implements ContextFactoryBuilder

A runtime extension point for component types. Subclasses must be genericized according to the model implementation type they handle, i.e. a subclass of Implementation, and implement createContextFactory(java.lang.String, T, org.apache.tuscany.model.assembly.Scope).

Version:
$Rev: 368822 $ $Date: 2006-01-13 10:54:38 -0800 (Fri, 13 Jan 2006) $
See Also:
ContextFactory

Field Summary
protected  ContextFactoryBuilderRegistry builderRegistry
           
protected  java.lang.Class implementationClass
           
protected  WireFactoryService wireFactoryService
           
 
Constructor Summary
ContextFactoryBuilderSupport()
          Default constructor
ContextFactoryBuilderSupport(WireFactoryService wireFactoryService)
          Constructs a new instance
 
Method Summary
 void build(org.apache.tuscany.model.assembly.AssemblyObject modelObject)
          Creates or updates a context factory based on configuration contained in the given model object.
protected abstract  ContextFactory createContextFactory(java.lang.String componentName, T implementation, org.apache.tuscany.model.assembly.Scope scope)
          Subclasses must implement, returning a context factory appropriate to the component implementation
 void init()
           
 void setBuilderRegistry(ContextFactoryBuilderRegistry builderRegistry)
           
 void setWireFactoryService(WireFactoryService wireFactoryService)
          Sets the system service used to construct wire factories
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

builderRegistry

protected ContextFactoryBuilderRegistry builderRegistry

wireFactoryService

protected WireFactoryService wireFactoryService

implementationClass

protected java.lang.Class implementationClass
Constructor Detail

ContextFactoryBuilderSupport

public ContextFactoryBuilderSupport()
Default constructor


ContextFactoryBuilderSupport

public ContextFactoryBuilderSupport(WireFactoryService wireFactoryService)
Constructs a new instance

Parameters:
wireFactoryService - the system service responsible for creating wire factories
Method Detail

init

public void init()

setBuilderRegistry

public void setBuilderRegistry(ContextFactoryBuilderRegistry builderRegistry)

setWireFactoryService

public void setWireFactoryService(WireFactoryService wireFactoryService)
Sets the system service used to construct wire factories


build

public void build(org.apache.tuscany.model.assembly.AssemblyObject modelObject)
           throws BuilderException
Description copied from interface: ContextFactoryBuilder
Creates or updates a context factory based on configuration contained in the given model object. The model object is decorated with the factory.

Specified by:
build in interface ContextFactoryBuilder
Parameters:
modelObject - the logical configuration model node
Throws:
BuilderException

createContextFactory

protected abstract ContextFactory createContextFactory(java.lang.String componentName,
                                                       T implementation,
                                                       org.apache.tuscany.model.assembly.Scope scope)
Subclasses must implement, returning a context factory appropriate to the component implementation

Parameters:
componentName - the name of the component
implementation - the component implementation
scope - the component implementation scope

Tuscany Core

-