org.hibernate.cache.jbc.builder
Class JndiSharedCacheInstanceManager

java.lang.Object
  extended by org.hibernate.cache.jbc.builder.SharedCacheInstanceManager
      extended by org.hibernate.cache.jbc.builder.JndiSharedCacheInstanceManager
All Implemented Interfaces:
CacheInstanceManager

public class JndiSharedCacheInstanceManager
extends SharedCacheInstanceManager

A SharedCacheInstanceManager that finds the shared cache in JNDI rather than instantiating one from an XML config file.

Version:
$Revision: 1 $
Author:
Brian Stansberry

Field Summary
static String CACHE_RESOURCE_PROP
          Specifies the JNDI name under which the Cache to use is bound.
 
Fields inherited from class org.hibernate.cache.jbc.builder.SharedCacheInstanceManager
CHANNEL_FACTORY_RESOURCE_PROP, DEF_JGROUPS_RESOURCE, DEFAULT_CACHE_RESOURCE, LEGACY_CACHE_RESOURCE_PROP, LEGACY_CHANNEL_FACTORY_RESOURCE_PROP
 
Constructor Summary
JndiSharedCacheInstanceManager()
          Create a new JndiSharedCacheInstanceManager.
 
Method Summary
protected  org.jboss.cache.Cache createSharedCache(Settings settings, Properties properties)
          Create a cache using the given settings and properties.
protected  void stopSharedCache(org.jboss.cache.Cache cache)
          No-op; we don't own the cache so we shouldn't stop it.
 
Methods inherited from class org.hibernate.cache.jbc.builder.SharedCacheInstanceManager
configureTransactionManager, getCollectionCacheInstance, getEntityCacheInstance, getQueryCacheInstance, getTimestampsCacheInstance, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHE_RESOURCE_PROP

public static final String CACHE_RESOURCE_PROP
Specifies the JNDI name under which the Cache to use is bound.

Note that although this configuration property has the same name as that by in the superclass, the meaning here is different. Note also that in this class' usage of the property, there is no default value -- the user must specify the property.

See Also:
Constant Field Values
Constructor Detail

JndiSharedCacheInstanceManager

public JndiSharedCacheInstanceManager()
Create a new JndiSharedCacheInstanceManager.

Method Detail

createSharedCache

protected org.jboss.cache.Cache createSharedCache(Settings settings,
                                                  Properties properties)
Description copied from class: SharedCacheInstanceManager
Create a cache using the given settings and properties.

Overrides:
createSharedCache in class SharedCacheInstanceManager
Parameters:
settings - The Hibernate settings
properties - The configuration properties
Returns:
The created cache

stopSharedCache

protected void stopSharedCache(org.jboss.cache.Cache cache)
No-op; we don't own the cache so we shouldn't stop it.

Overrides:
stopSharedCache in class SharedCacheInstanceManager
Parameters:
cache - the shared cache


Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.