org.jboss.cache.factories
Class ComponentFactory

java.lang.Object
  extended by org.jboss.cache.factories.ComponentFactory
Direct Known Subclasses:
BootstrapFactory, CommandsMetaFactory, ContextMetaFactory, DefaultCacheFactory, EmptyConstructorFactory, InterceptorChainFactory, NodeMetaFactory, RegionManagerFactory, StateTransferFactory, StateTransferManagerFactory, TransactionLogFactory, 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 AT jboss DOT org)
See Also:
Inject, ComponentRegistry

Field Summary
protected  ComponentRegistry componentRegistry
           
protected  Configuration configuration
           
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
ComponentFactory()
          Constructs a new ComponentFactory.
ComponentFactory(ComponentRegistry componentRegistry, Configuration configuration)
          Constructs a new ComponentFactory.
 
Method Summary
protected  void assertTypeConstructable(Class requestedType, Class... ableToConstruct)
           
protected abstract
<T> T
construct(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(ComponentRegistry componentRegistry,
                        Configuration configuration)
Constructs a new ComponentFactory.


ComponentFactory

public ComponentFactory()
Constructs a new ComponentFactory.

Method Detail

construct

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

Parameters:
componentType - type of component
Returns:
a component

assertTypeConstructable

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


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