org.infinispan.factories
Class ComponentRegistry

java.lang.Object
  extended by org.infinispan.factories.AbstractComponentRegistry
      extended by org.infinispan.factories.ComponentRegistry
All Implemented Interfaces:
Cloneable, Lifecycle

public class ComponentRegistry
extends AbstractComponentRegistry

Named cache specific components

Since:
4.0
Author:
Manik Surtani

Nested Class Summary
 
Nested classes/interfaces inherited from class org.infinispan.factories.AbstractComponentRegistry
AbstractComponentRegistry.Component
 
Field Summary
 
Fields inherited from class org.infinispan.factories.AbstractComponentRegistry
DEBUG_DEPENDENCIES, moduleLifecycles, NULL_COMPONENT
 
Constructor Summary
ComponentRegistry(String cacheName, Configuration configuration, AdvancedCache cache, GlobalComponentRegistry globalComponents)
          Creates an instance of the component registry.
 
Method Summary
<T> T
getComponent(Class<T> componentType, String name)
           
protected  Map<Class,Class<? extends AbstractComponentFactory>> getDefaultFactoryMap()
           
 GlobalComponentRegistry getGlobalComponentRegistry()
           
<T> T
getLocalComponent(Class<T> componentType)
           
<T> T
getLocalComponent(Class<T> componentType, String name)
           
protected  Log getLog()
           
protected  AbstractComponentRegistry.Component lookupComponent(Class componentClass, String name)
           
protected  AbstractComponentRegistry.Component lookupLocalComponent(Class componentClass, String name)
           
 void registerComponent(Object component, String name)
           
 void setCacheManagerNotifier(CacheManagerNotifier cacheManagerNotifier)
           
 void start()
          This starts the components in the cache, connecting to channels, starting service threads, etc.
 void stop()
          Stops the cache and sets the cache status to ComponentStatus.TERMINATED once it is done.
 
Methods inherited from class org.infinispan.factories.AbstractComponentRegistry
addComponentDependencies, addShutdownHook, clone, getComponent, getConfiguration, getFactory, getFromConfiguration, getOrCreateComponent, getOrCreateComponent, getRegisteredComponents, getStatus, invocationsAllowed, invokeInjectionMethod, registerComponent, registerDefaultClassLoader, removeShutdownHook, resetNonVolatile, rewire, wireDependencies
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentRegistry

public ComponentRegistry(String cacheName,
                         Configuration configuration,
                         AdvancedCache cache,
                         GlobalComponentRegistry globalComponents)
Creates an instance of the component registry. The configuration passed in is automatically registered.

Parameters:
configuration - configuration with which this is created
cache - cache
globalComponents - Shared Component Registry to delegate to
Method Detail

setCacheManagerNotifier

public void setCacheManagerNotifier(CacheManagerNotifier cacheManagerNotifier)

getLog

protected Log getLog()
Specified by:
getLog in class AbstractComponentRegistry

getComponent

public final <T> T getComponent(Class<T> componentType,
                                String name)
Overrides:
getComponent in class AbstractComponentRegistry

getLocalComponent

public final <T> T getLocalComponent(Class<T> componentType,
                                     String name)

getLocalComponent

public final <T> T getLocalComponent(Class<T> componentType)

getDefaultFactoryMap

protected final Map<Class,Class<? extends AbstractComponentFactory>> getDefaultFactoryMap()
Overrides:
getDefaultFactoryMap in class AbstractComponentRegistry

lookupComponent

protected final AbstractComponentRegistry.Component lookupComponent(Class componentClass,
                                                                    String name)
Overrides:
lookupComponent in class AbstractComponentRegistry

lookupLocalComponent

protected final AbstractComponentRegistry.Component lookupLocalComponent(Class componentClass,
                                                                         String name)

getGlobalComponentRegistry

public final GlobalComponentRegistry getGlobalComponentRegistry()

registerComponent

public final void registerComponent(Object component,
                                    String name)
Overrides:
registerComponent in class AbstractComponentRegistry

start

public void start()
Description copied from class: AbstractComponentRegistry
This starts the components in the cache, connecting to channels, starting service threads, etc. If the cache is not in the ComponentStatus.INITIALIZING state, it will be initialized first.

Specified by:
start in interface Lifecycle
Overrides:
start in class AbstractComponentRegistry

stop

public void stop()
Description copied from class: AbstractComponentRegistry
Stops the cache and sets the cache status to ComponentStatus.TERMINATED once it is done. If the cache is not in the ComponentStatus.RUNNING state, this is a no-op.

Specified by:
stop in interface Lifecycle
Overrides:
stop in class AbstractComponentRegistry

Google Analytics

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