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 final 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, defaultClassLoader, state
 
Constructor Summary
ComponentRegistry(String cacheName, Configuration configuration, AdvancedCache<?,?> cache, GlobalComponentRegistry globalComponents, ClassLoader defaultClassLoader)
          Creates an instance of the component registry.
 
Method Summary
 StreamingMarshaller getCacheMarshaller()
          Caching shortcut for #getComponent(StreamingMarshaller.class, KnownComponentNames.CACHE_MARSHALLER);
 String getCacheName()
           
 CommandsFactory getCommandsFactory()
          Caching shortcut for #getLocalComponent(CommandsFactory.class);
<T> T
getComponent(String componentTypeName, String name, boolean nameIsFQCN)
           
 GlobalComponentRegistry getGlobalComponentRegistry()
           
<T> T
getLocalComponent(Class<T> componentType)
           
<T> T
getLocalComponent(String componentTypeName, String name, boolean nameIsFQCN)
           
protected  Log getLog()
           
 ResponseGenerator getResponseGenerator()
          Caching shortcut for #getComponent(StateTransferManager.class);
 StateTransferManager getStateTransferManager()
          Caching shortcut for #getComponent(StateTransferManager.class);
protected  AbstractComponentRegistry.Component lookupComponent(String componentClassName, String name, boolean nameIsFQCN)
           
protected  AbstractComponentRegistry.Component lookupLocalComponent(String componentClassName, String name, boolean nameIsFQCN)
           
 void prepareWiringCache()
          Invoked last after all services are wired
protected  void registerComponentInternal(Object component, String name, boolean nameIsFQCN)
           
 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
addShutdownHook, clone, getComponent, getComponent, getComponent, getComponent, getConfiguration, getFactory, getOrCreateComponent, getOrCreateComponent, getRegisteredComponents, getStatus, invocationsAllowed, registerComponent, registerComponent, registerComponent, registerNonVolatileComponent, registerNonVolatileComponent, registerNullComponent, removeShutdownHook, resetVolatileComponents, 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,
                         ClassLoader defaultClassLoader)
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(String componentTypeName,
                                String name,
                                boolean nameIsFQCN)
Overrides:
getComponent in class AbstractComponentRegistry

getLocalComponent

public final <T> T getLocalComponent(String componentTypeName,
                                     String name,
                                     boolean nameIsFQCN)

getLocalComponent

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

lookupComponent

protected final AbstractComponentRegistry.Component lookupComponent(String componentClassName,
                                                                    String name,
                                                                    boolean nameIsFQCN)
Overrides:
lookupComponent in class AbstractComponentRegistry

lookupLocalComponent

protected final AbstractComponentRegistry.Component lookupLocalComponent(String componentClassName,
                                                                         String name,
                                                                         boolean nameIsFQCN)

getGlobalComponentRegistry

public final GlobalComponentRegistry getGlobalComponentRegistry()

registerComponentInternal

protected void registerComponentInternal(Object component,
                                         String name,
                                         boolean nameIsFQCN)
Overrides:
registerComponentInternal 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

getCacheName

public String getCacheName()

getCacheMarshaller

public StreamingMarshaller getCacheMarshaller()
Caching shortcut for #getComponent(StreamingMarshaller.class, KnownComponentNames.CACHE_MARSHALLER);


getStateTransferManager

public StateTransferManager getStateTransferManager()
Caching shortcut for #getComponent(StateTransferManager.class);


getResponseGenerator

public ResponseGenerator getResponseGenerator()
Caching shortcut for #getComponent(StateTransferManager.class);


getCommandsFactory

public CommandsFactory getCommandsFactory()
Caching shortcut for #getLocalComponent(CommandsFactory.class);


prepareWiringCache

public void prepareWiringCache()
Invoked last after all services are wired


-->

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