org.jboss.cache.factories
Class ComponentFactory

java.lang.Object
  extended by org.jboss.cache.factories.ComponentFactory
Direct Known Subclasses:
DefaultCacheFactory, EmptyConstructorFactory, InterceptorChainFactory, NodeFactory, TransactionManagerFactory

public abstract class ComponentFactory
extends Object

Factory that creates components used internally within JBoss Cache, and also wires dependencies into the components.

The DefaultCacheFactory is a special subclass of this, which bootstraps the construction of other components. When this class is loaded, it maintains a static list of known default factories for known components, which it then delegates to, when actually performing the construction.

Since:
2.1.0
Author:
Manik Surtani (manik@jboss.org)
See Also:
Inject, ComponentRegistry

Field Summary
protected  ComponentRegistry componentRegistry
           
protected  Configuration configuration
           
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
ComponentFactory()
           
 
Method Summary
protected  void assertTypeConstructable(Class requestedType, Class... ableToConstruct)
           
protected abstract
<T> T
construct(String componentName, Class<T> componentType)
          Constructs a component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final org.apache.commons.logging.Log log

componentRegistry

protected ComponentRegistry componentRegistry

configuration

protected Configuration configuration
Constructor Detail

ComponentFactory

public ComponentFactory()
Method Detail

construct

protected abstract <T> T construct(String componentName,
                                   Class<T> componentType)
Constructs a component.

Parameters:
componentName - optional, if the ComponentName annotation is used with the parameter, it's value is passed in here for the implementing factory to use.
componentType - type of component
Returns:
a component

assertTypeConstructable

protected void assertTypeConstructable(Class requestedType,
                                       Class... ableToConstruct)


Copyright © 2008 JBoss, a division of Red Hat. All Rights Reserved.