Author: galder.zamarreno(a)jboss.com
Date: 2010-06-22 19:52:38 -0400 (Tue, 22 Jun 2010)
New Revision: 19784
Added:
core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/JndiInfinispanRegionFactoryTestCase.java
Modified:
core/trunk/cache-infinispan/src/main/java/org/hibernate/cache/infinispan/InfinispanRegionFactory.java
core/trunk/cache-infinispan/src/main/java/org/hibernate/cache/infinispan/JndiInfinispanRegionFactory.java
Log:
[HHH-5332] (JndiInfinispanRegionFactory cannot be instantiated) Fixed.
Modified:
core/trunk/cache-infinispan/src/main/java/org/hibernate/cache/infinispan/InfinispanRegionFactory.java
===================================================================
---
core/trunk/cache-infinispan/src/main/java/org/hibernate/cache/infinispan/InfinispanRegionFactory.java 2010-06-22
16:54:54 UTC (rev 19783)
+++
core/trunk/cache-infinispan/src/main/java/org/hibernate/cache/infinispan/InfinispanRegionFactory.java 2010-06-22
23:52:38 UTC (rev 19784)
@@ -159,7 +159,7 @@
/** {@inheritDoc} */
public CollectionRegion buildCollectionRegion(String regionName, Properties
properties, CacheDataDescription metadata) throws CacheException {
- log.debug("Building collection cache region [" + regionName +
"]");
+ if (log.isDebugEnabled()) log.debug("Building collection cache region ["
+ regionName + "]");
Cache cache = getCache(regionName, COLLECTION_KEY, properties);
CacheAdapter cacheAdapter = CacheAdapterImpl.newInstance(cache);
CollectionRegionImpl region = new CollectionRegionImpl(cacheAdapter, regionName,
metadata, transactionManager, this);
@@ -182,7 +182,7 @@
*/
public QueryResultsRegion buildQueryResultsRegion(String regionName, Properties
properties)
throws CacheException {
- log.debug("Building query results cache region [" + regionName +
"]");
+ if (log.isDebugEnabled()) log.debug("Building query results cache region
[" + regionName + "]");
String cacheName = typeOverrides.get(QUERY_KEY).getCacheName();
CacheAdapter cacheAdapter =
CacheAdapterImpl.newInstance(manager.getCache(cacheName));
QueryResultsRegionImpl region = new QueryResultsRegionImpl(cacheAdapter,
regionName, properties, transactionManager, this);
@@ -195,7 +195,7 @@
*/
public TimestampsRegion buildTimestampsRegion(String regionName, Properties
properties)
throws CacheException {
- log.debug("Building timestamps cache region [" + regionName +
"]");
+ if (log.isDebugEnabled()) log.debug("Building timestamps cache region ["
+ regionName + "]");
String cacheName = typeOverrides.get(TIMESTAMPS_KEY).getCacheName();
CacheAdapter cacheAdapter =
CacheAdapterImpl.newInstance(manager.getCache(cacheName));
TimestampsRegionImpl region = new TimestampsRegionImpl(cacheAdapter, regionName,
transactionManager, this);
Modified:
core/trunk/cache-infinispan/src/main/java/org/hibernate/cache/infinispan/JndiInfinispanRegionFactory.java
===================================================================
---
core/trunk/cache-infinispan/src/main/java/org/hibernate/cache/infinispan/JndiInfinispanRegionFactory.java 2010-06-22
16:54:54 UTC (rev 19783)
+++
core/trunk/cache-infinispan/src/main/java/org/hibernate/cache/infinispan/JndiInfinispanRegionFactory.java 2010-06-22
23:52:38 UTC (rev 19784)
@@ -51,7 +51,15 @@
* There is no default value -- the user must specify the property.
*/
public static final String CACHE_MANAGER_RESOURCE_PROP =
"hibernate.cache.infinispan.cachemanager";
-
+
+ public JndiInfinispanRegionFactory() {
+ super();
+ }
+
+ public JndiInfinispanRegionFactory(Properties props) {
+ super(props);
+ }
+
@Override
protected CacheManager createCacheManager(Properties properties) throws CacheException
{
String name = PropertiesHelper.getString(CACHE_MANAGER_RESOURCE_PROP, properties,
null);
Added:
core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/JndiInfinispanRegionFactoryTestCase.java
===================================================================
---
core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/JndiInfinispanRegionFactoryTestCase.java
(rev 0)
+++
core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/JndiInfinispanRegionFactoryTestCase.java 2010-06-22
23:52:38 UTC (rev 19784)
@@ -0,0 +1,21 @@
+package org.hibernate.test.cache.infinispan;
+
+import junit.framework.TestCase;
+import org.hibernate.cfg.SettingsFactory;
+
+import java.util.Properties;
+
+/**
+ * // TODO: Document this
+ *
+ * @author Galder Zamarreño
+ * @since // TODO
+ */
+public class JndiInfinispanRegionFactoryTestCase extends TestCase {
+
+ public void testConstruction() {
+ Properties p = new Properties();
+ p.setProperty("hibernate.cache.region.factory_class",
"org.hibernate.cache.infinispan.JndiInfinispanRegionFactory");
+ SettingsFactory.createRegionFactory(p, true);
+ }
+}
Show replies by date