Author: manik.surtani(a)jboss.com
Date: 2008-04-12 21:24:05 -0400 (Sat, 12 Apr 2008)
New Revision: 5546
Modified:
core/trunk/src/main/java/org/jboss/cache/DefaultCacheFactory.java
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/RemoveNodeCommand.java
core/trunk/src/main/java/org/jboss/cache/invocation/CacheLifecycleManager.java
core/trunk/src/test/java/org/jboss/cache/replicated/SyncCacheListenerTest.java
Log:
* @Inject methods cannot contain primitives
* CacheLifeCycleManager.internalStart() to remove InterceptorChain from component registry
for reqiring before starting
*
Modified: core/trunk/src/main/java/org/jboss/cache/DefaultCacheFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/DefaultCacheFactory.java 2008-04-12 23:12:51
UTC (rev 5545)
+++ core/trunk/src/main/java/org/jboss/cache/DefaultCacheFactory.java 2008-04-13 01:24:05
UTC (rev 5546)
@@ -133,7 +133,7 @@
this.configuration = configuration;
// make sure we set the CacheLifecycleManager and CacheSPI instance in the
component registry.
- componentRegistry.registerComponent(lifecycleManager,
CacheLifecycleManager.class);
+ componentRegistry.registerComponent(CacheLifecycleManager.class.getName(),
lifecycleManager, CacheLifecycleManager.class);
componentRegistry.registerComponent(CacheSPI.class.getName(), spi,
CacheSPI.class);
}
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/RemoveNodeCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/RemoveNodeCommand.java 2008-04-12
23:12:51 UTC (rev 5545)
+++
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/RemoveNodeCommand.java 2008-04-13
01:24:05 UTC (rev 5546)
@@ -10,6 +10,7 @@
import org.jboss.cache.commands.DataVersionCommand;
import org.jboss.cache.commands.GlobalTransactionCommand;
import org.jboss.cache.commands.TxCacheCommand;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.invocation.CacheData;
import org.jboss.cache.notifications.Notifier;
@@ -62,12 +63,12 @@
}
@Inject
- public void initialize(CacheData cacheData, TransactionTable txTable, Notifier
notifier, boolean isOptimisticLocking)
+ public void initialize(CacheData cacheData, TransactionTable txTable, Notifier
notifier, Configuration configuration)
{
this.cacheData = cacheData;
this.transactionTable = txTable;
this.notifier = notifier;
- this.isOptimistic = isOptimisticLocking;
+ this.isOptimistic = configuration.isNodeLockingOptimistic();
}
public Object perform(InvocationContext ctx)
Modified: core/trunk/src/main/java/org/jboss/cache/invocation/CacheLifecycleManager.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/invocation/CacheLifecycleManager.java 2008-04-12
23:12:51 UTC (rev 5545)
+++
core/trunk/src/main/java/org/jboss/cache/invocation/CacheLifecycleManager.java 2008-04-13
01:24:05 UTC (rev 5546)
@@ -13,7 +13,6 @@
import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.ComponentRegistry;
import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.interceptors.base.ChainedInterceptor;
import org.jboss.cache.loader.CacheLoaderManager;
import org.jboss.cache.lock.LockStrategyFactory;
import org.jboss.cache.marshall.Marshaller;
@@ -372,7 +371,8 @@
private void removeConfigurationDependentComponents()
{
// remove the Interceptor.class component though, since it may pertain to an old
config
- componentRegistry.unregisterComponent(ChainedInterceptor.class);
+
+ componentRegistry.unregisterComponent(InterceptorChain.class); // the interceptor
chain will need reconstructing in case the cfg has changed before calling start()
componentRegistry.unregisterComponent(Marshaller.class);
componentRegistry.unregisterComponent(TransactionManager.class);
componentRegistry.unregisterComponent(BuddyManager.class);
Modified: core/trunk/src/test/java/org/jboss/cache/replicated/SyncCacheListenerTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/replicated/SyncCacheListenerTest.java 2008-04-12
23:12:51 UTC (rev 5545)
+++
core/trunk/src/test/java/org/jboss/cache/replicated/SyncCacheListenerTest.java 2008-04-13
01:24:05 UTC (rev 5546)
@@ -142,7 +142,7 @@
{
Integer age;
Listener lis = new Listener();
- cache1.getNotifier().addCacheListener(lis);
+ cache1.addCacheListener(lis);
lis.put("/a/b/c", "age", 38);
// value on cache2 must be 38