Author: manik.surtani(a)jboss.com
Date: 2008-05-08 05:07:31 -0400 (Thu, 08 May 2008)
New Revision: 5806
Modified:
core/trunk/src/main/java/org/jboss/cache/config/ConfigurationComponent.java
core/trunk/src/main/java/org/jboss/cache/factories/BootstrapFactory.java
core/trunk/src/main/java/org/jboss/cache/factories/ComponentFactory.java
core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFactory.java
core/trunk/src/main/java/org/jboss/cache/factories/annotations/NonVolatile.java
core/trunk/src/main/java/org/jboss/cache/loader/CacheLoaderManager.java
core/trunk/src/main/java/org/jboss/cache/loader/ChainingCacheLoader.java
core/trunk/src/test/java/org/jboss/cache/cluster/ReplicationQueueTest.java
core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshaller200Test.java
core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshallerTestBase.java
core/trunk/src/test/java/org/jboss/cache/marshall/MarshalledValueTest.java
core/trunk/src/test/java/org/jboss/cache/marshall/MethodIdPreservationTest.java
core/trunk/src/test/java/org/jboss/cache/marshall/VersionAwareMarshallerTest.java
core/trunk/src/test/java/org/jboss/cache/notifications/RemoteCacheListenerTest.java
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorGetChildrenNamesTest.java
core/trunk/src/test/java/org/jboss/cache/statetransfer/FailedStateTransferTest.java
core/trunk/src/test/java/org/jboss/cache/transaction/PrepareCommitContentionTest.java
Log:
ComponentRegistry refactoring
Modified: core/trunk/src/main/java/org/jboss/cache/config/ConfigurationComponent.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/ConfigurationComponent.java 2008-05-08
09:06:54 UTC (rev 5805)
+++ core/trunk/src/main/java/org/jboss/cache/config/ConfigurationComponent.java 2008-05-08
09:07:31 UTC (rev 5806)
@@ -10,7 +10,7 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.CacheSPI;
import org.jboss.cache.CacheStatus;
-import org.jboss.cache.factories.ComponentKernel;
+import org.jboss.cache.factories.ComponentRegistry;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.factories.annotations.Start;
@@ -35,7 +35,7 @@
protected transient Log log = LogFactory.getLog(getClass());
private transient CacheSPI cache; // back-reference to test whether the cache is
running.
private final Set<ConfigurationComponent> children =
Collections.synchronizedSet(new HashSet<ConfigurationComponent>());
- private ComponentKernel cr;
+ private ComponentRegistry cr;
// a workaround to get over immutability checks
private boolean accessible;
@@ -138,7 +138,7 @@
}
@Inject
- private void injectDependencies(ComponentKernel cr)
+ private void injectDependencies(ComponentRegistry cr)
{
this.cr = cr;
}
Modified: core/trunk/src/main/java/org/jboss/cache/factories/BootstrapFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/BootstrapFactory.java 2008-05-08
09:06:54 UTC (rev 5805)
+++ core/trunk/src/main/java/org/jboss/cache/factories/BootstrapFactory.java 2008-05-08
09:07:31 UTC (rev 5806)
@@ -12,15 +12,15 @@
* @author Manik Surtani (<a
href="mailto:manik@jboss.org">manik@jboss.org</a>)
* @since 2.2.0
*/
-@DefaultFactoryFor(classes = {CacheSPI.class, Configuration.class,
ComponentKernel.class})
+@DefaultFactoryFor(classes = {CacheSPI.class, Configuration.class,
ComponentRegistry.class})
@NonVolatile
public class BootstrapFactory extends ComponentFactory
{
CacheSPI cacheSPI;
Configuration configuration;
- ComponentKernel componentRegistry;
+ ComponentRegistry componentRegistry;
- public BootstrapFactory(CacheSPI cacheSPI, Configuration configuration,
ComponentKernel componentRegistry)
+ public BootstrapFactory(CacheSPI cacheSPI, Configuration configuration,
ComponentRegistry componentRegistry)
{
this.cacheSPI = cacheSPI;
this.configuration = configuration;
@@ -34,7 +34,7 @@
if (componentType.equals(Configuration.class)) return (T) configuration;
- if (componentType.equals(ComponentKernel.class)) return (T) componentRegistry;
+ if (componentType.equals(ComponentRegistry.class)) return (T) componentRegistry;
throw new CacheException("Don't know how to handle type " +
componentType);
}
Modified: core/trunk/src/main/java/org/jboss/cache/factories/ComponentFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/ComponentFactory.java 2008-05-08
09:06:54 UTC (rev 5805)
+++ core/trunk/src/main/java/org/jboss/cache/factories/ComponentFactory.java 2008-05-08
09:07:31 UTC (rev 5806)
@@ -16,17 +16,17 @@
*
* @author Manik Surtani (<a
href="mailto:manik@jboss.org">manik@jboss.org</a>)
* @see Inject
- * @see ComponentKernel
+ * @see ComponentRegistry
* @since 2.1.0
*/
public abstract class ComponentFactory
{
protected final Log log = LogFactory.getLog(getClass());
- protected ComponentKernel componentRegistry;
+ protected ComponentRegistry componentRegistry;
protected Configuration configuration;
@Inject
- private void injectDependencies(Configuration configuration, ComponentKernel
componentRegistry)
+ private void injectDependencies(Configuration configuration, ComponentRegistry
componentRegistry)
{
this.configuration = configuration;
this.componentRegistry = componentRegistry;
Modified: core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFactory.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFactory.java 2008-05-08
09:06:54 UTC (rev 5805)
+++
core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFactory.java 2008-05-08
09:07:31 UTC (rev 5806)
@@ -138,7 +138,7 @@
}
}
- public static InterceptorChainFactory getInstance(ComponentKernel componentRegistry,
Configuration configuration)
+ public static InterceptorChainFactory getInstance(ComponentRegistry componentRegistry,
Configuration configuration)
{
InterceptorChainFactory icf = new InterceptorChainFactory();
icf.componentRegistry = componentRegistry;
Modified: core/trunk/src/main/java/org/jboss/cache/factories/annotations/NonVolatile.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/factories/annotations/NonVolatile.java 2008-05-08
09:06:54 UTC (rev 5805)
+++
core/trunk/src/main/java/org/jboss/cache/factories/annotations/NonVolatile.java 2008-05-08
09:07:31 UTC (rev 5806)
@@ -6,7 +6,7 @@
import java.lang.annotation.Target;
/**
- * This annotation is used for components that will be registered in the {@link
org.jboss.cache.factories.ComponentKernel},
+ * This annotation is used for components that will be registered in the {@link
org.jboss.cache.factories.ComponentRegistry},
* that are resilient to changes in configuration. Examples are the {@link
org.jboss.cache.CacheSPI} implementation used, which does
* not change regardless of the configuration.
*
Modified: core/trunk/src/main/java/org/jboss/cache/loader/CacheLoaderManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/CacheLoaderManager.java 2008-05-08
09:06:54 UTC (rev 5805)
+++ core/trunk/src/main/java/org/jboss/cache/loader/CacheLoaderManager.java 2008-05-08
09:07:31 UTC (rev 5806)
@@ -16,7 +16,7 @@
import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
import
org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig.SingletonStoreConfig;
import org.jboss.cache.config.Configuration;
-import org.jboss.cache.factories.ComponentKernel;
+import org.jboss.cache.factories.ComponentRegistry;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.factories.annotations.Start;
import org.jboss.cache.factories.annotations.Stop;
@@ -72,10 +72,10 @@
private boolean fetchPersistentState;
private Configuration configuration;
private RegionManager regionManager;
- private ComponentKernel registry;
+ private ComponentRegistry registry;
@Inject
- public void injectDependencies(CacheSPI cache, Configuration configuration,
RegionManager regionManager, ComponentKernel registry)
+ public void injectDependencies(CacheSPI cache, Configuration configuration,
RegionManager regionManager, ComponentRegistry registry)
{
this.regionManager = regionManager;
this.config = configuration.getCacheLoaderConfig();
Modified: core/trunk/src/main/java/org/jboss/cache/loader/ChainingCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/ChainingCacheLoader.java 2008-05-08
09:06:54 UTC (rev 5805)
+++ core/trunk/src/main/java/org/jboss/cache/loader/ChainingCacheLoader.java 2008-05-08
09:07:31 UTC (rev 5806)
@@ -11,7 +11,7 @@
import org.jboss.cache.RegionManager;
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
-import org.jboss.cache.factories.ComponentKernel;
+import org.jboss.cache.factories.ComponentRegistry;
import org.jboss.cache.factories.annotations.Inject;
import java.io.ObjectInputStream;
@@ -37,7 +37,7 @@
private final List<CacheLoader> cacheLoaders = new
ArrayList<CacheLoader>(2);
private final List<CacheLoader> writeCacheLoaders = new
ArrayList<CacheLoader>(2);
private final List<CacheLoaderConfig.IndividualCacheLoaderConfig>
cacheLoaderConfigs = new
ArrayList<CacheLoaderConfig.IndividualCacheLoaderConfig>(2);
- private ComponentKernel registry;
+ private ComponentRegistry registry;
/**
* Sets the configuration. Will be called before {@link #create()} and {@link
#start()}
@@ -55,7 +55,7 @@
}
@Inject
- public void injectDependencies(ComponentKernel registry)
+ public void injectDependencies(ComponentRegistry registry)
{
this.registry = registry;
}
Modified: core/trunk/src/test/java/org/jboss/cache/cluster/ReplicationQueueTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/cluster/ReplicationQueueTest.java 2008-05-08
09:06:54 UTC (rev 5805)
+++ core/trunk/src/test/java/org/jboss/cache/cluster/ReplicationQueueTest.java 2008-05-08
09:07:31 UTC (rev 5806)
@@ -7,7 +7,7 @@
import org.jboss.cache.RPCManager;
import org.jboss.cache.commands.ReplicableCommand;
import org.jboss.cache.config.Configuration;
-import org.jboss.cache.factories.ComponentKernel;
+import org.jboss.cache.factories.ComponentRegistry;
import org.jboss.cache.misc.TestingUtil;
import org.jgroups.Address;
import static org.testng.AssertJUnit.assertNotNull;
@@ -25,7 +25,7 @@
private static final int COUNT = 10;
Cache cache, cache2;
ReplicationQueue replQ;
- ComponentKernel registry;
+ ComponentRegistry registry;
RPCManager originalRpcManager;
@BeforeMethod
Modified: core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshaller200Test.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshaller200Test.java 2008-05-08
09:06:54 UTC (rev 5805)
+++
core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshaller200Test.java 2008-05-08
09:07:31 UTC (rev 5806)
@@ -10,7 +10,7 @@
import org.jboss.cache.Region;
import org.jboss.cache.RegionManager;
import org.jboss.cache.commands.remote.ClusteredGetCommand;
-import org.jboss.cache.factories.ComponentKernel;
+import org.jboss.cache.factories.ComponentRegistry;
import org.testng.annotations.Test;
import java.io.ByteArrayInputStream;
@@ -87,7 +87,7 @@
final CacheMarshaller200 cm200 = new CacheMarshaller200();
c.setInactiveOnStartup(false);
c.setUseRegionBasedMarshalling(true);
- ComponentKernel cr = new ComponentKernel(c);
+ ComponentRegistry cr = new ComponentRegistry(c);
cr.registerComponent(cm200, CacheMarshaller200.class);
cr.start();
Modified: core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshallerTestBase.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshallerTestBase.java 2008-05-08
09:06:54 UTC (rev 5805)
+++
core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshallerTestBase.java 2008-05-08
09:07:31 UTC (rev 5806)
@@ -12,7 +12,7 @@
import org.jboss.cache.commands.remote.ReplicateCommand;
import org.jboss.cache.commands.write.PutKeyValueCommand;
import org.jboss.cache.config.Configuration;
-import org.jboss.cache.factories.ComponentKernel;
+import org.jboss.cache.factories.ComponentRegistry;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertTrue;
import org.testng.annotations.AfterMethod;
@@ -40,7 +40,7 @@
c.setUseRegionBasedMarshalling(false);
c.setInactiveOnStartup(false);
c.setReplVersionString(currentVersion);
- cr = new ComponentKernel(c);
+ cr = new ComponentRegistry(c);
//c.setUseReferenceCounting(true);
marshaller = createVAMandRestartCache(regionManager);
}
Modified: core/trunk/src/test/java/org/jboss/cache/marshall/MarshalledValueTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/MarshalledValueTest.java 2008-05-08
09:06:54 UTC (rev 5805)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/MarshalledValueTest.java 2008-05-08
09:07:31 UTC (rev 5806)
@@ -9,7 +9,7 @@
import org.jboss.cache.commands.write.PutKeyValueCommand;
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.config.Configuration;
-import org.jboss.cache.factories.ComponentKernel;
+import org.jboss.cache.factories.ComponentRegistry;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
import org.jboss.cache.interceptors.MarshalledValueInterceptor;
import org.jboss.cache.interceptors.base.CommandInterceptor;
@@ -217,7 +217,7 @@
MarshalledValue mv = new MarshalledValue(pojo);
Configuration c = new Configuration();
- ComponentKernel cr = new ComponentKernel(c);
+ ComponentRegistry cr = new ComponentRegistry(c);
Marshaller marshaller = new CacheMarshaller210();
cr.registerComponent(marshaller, Marshaller.class);
Modified: core/trunk/src/test/java/org/jboss/cache/marshall/MethodIdPreservationTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/marshall/MethodIdPreservationTest.java 2008-05-08
09:06:54 UTC (rev 5805)
+++
core/trunk/src/test/java/org/jboss/cache/marshall/MethodIdPreservationTest.java 2008-05-08
09:07:31 UTC (rev 5806)
@@ -6,7 +6,7 @@
import org.jboss.cache.commands.write.PutDataMapCommand;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.CommandsFactory;
-import org.jboss.cache.factories.ComponentKernel;
+import org.jboss.cache.factories.ComponentRegistry;
import static org.testng.AssertJUnit.assertEquals;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -46,7 +46,7 @@
prepareComand = new PrepareCommand(null, list, null, true);
CacheMarshaller210 cm210 = new CacheMarshaller210();
- ComponentKernel registry = new ComponentKernel(new Configuration());
+ ComponentRegistry registry = new ComponentRegistry(new Configuration());
CommandsFactory factory = new CommandsFactory();
cm210.injectCommandsFactory(factory);
Modified:
core/trunk/src/test/java/org/jboss/cache/marshall/VersionAwareMarshallerTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/marshall/VersionAwareMarshallerTest.java 2008-05-08
09:06:54 UTC (rev 5805)
+++
core/trunk/src/test/java/org/jboss/cache/marshall/VersionAwareMarshallerTest.java 2008-05-08
09:07:31 UTC (rev 5806)
@@ -8,7 +8,7 @@
import org.jboss.cache.Version;
import org.jboss.cache.config.Configuration;
-import org.jboss.cache.factories.ComponentKernel;
+import org.jboss.cache.factories.ComponentRegistry;
import org.jboss.util.stream.MarshalledValueInputStream;
import static org.testng.AssertJUnit.assertEquals;
import org.testng.annotations.AfterMethod;
@@ -29,7 +29,7 @@
@BeforeMethod
public void setUp()
{
- cr = new ComponentKernel(new Configuration());
+ cr = new ComponentRegistry(new Configuration());
}
@AfterMethod
Modified:
core/trunk/src/test/java/org/jboss/cache/notifications/RemoteCacheListenerTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/notifications/RemoteCacheListenerTest.java 2008-05-08
09:06:54 UTC (rev 5805)
+++
core/trunk/src/test/java/org/jboss/cache/notifications/RemoteCacheListenerTest.java 2008-05-08
09:07:31 UTC (rev 5806)
@@ -29,7 +29,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
import org.jboss.cache.config.Configuration;
-import org.jboss.cache.factories.ComponentKernel;
+import org.jboss.cache.factories.ComponentRegistry;
import org.jboss.cache.lock.IsolationLevel;
import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.notifications.event.Event;
@@ -110,7 +110,7 @@
public void testSeparateNotifiersAndListeners()
{
assert cache1 != cache2;
- ComponentKernel cr1, cr2;
+ ComponentRegistry cr1, cr2;
cr1 = TestingUtil.extractComponentRegistry(cache1);
cr2 = TestingUtil.extractComponentRegistry(cache2);
assert cr1 != cr2;
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorGetChildrenNamesTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorGetChildrenNamesTest.java 2008-05-08
09:06:54 UTC (rev 5805)
+++
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorGetChildrenNamesTest.java 2008-05-08
09:07:31 UTC (rev 5806)
@@ -2,7 +2,7 @@
import org.jboss.cache.CacheSPI;
import org.jboss.cache.Fqn;
-import org.jboss.cache.factories.ComponentKernel;
+import org.jboss.cache.factories.ComponentRegistry;
import org.jboss.cache.interceptors.OptimisticCreateIfNotExistsInterceptor;
import org.jboss.cache.interceptors.OptimisticNodeInterceptor;
import org.jboss.cache.interceptors.base.CommandInterceptor;
@@ -37,7 +37,7 @@
listener = new TestListener();
cache = createCacheWithListener(listener);
- ComponentKernel cr = TestingUtil.extractComponentRegistry(cache);
+ ComponentRegistry cr = TestingUtil.extractComponentRegistry(cache);
CommandInterceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
cr.registerComponent(interceptor, OptimisticCreateIfNotExistsInterceptor.class);
Modified:
core/trunk/src/test/java/org/jboss/cache/statetransfer/FailedStateTransferTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/statetransfer/FailedStateTransferTest.java 2008-05-08
09:06:54 UTC (rev 5805)
+++
core/trunk/src/test/java/org/jboss/cache/statetransfer/FailedStateTransferTest.java 2008-05-08
09:07:31 UTC (rev 5806)
@@ -27,7 +27,7 @@
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Version;
import org.jboss.cache.config.Configuration.CacheMode;
-import org.jboss.cache.factories.ComponentKernel;
+import org.jboss.cache.factories.ComponentRegistry;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
import org.jboss.cache.lock.TimeoutException;
import org.jboss.cache.misc.TestingUtil;
@@ -60,7 +60,7 @@
caches.put("secretive", cache);
// inject our own message listener and re-wire deps
- ComponentKernel cr = TestingUtil.extractComponentRegistry(cache);
+ ComponentRegistry cr = TestingUtil.extractComponentRegistry(cache);
// cr.unregisterComponent(ChannelMessageListener.class);
cr.registerComponent(new SecretiveStateCacheMessageListener(),
ChannelMessageListener.class);
// cr.updateDependencies();
Modified:
core/trunk/src/test/java/org/jboss/cache/transaction/PrepareCommitContentionTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/transaction/PrepareCommitContentionTest.java 2008-05-08
09:06:54 UTC (rev 5805)
+++
core/trunk/src/test/java/org/jboss/cache/transaction/PrepareCommitContentionTest.java 2008-05-08
09:07:31 UTC (rev 5806)
@@ -9,7 +9,7 @@
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
import static org.jboss.cache.config.Configuration.CacheMode.REPL_SYNC;
-import org.jboss.cache.factories.ComponentKernel;
+import org.jboss.cache.factories.ComponentRegistry;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
import org.jboss.cache.misc.TestingUtil;
import org.jgroups.Address;
@@ -58,7 +58,7 @@
public void testOOBFlag() throws Exception
{
DelegatingRPCManager delegatingRPCManager = new DelegatingRPCManager();
- ComponentKernel cr = TestingUtil.extractComponentRegistry(c1);
+ ComponentRegistry cr = TestingUtil.extractComponentRegistry(c1);
RPCManager origRpcManager = cr.getComponent(RPCManager.class);
delegatingRPCManager.delegate = origRpcManager;
cr.registerComponent(delegatingRPCManager, RPCManager.class);