HHH-7238 Remove unneeded cache listeners

This commit is contained in:
Galder Zamarreño 2012-04-13 18:07:31 +02:00
parent 5714a59e5e
commit a334b9f0af
5 changed files with 2 additions and 10 deletions

View File

@ -2,8 +2,6 @@ package org.hibernate.cache.infinispan.collection;
import javax.transaction.TransactionManager; import javax.transaction.TransactionManager;
import org.infinispan.notifications.Listener;
import org.hibernate.cache.CacheException; import org.hibernate.cache.CacheException;
import org.hibernate.cache.infinispan.access.PutFromLoadValidator; import org.hibernate.cache.infinispan.access.PutFromLoadValidator;
import org.hibernate.cache.infinispan.impl.BaseTransactionalDataRegion; import org.hibernate.cache.infinispan.impl.BaseTransactionalDataRegion;
@ -19,7 +17,6 @@ import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy;
* @author Galder Zamarreño * @author Galder Zamarreño
* @since 3.5 * @since 3.5
*/ */
@Listener
public class CollectionRegionImpl extends BaseTransactionalDataRegion implements CollectionRegion { public class CollectionRegionImpl extends BaseTransactionalDataRegion implements CollectionRegion {
public CollectionRegionImpl(CacheAdapter cacheAdapter, String name, CacheDataDescription metadata, public CollectionRegionImpl(CacheAdapter cacheAdapter, String name, CacheDataDescription metadata,

View File

@ -2,8 +2,6 @@ package org.hibernate.cache.infinispan.entity;
import javax.transaction.TransactionManager; import javax.transaction.TransactionManager;
import org.infinispan.notifications.Listener;
import org.hibernate.cache.CacheException; import org.hibernate.cache.CacheException;
import org.hibernate.cache.infinispan.access.PutFromLoadValidator; import org.hibernate.cache.infinispan.access.PutFromLoadValidator;
import org.hibernate.cache.infinispan.impl.BaseTransactionalDataRegion; import org.hibernate.cache.infinispan.impl.BaseTransactionalDataRegion;
@ -19,7 +17,6 @@ import org.hibernate.cache.spi.access.EntityRegionAccessStrategy;
* @author Galder Zamarreño * @author Galder Zamarreño
* @since 3.5 * @since 3.5
*/ */
@Listener
public class EntityRegionImpl extends BaseTransactionalDataRegion implements EntityRegion { public class EntityRegionImpl extends BaseTransactionalDataRegion implements EntityRegion {
public EntityRegionImpl(CacheAdapter cacheAdapter, String name, CacheDataDescription metadata, public EntityRegionImpl(CacheAdapter cacheAdapter, String name, CacheDataDescription metadata,

View File

@ -46,7 +46,6 @@ public abstract class BaseRegion implements Region {
this.transactionManager = transactionManager; this.transactionManager = transactionManager;
this.replication = cacheAdapter.isClusteredReplication(); this.replication = cacheAdapter.isClusteredReplication();
this.address = this.cacheAdapter.getAddress(); this.address = this.cacheAdapter.getAddress();
this.cacheAdapter.addListener(this);
this.factory = factory; this.factory = factory;
} }

View File

@ -4,8 +4,6 @@ import java.util.Properties;
import javax.transaction.Transaction; import javax.transaction.Transaction;
import javax.transaction.TransactionManager; import javax.transaction.TransactionManager;
import org.infinispan.notifications.Listener;
import org.hibernate.cache.CacheException; import org.hibernate.cache.CacheException;
import org.hibernate.cache.infinispan.impl.BaseTransactionalDataRegion; import org.hibernate.cache.infinispan.impl.BaseTransactionalDataRegion;
import org.hibernate.cache.infinispan.util.CacheAdapter; import org.hibernate.cache.infinispan.util.CacheAdapter;
@ -18,7 +16,6 @@ import org.hibernate.cache.spi.RegionFactory;
* @author Galder Zamarreño * @author Galder Zamarreño
* @since 3.5 * @since 3.5
*/ */
@Listener
public class QueryResultsRegionImpl extends BaseTransactionalDataRegion implements QueryResultsRegion { public class QueryResultsRegionImpl extends BaseTransactionalDataRegion implements QueryResultsRegion {
private boolean localOnly; private boolean localOnly;

View File

@ -99,6 +99,7 @@ public class TimestampsRegionImpl extends BaseGeneralDataRegion implements Times
* @param event * @param event
*/ */
@CacheEntryModified @CacheEntryModified
@SuppressWarnings("unused")
public void nodeModified(CacheEntryModifiedEvent event) { public void nodeModified(CacheEntryModifiedEvent event) {
if (!event.isPre()) if (!event.isPre())
localCache.put(event.getKey(), event.getValue()); localCache.put(event.getKey(), event.getValue());
@ -110,6 +111,7 @@ public class TimestampsRegionImpl extends BaseGeneralDataRegion implements Times
* @param event * @param event
*/ */
@CacheEntryRemoved @CacheEntryRemoved
@SuppressWarnings("unused")
public void nodeRemoved(CacheEntryRemovedEvent event) { public void nodeRemoved(CacheEntryRemovedEvent event) {
if (event.isPre()) return; if (event.isPre()) return;
localCache.remove(event.getKey()); localCache.remove(event.getKey());