[infinispan-commits] Infinispan SVN: r1830 - in trunk: client/hotrod-client/src/test/java/org/infinispan/client/hotrod and 49 other directories.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Mon May 24 04:58:45 EDT 2010


Author: mircea.markus
Date: 2010-05-24 04:58:40 -0400 (Mon, 24 May 2010)
New Revision: 1830

Added:
   trunk/core/src/main/java/org/infinispan/manager/EmbeddedCacheManager.java
Modified:
   trunk/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java
   trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/CSAIntegrationTest.java
   trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/CacheContainerTest.java
   trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/CacheManagerNotStartedTest.java
   trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/CacheManagerStoppedTest.java
   trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/ClientConnectionPoolingTest.java
   trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/ForceReturnValueTest.java
   trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/HotRodIntegrationTest.java
   trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/HotRodStatisticsTest.java
   trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/RemoteAsyncAPITest.java
   trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/RemoteCacheManagerTest.java
   trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/ReplTopologyChangeTest.java
   trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/RoundRobinBalancingIntegrationTest.java
   trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/ServerRestartTest.java
   trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/ServerShutdownTest.java
   trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/TestHelper.java
   trunk/core/src/main/java/org/infinispan/CacheDelegate.java
   trunk/core/src/main/java/org/infinispan/CacheSupport.java
   trunk/core/src/main/java/org/infinispan/factories/AbstractComponentRegistry.java
   trunk/core/src/main/java/org/infinispan/factories/GlobalComponentRegistry.java
   trunk/core/src/main/java/org/infinispan/loaders/decorators/SingletonStore.java
   trunk/core/src/main/java/org/infinispan/manager/CacheManager.java
   trunk/core/src/main/java/org/infinispan/manager/DefaultCacheManager.java
   trunk/core/src/main/java/org/infinispan/notifications/cachemanagerlistener/CacheManagerNotifierImpl.java
   trunk/core/src/main/java/org/infinispan/notifications/cachemanagerlistener/event/Event.java
   trunk/core/src/main/java/org/infinispan/notifications/cachemanagerlistener/event/EventImpl.java
   trunk/core/src/main/java/org/infinispan/transaction/xa/TransactionTable.java
   trunk/core/src/test/java/org/infinispan/api/AsyncAPITest.java
   trunk/core/src/test/java/org/infinispan/api/CacheAPITest.java
   trunk/core/src/test/java/org/infinispan/api/CacheClusterJoinTest.java
   trunk/core/src/test/java/org/infinispan/api/ForceWriteLockTest.java
   trunk/core/src/test/java/org/infinispan/api/batch/BatchWithTMTest.java
   trunk/core/src/test/java/org/infinispan/api/batch/BatchWithoutTMTest.java
   trunk/core/src/test/java/org/infinispan/api/mvcc/LockPerEntryTest.java
   trunk/core/src/test/java/org/infinispan/api/mvcc/repeatable_read/WriteSkewTest.java
   trunk/core/src/test/java/org/infinispan/config/ConfigurationCloneTest.java
   trunk/core/src/test/java/org/infinispan/config/ConfigurationValidation2Test.java
   trunk/core/src/test/java/org/infinispan/config/ConfigurationValidationTest.java
   trunk/core/src/test/java/org/infinispan/config/ProgrammaticConfigurationTest.java
   trunk/core/src/test/java/org/infinispan/config/SampleConfigFilesCorrectnessTest.java
   trunk/core/src/test/java/org/infinispan/config/StringPropertyReplacementTest.java
   trunk/core/src/test/java/org/infinispan/distribution/BaseDistCacheStoreTest.java
   trunk/core/src/test/java/org/infinispan/distribution/BaseDistFunctionalTest.java
   trunk/core/src/test/java/org/infinispan/distribution/ConcurrentStartWithReplTest.java
   trunk/core/src/test/java/org/infinispan/distribution/SingleOwnerTest.java
   trunk/core/src/test/java/org/infinispan/distribution/UnknownCacheStartTest.java
   trunk/core/src/test/java/org/infinispan/distribution/rehash/ConcurrentJoinTest.java
   trunk/core/src/test/java/org/infinispan/distribution/rehash/L1OnRehashTest.java
   trunk/core/src/test/java/org/infinispan/distribution/rehash/RehashAfterPartitionMergeTest.java
   trunk/core/src/test/java/org/infinispan/distribution/rehash/RehashCompletedOnJoinTest.java
   trunk/core/src/test/java/org/infinispan/distribution/rehash/SingleJoinTest.java
   trunk/core/src/test/java/org/infinispan/distribution/rehash/WorkDuringJoinTest.java
   trunk/core/src/test/java/org/infinispan/eviction/BaseEvictionFunctionalTest.java
   trunk/core/src/test/java/org/infinispan/eviction/MarshalledValuesEvictionTest.java
   trunk/core/src/test/java/org/infinispan/eviction/MarshalledValuesManualEvictionTest.java
   trunk/core/src/test/java/org/infinispan/interceptors/MarshalledValueInterceptorTest.java
   trunk/core/src/test/java/org/infinispan/jmx/ActivationAndPassivationInterceptorMBeanTest.java
   trunk/core/src/test/java/org/infinispan/jmx/CacheLoaderAndCacheStoreInterceptorMBeanTest.java
   trunk/core/src/test/java/org/infinispan/jmx/CacheMBeanTest.java
   trunk/core/src/test/java/org/infinispan/jmx/CacheManagerMBeanTest.java
   trunk/core/src/test/java/org/infinispan/jmx/CacheMgmtInterceptorMBeanTest.java
   trunk/core/src/test/java/org/infinispan/jmx/ComponentsJmxRegistrationTest.java
   trunk/core/src/test/java/org/infinispan/jmx/JmxStatsFunctionalTest.java
   trunk/core/src/test/java/org/infinispan/jmx/MvccLockManagerMBeanTest.java
   trunk/core/src/test/java/org/infinispan/jmx/TxInterceptorMBeanTest.java
   trunk/core/src/test/java/org/infinispan/jndi/BindingTest.java
   trunk/core/src/test/java/org/infinispan/loaders/BaseCacheStoreFunctionalTest.java
   trunk/core/src/test/java/org/infinispan/loaders/CacheLoaderFunctionalTest.java
   trunk/core/src/test/java/org/infinispan/loaders/ClusterCacheLoaderTest.java
   trunk/core/src/test/java/org/infinispan/loaders/ConcurrentLoadAndEvictTest.java
   trunk/core/src/test/java/org/infinispan/loaders/ConcurrentLoadAndEvictTxTest.java
   trunk/core/src/test/java/org/infinispan/loaders/UnnnecessaryLoadingTest.java
   trunk/core/src/test/java/org/infinispan/loaders/decorators/SingletonStoreTest.java
   trunk/core/src/test/java/org/infinispan/loaders/file/ClusterFileCacheStoreFunctionalTest.java
   trunk/core/src/test/java/org/infinispan/manager/CacheManagerComponentRegistryTest.java
   trunk/core/src/test/java/org/infinispan/manager/CacheManagerTest.java
   trunk/core/src/test/java/org/infinispan/manager/CacheManagerXmlConfigurationTest.java
   trunk/core/src/test/java/org/infinispan/notifications/CacheListenerCacheLoaderTest.java
   trunk/core/src/test/java/org/infinispan/notifications/cachemanagerlistener/CacheManagerNotifierTest.java
   trunk/core/src/test/java/org/infinispan/profiling/AbstractProfileTest.java
   trunk/core/src/test/java/org/infinispan/profiling/DeadlockDetectionPerformanceTest.java
   trunk/core/src/test/java/org/infinispan/statetransfer/StateTransferCacheLoaderFunctionalTest.java
   trunk/core/src/test/java/org/infinispan/statetransfer/StateTransferFetchOnlyPersistentStateTest.java
   trunk/core/src/test/java/org/infinispan/statetransfer/StateTransferFileCacheLoaderFunctionalTest.java
   trunk/core/src/test/java/org/infinispan/statetransfer/StateTransferFunctionalTest.java
   trunk/core/src/test/java/org/infinispan/test/AbstractCacheTest.java
   trunk/core/src/test/java/org/infinispan/test/MultipleCacheManagersTest.java
   trunk/core/src/test/java/org/infinispan/test/ReplListener.java
   trunk/core/src/test/java/org/infinispan/test/SingleCacheManagerTest.java
   trunk/core/src/test/java/org/infinispan/test/TestingUtil.java
   trunk/core/src/test/java/org/infinispan/test/ViewChangeListener.java
   trunk/core/src/test/java/org/infinispan/test/fwk/TestCacheManagerFactory.java
   trunk/core/src/test/java/org/infinispan/tx/LocalDeadlockDetectionTest.java
   trunk/core/src/test/java/org/infinispan/tx/LocalModeTxTest.java
   trunk/core/src/test/java/org/infinispan/tx/MarkAsRollbackTest.java
   trunk/core/src/test/java/org/infinispan/tx/StaleLockRecoveryTest.java
   trunk/core/src/test/java/org/infinispan/tx/TransactionsSpanningCaches.java
   trunk/demos/directory/src/main/java/org/infinispan/demos/directory/FilesystemDirectory.java
   trunk/demos/ec2/src/main/java/org/infinispan/ec2demo/CacheBuilder.java
   trunk/demos/gui/src/main/java/org/infinispan/demo/InfinispanDemo.java
   trunk/demos/lucene-directory-demo/src/main/java/org/infinispan/lucenedemo/DemoActions.java
   trunk/jopr-plugin/src/main/resources/META-INF/rhq-plugin.xml
   trunk/jopr-plugin/src/test/java/org/infinispan/jopr/InfinispanJoprTest.java
   trunk/lucene-directory/src/test/java/org/infinispan/lucene/DynamicClusterIndexStressTest.java
   trunk/query/
   trunk/query/src/test/java/org/infinispan/query/blackbox/BrokenAnnotationTest.java
   trunk/query/src/test/java/org/infinispan/query/blackbox/KeyTypeTest.java
   trunk/query/src/test/java/org/infinispan/query/blackbox/LocalCacheTest.java
   trunk/query/src/test/java/org/infinispan/query/config/DeclarativeConfigTest.java
   trunk/query/src/test/java/org/infinispan/query/tx/TransactionalQueryTest.java
   trunk/server/core/src/main/scala/org/infinispan/server/core/AbstractProtocolServer.scala
   trunk/server/core/src/main/scala/org/infinispan/server/core/ProtocolServer.scala
   trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/Decoder10.scala
   trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/HotRodDecoder.scala
   trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/HotRodServer.scala
   trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodIdleTimeoutTest.scala
   trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodSingleNodeTest.scala
   trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodStatsTest.scala
   trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/test/HotRodTestingUtil.scala
   trunk/server/memcached/src/test/scala/org/infinispan/server/memcached/MemcachedSingleNodeTest.scala
   trunk/server/memcached/src/test/scala/org/infinispan/server/memcached/MemcachedStatsTest.scala
   trunk/server/memcached/src/test/scala/org/infinispan/server/memcached/test/MemcachedTestingUtil.scala
   trunk/server/rest/src/main/scala/org/infinispan/rest/Server.scala
   trunk/server/websocket/src/main/java/org/infinispan/server/websocket/WebSocketServer.java
   trunk/tree/src/test/java/org/infinispan/api/tree/NodeAPITest.java
   trunk/tree/src/test/java/org/infinispan/api/tree/NodeMoveAPITest.java
   trunk/tree/src/test/java/org/infinispan/api/tree/TreeCacheAPITest.java
Log:
ISPN-442 - re-design CacheManager hierarchy


Modified: trunk/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java
===================================================================
--- trunk/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -11,8 +11,7 @@
 import org.infinispan.client.hotrod.impl.transport.VHelper;
 import org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory;
 import org.infinispan.executors.ExecutorFactory;
-import org.infinispan.lifecycle.Lifecycle;
-import org.infinispan.manager.CacheContainer;
+import org.infinispan.manager.CacheManager;
 import org.infinispan.manager.DefaultCacheManager;
 import org.infinispan.util.logging.Log;
 import org.infinispan.util.logging.LogFactory;
@@ -124,7 +123,7 @@
  * @author Mircea.Markus at jboss.com
  * @since 4.1
  */
-public class RemoteCacheManager implements CacheContainer, Lifecycle {
+public class RemoteCacheManager implements CacheManager {
 
    private static Log log = LogFactory.getLog(RemoteCacheManager.class);
 

Modified: trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/CSAIntegrationTest.java
===================================================================
--- trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/CSAIntegrationTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/CSAIntegrationTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -9,6 +9,7 @@
 import org.infinispan.interceptors.base.CommandInterceptor;
 import org.infinispan.lifecycle.ComponentStatus;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.server.hotrod.HotRodServer;
 import org.infinispan.test.MultipleCacheManagersTest;
 import org.infinispan.test.TestingUtil;
@@ -54,9 +55,9 @@
    protected void createCacheManagers() throws Throwable {
       Configuration config = getDefaultClusteredConfig(Configuration.CacheMode.DIST_SYNC);
       config.setUnsafeUnreliableReturnValues(true);
-      CacheManager cm1 = addClusterEnabledCacheManager();
-      CacheManager cm2 = addClusterEnabledCacheManager();
-      CacheManager cm3 = addClusterEnabledCacheManager();
+      EmbeddedCacheManager cm1 = addClusterEnabledCacheManager();
+      EmbeddedCacheManager cm2 = addClusterEnabledCacheManager();
+      EmbeddedCacheManager cm3 = addClusterEnabledCacheManager();
       cm1.defineConfiguration(CACHE_NAME, config);
       cm2.defineConfiguration(CACHE_NAME, config);
       cm3.defineConfiguration(CACHE_NAME, config);

Modified: trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/CacheContainerTest.java
===================================================================
--- trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/CacheContainerTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/CacheContainerTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -3,6 +3,7 @@
 import org.infinispan.Cache;
 import org.infinispan.config.Configuration;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.server.hotrod.HotRodServer;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -18,12 +19,12 @@
 
    private static final String CACHE_NAME = "someName";
 
-   CacheManager cacheManager = null;
+   EmbeddedCacheManager cacheManager = null;
    HotRodServer hotrodServer = null;
    RemoteCacheManager remoteCacheManager;
 
    @Override
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       cacheManager = TestCacheManagerFactory.createLocalCacheManager();
       cacheManager.defineConfiguration(CACHE_NAME, new Configuration());
       hotrodServer = TestHelper.startHotRodServer(cacheManager);

Modified: trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/CacheManagerNotStartedTest.java
===================================================================
--- trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/CacheManagerNotStartedTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/CacheManagerNotStartedTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -3,6 +3,7 @@
 import org.infinispan.client.hotrod.exceptions.RemoteCacheManagerNotStartedException;
 import org.infinispan.config.Configuration;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.server.hotrod.HotRodServer;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -20,12 +21,12 @@
 
    private static final String CACHE_NAME = "someName";
 
-   CacheManager cacheManager = null;
+   EmbeddedCacheManager cacheManager = null;
    HotRodServer hotrodServer = null;
    RemoteCacheManager remoteCacheManager;
 
    @Override
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       cacheManager = TestCacheManagerFactory.createLocalCacheManager();
       cacheManager.defineConfiguration(CACHE_NAME, new Configuration());
       hotrodServer = TestHelper.startHotRodServer(cacheManager);

Modified: trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/CacheManagerStoppedTest.java
===================================================================
--- trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/CacheManagerStoppedTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/CacheManagerStoppedTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -3,6 +3,7 @@
 import org.infinispan.client.hotrod.exceptions.RemoteCacheManagerNotStartedException;
 import org.infinispan.config.Configuration;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.server.hotrod.HotRodServer;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -20,12 +21,12 @@
 
    private static final String CACHE_NAME = "someName";
 
-   CacheManager cacheManager = null;
+   EmbeddedCacheManager cacheManager = null;
    HotRodServer hotrodServer = null;
    RemoteCacheManager remoteCacheManager;
 
    @Override
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       cacheManager = TestCacheManagerFactory.createLocalCacheManager();
       cacheManager.defineConfiguration(CACHE_NAME, new Configuration());
       hotrodServer = TestHelper.startHotRodServer(cacheManager);

Modified: trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/ClientConnectionPoolingTest.java
===================================================================
--- trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/ClientConnectionPoolingTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/ClientConnectionPoolingTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -6,6 +6,7 @@
 import org.infinispan.commands.VisitableCommand;
 import org.infinispan.context.InvocationContext;
 import org.infinispan.interceptors.base.CommandInterceptor;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.server.hotrod.HotRodServer;
 import org.infinispan.test.MultipleCacheManagersTest;
 import org.infinispan.test.TestingUtil;
@@ -61,8 +62,8 @@
       c2 = TestCacheManagerFactory.createLocalCacheManager().getCache();
       registerCacheManager(c1.getCacheManager(), c2.getCacheManager());
 
-      hotRodServer1 = TestHelper.startHotRodServer(c1.getCacheManager());
-      hotRodServer2 = TestHelper.startHotRodServer(c2.getCacheManager());
+      hotRodServer1 = TestHelper.startHotRodServer((EmbeddedCacheManager) c1.getCacheManager());
+      hotRodServer2 = TestHelper.startHotRodServer((EmbeddedCacheManager) c2.getCacheManager());
 
       String servers = TestHelper.getServersString(hotRodServer1, hotRodServer2);
       Properties hotrodClientConf = new Properties();

Modified: trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/ForceReturnValueTest.java
===================================================================
--- trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/ForceReturnValueTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/ForceReturnValueTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -1,6 +1,6 @@
 package org.infinispan.client.hotrod;
 
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.server.hotrod.HotRodServer;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -21,7 +21,7 @@
    private HotRodServer hotrodServer;
 
    @Override
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       cacheManager = TestCacheManagerFactory.createLocalCacheManager();
       cache = cacheManager.getCache();
       hotrodServer = TestHelper.startHotRodServer(cacheManager);

Modified: trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/HotRodIntegrationTest.java
===================================================================
--- trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/HotRodIntegrationTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/HotRodIntegrationTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -3,7 +3,7 @@
 import org.infinispan.Cache;
 import org.infinispan.client.hotrod.impl.SerializationMarshaller;
 import org.infinispan.config.Configuration;
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.server.core.CacheValue;
 import org.infinispan.server.hotrod.CacheKey;
 import org.infinispan.server.hotrod.HotRodServer;
@@ -41,7 +41,7 @@
    protected HotRodServer hotrodServer;
 
    @Override
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       Configuration standaloneConfig = getDefaultStandaloneConfig(false);
       cacheManager = TestCacheManagerFactory.createLocalCacheManager();
       cacheManager.defineConfiguration(CACHE_NAME, standaloneConfig);

Modified: trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/HotRodStatisticsTest.java
===================================================================
--- trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/HotRodStatisticsTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/HotRodStatisticsTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -1,6 +1,7 @@
 package org.infinispan.client.hotrod;
 
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.server.hotrod.HotRodServer;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -30,7 +31,7 @@
    protected void setup() throws Exception {
       cacheManager = TestCacheManagerFactory.createCacheManagerEnforceJmxDomain(getClass().getSimpleName());
 
-      hotrodServer = TestHelper.startHotRodServer(cacheManager);
+      hotrodServer = TestHelper.startHotRodServer((EmbeddedCacheManager) cacheManager);
       startTime = System.currentTimeMillis();
       rcm = new RemoteCacheManager("localhost", hotrodServer.getPort());
       remoteCache = rcm.getCache();

Modified: trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/RemoteAsyncAPITest.java
===================================================================
--- trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/RemoteAsyncAPITest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/RemoteAsyncAPITest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -1,6 +1,7 @@
 package org.infinispan.client.hotrod;
 
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.server.hotrod.HotRodServer;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -24,8 +25,8 @@
    private RemoteCache<String, String> c;
 
    @Override
-   protected CacheManager createCacheManager() throws Exception {
-      CacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
       cache = cm.getCache();
       hotrodServer = TestHelper.startHotRodServer(cm);
       Properties props = new Properties();

Modified: trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/RemoteCacheManagerTest.java
===================================================================
--- trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/RemoteCacheManagerTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/RemoteCacheManagerTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -1,6 +1,6 @@
 package org.infinispan.client.hotrod;
 
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.server.hotrod.HotRodServer;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -17,12 +17,12 @@
 @Test(testName = "client.hotrod.RemoteCacheManagerTest", groups = "functional" )
 public class RemoteCacheManagerTest extends SingleCacheManagerTest {
 
-   CacheManager cacheManager = null;
+   EmbeddedCacheManager cacheManager = null;
    HotRodServer hotrodServer = null;
    private String prevValue;
 
    @Override
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       cacheManager = TestCacheManagerFactory.createLocalCacheManager();
       hotrodServer = TestHelper.startHotRodServer(cacheManager);
       prevValue = System.setProperty(RemoteCacheManager.OVERRIDE_HOTROD_SERVERS, "localhost:" + hotrodServer.getPort());

Modified: trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/ReplTopologyChangeTest.java
===================================================================
--- trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/ReplTopologyChangeTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/ReplTopologyChangeTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -26,7 +26,7 @@
 
    HotRodServer hotRodServer1;
    HotRodServer hotRodServer2;
-   HotRodServer hotRodServer3;
+   HotRodServer hotRodServer3 ;
 
    RemoteCache remoteCache;
    private RemoteCacheManager remoteCacheManager;

Modified: trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/RoundRobinBalancingIntegrationTest.java
===================================================================
--- trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/RoundRobinBalancingIntegrationTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/RoundRobinBalancingIntegrationTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -4,6 +4,7 @@
 import org.infinispan.client.hotrod.exceptions.TransportException;
 import org.infinispan.client.hotrod.impl.transport.tcp.RoundRobinBalancingStrategy;
 import org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.server.hotrod.HotRodServer;
 import org.infinispan.test.MultipleCacheManagersTest;
 import org.infinispan.test.TestingUtil;
@@ -53,9 +54,9 @@
       c3 = TestCacheManagerFactory.createLocalCacheManager().getCache();
       registerCacheManager(c1.getCacheManager(), c2.getCacheManager(), c3.getCacheManager());
 
-      hotRodServer1 = TestHelper.startHotRodServer(c1.getCacheManager());
-      hotRodServer2 = TestHelper.startHotRodServer(c2.getCacheManager());
-      hotRodServer3 = TestHelper.startHotRodServer(c3.getCacheManager());
+      hotRodServer1 = TestHelper.startHotRodServer((EmbeddedCacheManager) c1.getCacheManager());
+      hotRodServer2 = TestHelper.startHotRodServer((EmbeddedCacheManager) c2.getCacheManager());
+      hotRodServer3 = TestHelper.startHotRodServer((EmbeddedCacheManager) c3.getCacheManager());
 
       log.trace("Server 1 port: " + hotRodServer1.getPort());
       log.trace("Server 2 port: " + hotRodServer2.getPort());
@@ -102,7 +103,7 @@
    @Test(dependsOnMethods = "testRoundRubinLoadBalancing")
    public void testAddNewHotrodServer() {
       c4 = TestCacheManagerFactory.createLocalCacheManager().getCache();
-      hotRodServer4 = TestHelper.startHotRodServer(c4.getCacheManager());
+      hotRodServer4 = TestHelper.startHotRodServer((EmbeddedCacheManager) c4.getCacheManager());
       registerCacheManager(c4.getCacheManager());
 
       List<InetSocketAddress> serverAddresses = new ArrayList<InetSocketAddress>();

Modified: trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/ServerRestartTest.java
===================================================================
--- trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/ServerRestartTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/ServerRestartTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -1,7 +1,6 @@
 package org.infinispan.client.hotrod;
 
-import org.infinispan.Cache;
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.server.hotrod.HotRodServer;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -28,7 +27,7 @@
 
 
    @Override
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       cacheManager = TestCacheManagerFactory.createLocalCacheManager();
       cacheManager.getCache();
 

Modified: trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/ServerShutdownTest.java
===================================================================
--- trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/ServerShutdownTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/ServerShutdownTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -1,6 +1,7 @@
 package org.infinispan.client.hotrod;
 
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.server.hotrod.HotRodServer;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
 import org.testng.annotations.Test;
@@ -15,7 +16,7 @@
 public class ServerShutdownTest {
 
    public void testServerShutdownWithConnectedClient() {
-      CacheManager cacheManager = TestCacheManagerFactory.createLocalCacheManager();
+      EmbeddedCacheManager cacheManager = TestCacheManagerFactory.createLocalCacheManager();
       HotRodServer hotrodServer = TestHelper.startHotRodServer(cacheManager);
       RemoteCacheManager remoteCacheManager = new RemoteCacheManager("localhost", hotrodServer.getPort());
       RemoteCache remoteCache = remoteCacheManager.getCache();
@@ -29,7 +30,7 @@
    }
 
    public void testServerShutdownWithoutConnectedClient() {
-      CacheManager cacheManager = TestCacheManagerFactory.createLocalCacheManager();
+      EmbeddedCacheManager cacheManager = TestCacheManagerFactory.createLocalCacheManager();
       HotRodServer hotrodServer = TestHelper.startHotRodServer(cacheManager);
       RemoteCacheManager remoteCacheManager = new RemoteCacheManager("localhost", hotrodServer.getPort());
       RemoteCache remoteCache = remoteCacheManager.getCache();

Modified: trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/TestHelper.java
===================================================================
--- trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/TestHelper.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/TestHelper.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -1,7 +1,7 @@
 package org.infinispan.client.hotrod;
 
 import org.infinispan.config.Configuration;
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.server.hotrod.HotRodServer;
 import org.infinispan.server.hotrod.test.HotRodTestingUtil;
 
@@ -18,7 +18,7 @@
     */
    private static final AtomicInteger uniquePort = new AtomicInteger(11312);
 
-   public static HotRodServer startHotRodServer(CacheManager cacheManager) {
+   public static HotRodServer startHotRodServer(EmbeddedCacheManager cacheManager) {
       return HotRodTestingUtil.startHotRodServer(cacheManager, uniquePort.incrementAndGet());
    }
 

Modified: trunk/core/src/main/java/org/infinispan/CacheDelegate.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/CacheDelegate.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/main/java/org/infinispan/CacheDelegate.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -53,8 +53,8 @@
 import org.infinispan.jmx.annotations.ManagedAttribute;
 import org.infinispan.jmx.annotations.ManagedOperation;
 import org.infinispan.lifecycle.ComponentStatus;
-import org.infinispan.manager.CacheManager;
 import org.infinispan.manager.DefaultCacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.marshall.MarshalledValue;
 import org.infinispan.marshall.Marshaller;
 import org.infinispan.notifications.cachelistener.CacheNotifier;
@@ -64,7 +64,6 @@
 import org.infinispan.stats.Stats;
 import org.infinispan.stats.StatsImpl;
 import org.infinispan.util.concurrent.AbstractInProcessNotifyingFuture;
-import org.infinispan.util.concurrent.FutureListener;
 import org.infinispan.util.concurrent.NotifyingFuture;
 import org.infinispan.util.logging.Log;
 import org.infinispan.util.logging.LogFactory;
@@ -84,9 +83,7 @@
 import java.util.Set;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
 
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
 import static org.infinispan.context.Flag.*;
 
 /**
@@ -112,7 +109,7 @@
    private EvictionManager evictionManager;
    private DataContainer dataContainer;
    private static final Log log = LogFactory.getLog(CacheDelegate.class);
-   private CacheManager cacheManager;
+   private EmbeddedCacheManager cacheManager;
    // this is never used here but should be injected - this is a hack to make sure the StateTransferManager is properly constructed if needed.
    private StateTransferManager stateTransferManager;
    // as above for ResponseGenerator
@@ -137,7 +134,7 @@
                                   RpcManager rpcManager, DataContainer dataContainer,
                                   Marshaller marshaller, ResponseGenerator responseGenerator,
                                   DistributionManager distributionManager,
-                                  CacheManager cacheManager, StateTransferManager stateTransferManager) {
+                                  EmbeddedCacheManager cacheManager, StateTransferManager stateTransferManager) {
       this.commandsFactory = commandsFactory;
       this.invoker = interceptorChain;
       this.config = configuration;
@@ -399,7 +396,7 @@
       return transactionManager;
    }
 
-   public CacheManager getCacheManager() {
+   public EmbeddedCacheManager getCacheManager() {
       return cacheManager;
    }
 

Modified: trunk/core/src/main/java/org/infinispan/CacheSupport.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/CacheSupport.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/main/java/org/infinispan/CacheSupport.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -8,8 +8,6 @@
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
 
 /**
- * // TODO: Document this
- *
  * @author Mircea.Markus at jboss.com
  * @since 4.1
  */

Modified: trunk/core/src/main/java/org/infinispan/factories/AbstractComponentRegistry.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/factories/AbstractComponentRegistry.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/main/java/org/infinispan/factories/AbstractComponentRegistry.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -334,7 +334,7 @@
       Map<Class, Class<? extends AbstractComponentFactory>> defaultFactoryMap = getDefaultFactoryMap();
       Class<? extends AbstractComponentFactory> cfClass = defaultFactoryMap.get(componentClass);
       if (cfClass == null)
-         throw new ConfigurationException("No registered default factory for component " + componentClass + " found! Debug stack: " + debugStack);
+         throw new ConfigurationException("No registered default factory for component '" + componentClass + "' found! Debug stack: " + debugStack);
       // a component factory is a component too!  See if one has been created and exists in the registry
       AbstractComponentFactory cf = getComponent(cfClass);
       if (cf == null) {

Modified: trunk/core/src/main/java/org/infinispan/factories/GlobalComponentRegistry.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/factories/GlobalComponentRegistry.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/main/java/org/infinispan/factories/GlobalComponentRegistry.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -10,7 +10,7 @@
 import org.infinispan.jmx.CacheManagerJmxRegistration;
 import org.infinispan.lifecycle.ComponentStatus;
 import org.infinispan.lifecycle.ModuleLifecycle;
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.notifications.cachemanagerlistener.CacheManagerNotifier;
 import org.infinispan.notifications.cachemanagerlistener.CacheManagerNotifierImpl;
 import org.infinispan.util.logging.Log;
@@ -50,14 +50,14 @@
     *
     * @param configuration configuration with which this is created
     */
-   public GlobalComponentRegistry(GlobalConfiguration configuration, CacheManager cacheManager) {
+   public GlobalComponentRegistry(GlobalConfiguration configuration, EmbeddedCacheManager cacheManager) {
       if (configuration == null) throw new NullPointerException("GlobalConfiguration cannot be null!");
       try {
          // this order is important ... 
          globalConfiguration = configuration;
          registerDefaultClassLoader(null);
          registerComponent(this, GlobalComponentRegistry.class);
-         registerComponent(cacheManager, CacheManager.class);
+         registerComponent(cacheManager, EmbeddedCacheManager.class);
          registerComponent(configuration, GlobalConfiguration.class);
          registerComponent(new CacheManagerJmxRegistration(), CacheManagerJmxRegistration.class);
          registerComponent(new CacheManagerNotifierImpl(), CacheManagerNotifier.class);

Modified: trunk/core/src/main/java/org/infinispan/loaders/decorators/SingletonStore.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/loaders/decorators/SingletonStore.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/main/java/org/infinispan/loaders/decorators/SingletonStore.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -7,6 +7,7 @@
 import org.infinispan.loaders.CacheStore;
 import org.infinispan.loaders.modifications.Modification;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.notifications.Listener;
 import org.infinispan.notifications.cachemanagerlistener.annotation.CacheStarted;
 import org.infinispan.notifications.cachemanagerlistener.annotation.ViewChanged;
@@ -53,7 +54,7 @@
    private static final Log log = LogFactory.getLog(SingletonStore.class);
    private static final boolean trace = log.isTraceEnabled();
 
-   CacheManager cacheManager;
+   EmbeddedCacheManager cacheManager;
    Cache cache;
    SingletonStoreConfig config;
 
@@ -88,7 +89,7 @@
 
    public SingletonStore(CacheStore delegate, Cache cache, SingletonStoreConfig config) {
       super(delegate);
-      this.cacheManager = cache == null ? null : cache.getCacheManager();
+      this.cacheManager = cache == null ? null : (EmbeddedCacheManager)cache.getCacheManager();
       this.cache = cache;
       this.config = config;
 

Modified: trunk/core/src/main/java/org/infinispan/manager/CacheManager.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/manager/CacheManager.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/main/java/org/infinispan/manager/CacheManager.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -22,18 +22,6 @@
  * JVM (unless specific configuration requirements require more than one; but either way, this would be a minimal and
  * finite number of instances).
  * <p/>
- * Constructing a <tt>CacheManager</tt> is done via one of its constructors, which optionally take in a {@link
- * org.infinispan.config.Configuration} or a path or URL to a configuration XML file.
- * <p/>
- * Lifecycle - <tt>CacheManager</tt>s have a lifecycle (it implements {@link org.infinispan.lifecycle.Lifecycle}) and
- * the default constructors also call {@link #start()}.  Overloaded versions of the constructors are available, that do
- * not start the <tt>CacheManager</tt>, although it must be kept in mind that <tt>CacheManager</tt>s need to be started
- * before they can be used to create <tt>Cache</tt> instances.
- * <p/>
- * Once constructed, <tt>CacheManager</tt>s should be made available to any component that requires a <tt>Cache</tt>,
- * via <a href="http://en.wikipedia.org/wiki/Java_Naming_and_Directory_Interface">JNDI</a> or via some other mechanism
- * such as an <a href="http://en.wikipedia.org/wiki/Dependency_injection">dependency injection</a> framework.
- * <p/>
  * You obtain <tt>Cache</tt> instances from the <tt>CacheManager</tt> by using one of the overloaded
  * <tt>getCache()</tt>, methods.  Note that with <tt>getCache()</tt>, there is no guarantee that the instance you get is
  * brand-new and empty, since caches are named and shared.  Because of this, the <tt>CacheManager</tt> also acts as a
@@ -46,99 +34,56 @@
  * ensure that <i>at least one</i> but <i>only one</i> caller calls stop() on the cache, and it does so with the awareness
  * that others may be using the cache.
  * <p />
- * Sample usage: <code> CacheManager manager = new DefaultCacheManager("my-config-file.xml"); Cache entityCache =
- * manager.getCache("myEntityCache"); entityCache.put("aPerson", new Person());
+ * Sample usage:
+ * <code>
+ * CacheManager manager = new DefaultCacheManager("my-config-file.xml"); 
+ * Cache entityCache = manager.getCache("myEntityCache");
+ * entityCache.put("aPerson", new Person());
  * <p/>
- * Configuration myNewConfiguration = new Configuration(); myNewConfiguration.setCacheMode(Configuration.CacheMode.LOCAL);
- * manager.defineConfiguration("myLocalCache", myNewConfiguration); Cache localCache = manager.getCache("myLocalCache");
+ * Configuration myNewConfiguration = new Configuration();
+ * myNewConfiguration.setCacheMode(Configuration.CacheMode.LOCAL);
+ * manager.defineConfiguration("myLocalCache", myNewConfiguration);
+ * Cache localCache = manager.getCache("myLocalCache");
  * </code>
  *
+ * @see org.infinispan.manager.EmbeddedCacheManager
+ *
  * @author Manik Surtani (<a href="mailto:manik at jboss.org">manik at jboss.org</a>)
  * @author Galder Zamarreño
+ * @author Mircea.Markus at jboss.com
  * @since 4.0
  */
- at Scope(Scopes.GLOBAL)
- at SurvivesRestarts
-public interface CacheManager extends Lifecycle, Listenable, CacheContainer {
+public interface CacheManager extends Lifecycle {
+
    /**
-    * Defines a named cache's configuration using the following algorithm:
+    * Retrieves the default cache associated with this cache container.
     * <p/>
-    * If cache name hasn't been defined before, this method creates a clone of the default cache's configuration,
-    * applies a clone of the configuration overrides passed in and returns this configuration instance.
-    * <p/>
-    * If cache name has been previously defined, this method creates a clone of this cache's existing configuration,
-    * applies a clone of the configuration overrides passed in and returns the configuration instance.
-    * <p/>
-    * The other way to define named cache's configuration is declaratively, in the XML file passed in to the cache
-    * manager.  This method enables you to override certain properties that have previously been defined via XML.
-    * <p/>
-    * Passing a brand new Configuration instance as configuration override without having called any of its setters will
-    * effectively return the named cache's configuration since no overrides where passed to it.
+    * As such, this method is always guaranteed to return the default cache.
+    * <p />
+    * <b>NB:</b> Shared caches are supported (and in fact encouraged) but if they are used it's the users responsibility to
+    * ensure that <i>at least one</i> but <i>only one</i> caller calls stop() on the cache, and it does so with the awareness
+    * that others may be using the cache.
     *
-    * @param cacheName             name of cache whose configuration is being defined
-    * @param configurationOverride configuration overrides to use
-    * @return a cloned configuration instance
+    * @return the default cache.
     */
-   Configuration defineConfiguration(String cacheName, Configuration configurationOverride);
+   <K, V> Cache<K, V> getCache();
 
    /**
-    * Defines a named cache's configuration using the following algorithm:
+    * Retrieves a named cache from the system.  If the cache has been previously created with the same name, the running
+    * cache instance is returned.  Otherwise, this method attempts to create the cache first.
     * <p/>
-    * Regardless of whether the cache name has been defined or not, this method creates a clone of the configuration of
-    * the cache whose name matches the given template cache name, then applies a clone of the configuration overrides
-    * passed in and finally returns this configuration instance.
-    * <p/>
-    * The other way to define named cache's configuration is declaratively, in the XML file passed in to the cache
-    * manager. This method enables you to override certain properties that have previously been defined via XML.
-    * <p/>
-    * Passing a brand new Configuration instance as configuration override without having called any of its setters will
-    * effectively return the named cache's configuration since no overrides where passed to it.
-    * <p/>
-    * If templateName is null or there isn't any named cache with that name, this methods works exactly like {@link
-    * #defineConfiguration(String, Configuration)} in the sense that the base configuration used is the default cache
-    * configuration.
+    * In the case of a {@link org.infinispan.manager.EmbeddedCacheManager}: when creating a new cache, this method will
+    * use the configuration passed in to the EmbeddedCacheManager on construction, as a template, and then optionally
+    * apply any overrides previously defined for the named cache using the {@link EmbeddedCacheManager#defineConfiguration(String, org.infinispan.config.Configuration)}
+    * or {@link EmbeddedCacheManager#defineConfiguration(String, String, org.infinispan.config.Configuration)}
+    * methods, or declared in the configuration file.
+    * <p />
+    * <b>NB:</b> Shared caches are supported (and in fact encouraged) but if they are used it's the users responsibility to
+    * ensure that <i>at least one</i> but <i>only one</i> caller calls stop() on the cache, and it does so with the awareness
+    * that others may be using the cache.
     *
-    * @param cacheName             name of cache whose configuration is being defined
-    * @param templateCacheName          name of cache to which to which apply overrides if cache name has not been previously
-    *                              defined
-    * @param configurationOverride configuration overrides to use
-    * @return a cloned configuration instance
+    * @param cacheName name of cache to retrieve
+    * @return a cache instance identified by cacheName
     */
-   Configuration defineConfiguration(String cacheName, String templateCacheName, Configuration configurationOverride);
-
-   /**
-    * @return the name of the cluster.  Null if running in local mode.
-    */
-   String getClusterName();
-
-   List<Address> getMembers();
-
-   Address getAddress();
-
-   boolean isCoordinator();
-
-   ComponentStatus getStatus();
-
-   /**
-    * Returns global configuration for this CacheManager
-    * 
-    * @return the global configuration object associated to this CacheManager
-    */
-   GlobalConfiguration getGlobalConfiguration();
-   
-    /**
-     * Returns default configuration for this CacheManager
-     * 
-     * @return the default configuration associated with this CacheManager
-     */
-    Configuration getDefaultConfiguration();
-   
-
-   /**
-    * If no named caches are registered, this method returns an empty set.  The default cache is never included in this
-    * set of cache names.
-    *
-    * @return an immutable set of non-default named caches registered with this cache manager.
-    */
-   Set<String> getCacheNames();
+   <K, V> Cache<K, V> getCache(String cacheName);
 }

Modified: trunk/core/src/main/java/org/infinispan/manager/DefaultCacheManager.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/manager/DefaultCacheManager.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/main/java/org/infinispan/manager/DefaultCacheManager.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -105,7 +105,7 @@
 @Scope(Scopes.GLOBAL)
 @SurvivesRestarts
 @MBean(objectName = DefaultCacheManager.OBJECT_NAME, description = "Component that acts as a manager, factory and container for caches in the system.")
-public class DefaultCacheManager implements CacheManager {
+public class DefaultCacheManager implements EmbeddedCacheManager {
    public static final String DEFAULT_CACHE_NAME = "___defaultcache";
    public static final String OBJECT_NAME = "CacheManager";
    private static final Log log = LogFactory.getLog(DefaultCacheManager.class);

Added: trunk/core/src/main/java/org/infinispan/manager/EmbeddedCacheManager.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/manager/EmbeddedCacheManager.java	                        (rev 0)
+++ trunk/core/src/main/java/org/infinispan/manager/EmbeddedCacheManager.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -0,0 +1,122 @@
+package org.infinispan.manager;
+
+import org.infinispan.config.Configuration;
+import org.infinispan.config.GlobalConfiguration;
+import org.infinispan.factories.annotations.SurvivesRestarts;
+import org.infinispan.factories.scopes.Scope;
+import org.infinispan.factories.scopes.Scopes;
+import org.infinispan.lifecycle.ComponentStatus;
+import org.infinispan.notifications.Listenable;
+import org.infinispan.remoting.transport.Address;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * EmbeddedCacheManager is an CacheManager that runs in the same JVM as the client.
+ * <p/>
+ * Constructing a <tt>EmbeddedCacheManager</tt> is done via one of its constructors, which optionally take in a {@link
+ * org.infinispan.config.Configuration} or a path or URL to a configuration XML file: see {@link org.infinispan.manager.DefaultCacheManager}.
+ * <p/>
+ * Lifecycle - <tt>EmbeddedCacheManager</tt>s have a lifecycle (it implements {@link org.infinispan.lifecycle.Lifecycle}) and
+ * the default constructors also call {@link #start()}.  Overloaded versions of the constructors are available, that do
+ * not start the <tt>CacheManager</tt>, although it must be kept in mind that <tt>CacheManager</tt>s need to be started
+ * before they can be used to create <tt>Cache</tt> instances.
+ * <p/>
+ * Once constructed, <tt>EmbeddedCacheManager</tt>s should be made available to any component that requires a <tt>Cache</tt>,
+ * via <a href="http://en.wikipedia.org/wiki/Java_Naming_and_Directory_Interface">JNDI</a> or via some other mechanism
+ * such as an <a href="http://en.wikipedia.org/wiki/Dependency_injection">dependency injection</a> framework.
+ * <p/>
+ *
+ * @see org.infinispan.manager.DefaultCacheManager
+ * @author Manik Surtani (<a href="mailto:manik at jboss.org">manik at jboss.org</a>)
+ * @author Galder Zamarreno
+ * @author Mircea.Markus at jboss.com
+ * @since 4.1
+ */
+ at Scope(Scopes.GLOBAL)
+ at SurvivesRestarts
+public interface EmbeddedCacheManager extends CacheManager, Listenable {
+
+   /**
+    * Defines a named cache's configuration using the following algorithm:
+    * <p/>
+    * If cache name hasn't been defined before, this method creates a clone of the default cache's configuration,
+    * applies a clone of the configuration overrides passed in and returns this configuration instance.
+    * <p/>
+    * If cache name has been previously defined, this method creates a clone of this cache's existing configuration,
+    * applies a clone of the configuration overrides passed in and returns the configuration instance.
+    * <p/>
+    * The other way to define named cache's configuration is declaratively, in the XML file passed in to the cache
+    * manager.  This method enables you to override certain properties that have previously been defined via XML.
+    * <p/>
+    * Passing a brand new Configuration instance as configuration override without having called any of its setters will
+    * effectively return the named cache's configuration since no overrides where passed to it.
+    *
+    * @param cacheName             name of cache whose configuration is being defined
+    * @param configurationOverride configuration overrides to use
+    * @return a cloned configuration instance
+    */
+   Configuration defineConfiguration(String cacheName, Configuration configurationOverride);
+
+   /**
+    * Defines a named cache's configuration using the following algorithm:
+    * <p/>
+    * Regardless of whether the cache name has been defined or not, this method creates a clone of the configuration of
+    * the cache whose name matches the given template cache name, then applies a clone of the configuration overrides
+    * passed in and finally returns this configuration instance.
+    * <p/>
+    * The other way to define named cache's configuration is declaratively, in the XML file passed in to the cache
+    * manager. This method enables you to override certain properties that have previously been defined via XML.
+    * <p/>
+    * Passing a brand new Configuration instance as configuration override without having called any of its setters will
+    * effectively return the named cache's configuration since no overrides where passed to it.
+    * <p/>
+    * If templateName is null or there isn't any named cache with that name, this methods works exactly like {@link
+    * #defineConfiguration(String, Configuration)} in the sense that the base configuration used is the default cache
+    * configuration.
+    *
+    * @param cacheName             name of cache whose configuration is being defined
+    * @param templateCacheName     name of cache to which to which apply overrides if cache name has not been previously
+    *                              defined
+    * @param configurationOverride configuration overrides to use
+    * @return a cloned configuration instance
+    */
+   Configuration defineConfiguration(String cacheName, String templateCacheName, Configuration configurationOverride);
+
+   /**
+    * @return the name of the cluster.  Null if running in local mode.
+    */
+   String getClusterName();
+
+   List<Address> getMembers();
+
+   Address getAddress();
+
+   boolean isCoordinator();
+
+   ComponentStatus getStatus();
+
+   /**
+    * Returns global configuration for this CacheManager
+    *
+    * @return the global configuration object associated to this CacheManager
+    */
+   GlobalConfiguration getGlobalConfiguration();
+
+   /**
+    * Returns default configuration for this CacheManager
+    *
+    * @return the default configuration associated with this CacheManager
+    */
+   Configuration getDefaultConfiguration();
+
+
+   /**
+    * If no named caches are registered, this method returns an empty set.  The default cache is never included in this
+    * set of cache names.
+    *
+    * @return an immutable set of non-default named caches registered with this cache manager.
+    */
+   Set<String> getCacheNames();
+}

Modified: trunk/core/src/main/java/org/infinispan/notifications/cachemanagerlistener/CacheManagerNotifierImpl.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/notifications/cachemanagerlistener/CacheManagerNotifierImpl.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/main/java/org/infinispan/notifications/cachemanagerlistener/CacheManagerNotifierImpl.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -2,7 +2,7 @@
 
 import org.infinispan.factories.annotations.Inject;
 import org.infinispan.factories.annotations.Stop;
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.notifications.AbstractListenerImpl;
 import org.infinispan.notifications.cachemanagerlistener.annotation.CacheStarted;
 import org.infinispan.notifications.cachemanagerlistener.annotation.CacheStopped;
@@ -44,7 +44,7 @@
    final List<ListenerInvocation> cacheStoppedListeners = new CopyOnWriteArrayList<ListenerInvocation>();
    final List<ListenerInvocation> viewChangedListeners = new CopyOnWriteArrayList<ListenerInvocation>();
 
-   private CacheManager cacheManager;
+   private EmbeddedCacheManager cacheManager;
 
    public CacheManagerNotifierImpl() {
       listenersMap.put(CacheStarted.class, cacheStartedListeners);
@@ -53,7 +53,7 @@
    }
 
    @Inject
-   public void injectCacheManager(CacheManager cacheManager) {
+   public void injectCacheManager(EmbeddedCacheManager cacheManager) {
       this.cacheManager = cacheManager;
    }
 

Modified: trunk/core/src/main/java/org/infinispan/notifications/cachemanagerlistener/event/Event.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/notifications/cachemanagerlistener/event/Event.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/main/java/org/infinispan/notifications/cachemanagerlistener/event/Event.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -1,6 +1,6 @@
 package org.infinispan.notifications.cachemanagerlistener.event;
 
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 
 /**
  * Common characteristics of events that occur on a cache manager
@@ -13,7 +13,7 @@
       CACHE_STARTED, CACHE_STOPPED, VIEW_CHANGED
    }
 
-   CacheManager getCacheManager();
+   EmbeddedCacheManager getCacheManager();
 
    Type getType();
 }

Modified: trunk/core/src/main/java/org/infinispan/notifications/cachemanagerlistener/event/EventImpl.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/notifications/cachemanagerlistener/event/EventImpl.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/main/java/org/infinispan/notifications/cachemanagerlistener/event/EventImpl.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -1,6 +1,7 @@
 package org.infinispan.notifications.cachemanagerlistener.event;
 
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.remoting.transport.Address;
 
 import java.util.List;
@@ -14,7 +15,7 @@
 public class EventImpl implements CacheStartedEvent, CacheStoppedEvent, ViewChangedEvent {
 
    String cacheName;
-   CacheManager cacheManager;
+   EmbeddedCacheManager cacheManager;
    Type type;
    List<Address> newMembers, oldMembers;
    Address localAddress;
@@ -24,7 +25,7 @@
    public EventImpl() {
    }
 
-   public EventImpl(String cacheName, CacheManager cacheManager, Type type, List<Address> newMemberList, List<Address> oldMemberList, Address localAddress, int viewId) {
+   public EventImpl(String cacheName, EmbeddedCacheManager cacheManager, Type type, List<Address> newMemberList, List<Address> oldMemberList, Address localAddress, int viewId) {
       this.cacheName = cacheName;
       this.cacheManager = cacheManager;
       this.type = type;
@@ -42,11 +43,11 @@
       this.cacheName = cacheName;
    }
 
-   public CacheManager getCacheManager() {
+   public EmbeddedCacheManager getCacheManager() {
       return cacheManager;
    }
 
-   public void setCacheManager(CacheManager cacheManager) {
+   public void setCacheManager(EmbeddedCacheManager cacheManager) {
       this.cacheManager = cacheManager;
    }
 

Modified: trunk/core/src/main/java/org/infinispan/transaction/xa/TransactionTable.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/transaction/xa/TransactionTable.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/main/java/org/infinispan/transaction/xa/TransactionTable.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -12,6 +12,7 @@
 import org.infinispan.factories.annotations.Stop;
 import org.infinispan.interceptors.InterceptorChain;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.notifications.Listener;
 import org.infinispan.notifications.cachelistener.CacheNotifier;
 import org.infinispan.notifications.cachemanagerlistener.annotation.ViewChanged;
@@ -44,9 +45,9 @@
    private static Log log = LogFactory.getLog(TransactionTable.class);
    private static boolean trace = log.isTraceEnabled();
 
-   private Map<Transaction, TransactionXaAdapter> localTransactions = new HashMap<Transaction, TransactionXaAdapter>();
+   private final Map<Transaction, TransactionXaAdapter> localTransactions = new HashMap<Transaction, TransactionXaAdapter>();
 
-   private Map<GlobalTransaction, RemoteTransaction> remoteTransactions = new HashMap<GlobalTransaction, RemoteTransaction>();
+   private final Map<GlobalTransaction, RemoteTransaction> remoteTransactions = new HashMap<GlobalTransaction, RemoteTransaction>();
 
    private CommandsFactory commandsFactory;
    private Configuration configuration;
@@ -56,12 +57,12 @@
    private RpcManager rpcManager;
    private GlobalTransactionFactory gtf;
    private ExecutorService lockBreakingService = Executors.newFixedThreadPool(1);
-   private CacheManager cm;
+   private EmbeddedCacheManager cm;
 
    @Inject
    public void initialize(CommandsFactory commandsFactory, RpcManager rpcManager, Configuration configuration,
                           InvocationContextContainer icc, InterceptorChain invoker, CacheNotifier notifier,
-                          GlobalTransactionFactory gtf, CacheManager cm) {
+                          GlobalTransactionFactory gtf, EmbeddedCacheManager cm) {
       this.commandsFactory = commandsFactory;
       this.rpcManager = rpcManager;
       this.configuration = configuration;

Modified: trunk/core/src/test/java/org/infinispan/api/AsyncAPITest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/api/AsyncAPITest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/api/AsyncAPITest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -6,6 +6,7 @@
 
 import org.infinispan.Cache;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
 import org.testng.annotations.Test;
@@ -14,8 +15,8 @@
 public class AsyncAPITest extends SingleCacheManagerTest {
    Cache<String, String> c;
 
-   protected CacheManager createCacheManager() throws Exception {
-      CacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
       c = cm.getCache();
       return cm;
    }

Modified: trunk/core/src/test/java/org/infinispan/api/CacheAPITest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/api/CacheAPITest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/api/CacheAPITest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -4,6 +4,7 @@
 import org.infinispan.config.ConfigurationException;
 import org.infinispan.lifecycle.ComponentStatus;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -27,12 +28,12 @@
 @Test(groups = "functional")
 public abstract class CacheAPITest extends SingleCacheManagerTest {  
 
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       // start a single cache instance
       Configuration c = getDefaultStandaloneConfig(true);
       c.setIsolationLevel(getIsolationLevel());
       c = addEviction(c);
-      CacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
       cm.defineConfiguration("test", c);
       cache = cm.getCache("test");
       return cm;
@@ -66,7 +67,7 @@
    }
 
    public void testGetMembersInLocalMode() {
-      assert cache.getCacheManager().getAddress() == null : "Cache members should be null if running in LOCAL mode";
+      assert manager(cache).getAddress() == null : "Cache members should be null if running in LOCAL mode";
    }
 
    public void testConvenienceMethods() {

Modified: trunk/core/src/test/java/org/infinispan/api/CacheClusterJoinTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/api/CacheClusterJoinTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/api/CacheClusterJoinTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -4,6 +4,7 @@
 import org.infinispan.config.Configuration;
 import org.infinispan.config.Configuration.CacheMode;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.MultipleCacheManagersTest;
 import org.infinispan.test.TestingUtil;
 import org.testng.annotations.Test;
@@ -13,7 +14,7 @@
 @Test(groups = "functional", testName = "api.CacheClusterJoinTest")
 public class CacheClusterJoinTest extends MultipleCacheManagersTest {
    Cache cache1, cache2;
-   CacheManager cm1, cm2;
+   EmbeddedCacheManager cm1, cm2;
    Configuration cfg;
 
    public CacheClusterJoinTest() {

Modified: trunk/core/src/test/java/org/infinispan/api/ForceWriteLockTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/api/ForceWriteLockTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/api/ForceWriteLockTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -6,6 +6,7 @@
 import org.infinispan.context.Flag;
 import org.infinispan.context.InvocationContext;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -21,8 +22,8 @@
    private TransactionManager tm;
    private AdvancedCache advancedCache;
 
-   protected CacheManager createCacheManager() throws Exception {
-      CacheManager cacheManager = TestCacheManagerFactory.createLocalCacheManager(true);
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
+      EmbeddedCacheManager cacheManager = TestCacheManagerFactory.createLocalCacheManager(true);
       advancedCache = cacheManager.getCache().getAdvancedCache();
       tm = TestingUtil.getTransactionManager(advancedCache);
       return cacheManager;

Modified: trunk/core/src/test/java/org/infinispan/api/batch/BatchWithTMTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/api/batch/BatchWithTMTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/api/batch/BatchWithTMTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -3,6 +3,7 @@
 import org.infinispan.Cache;
 import org.infinispan.config.Configuration;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
 import org.infinispan.test.fwk.TransactionSetup;
@@ -16,7 +17,7 @@
 @Test(groups = {"functional", "transaction"}, testName = "api.batch.BatchWithTMTest")
 public class BatchWithTMTest extends AbstractBatchTest {
 
-   CacheManager cm;
+   EmbeddedCacheManager cm;
 
    @BeforeClass
    public void createCacheManager() {

Modified: trunk/core/src/test/java/org/infinispan/api/batch/BatchWithoutTMTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/api/batch/BatchWithoutTMTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/api/batch/BatchWithoutTMTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -1,6 +1,7 @@
 package org.infinispan.api.batch;
 
 import org.infinispan.Cache;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
 import org.infinispan.config.Configuration;
 import org.infinispan.config.ConfigurationException;
@@ -13,7 +14,7 @@
 @Test(groups = "functional", testName = "api.batch.BatchWithoutTMTest")
 public class BatchWithoutTMTest extends AbstractBatchTest {
 
-   CacheManager cm;
+   EmbeddedCacheManager cm;
 
    @BeforeClass
    public void createCacheManager() {

Modified: trunk/core/src/test/java/org/infinispan/api/mvcc/LockPerEntryTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/api/mvcc/LockPerEntryTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/api/mvcc/LockPerEntryTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -2,7 +2,7 @@
 
 import org.infinispan.config.Configuration;
 import org.infinispan.context.InvocationContextContainer;
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -17,7 +17,7 @@
 @Test(groups = "functional", sequential = true, testName = "api.mvcc.LockPerEntryTest")
 public class LockPerEntryTest extends SingleCacheManagerTest {   
 
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       Configuration cfg = new Configuration();
       cfg.setUseLockStriping(false);
       return TestCacheManagerFactory.createCacheManager(cfg);

Modified: trunk/core/src/test/java/org/infinispan/api/mvcc/repeatable_read/WriteSkewTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/api/mvcc/repeatable_read/WriteSkewTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/api/mvcc/repeatable_read/WriteSkewTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -6,6 +6,7 @@
 import org.infinispan.config.Configuration;
 import org.infinispan.context.InvocationContextContainer;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.AbstractInfinispanTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -39,7 +40,7 @@
    protected TransactionManager tm;
    protected LockManager lockManager;
    protected InvocationContextContainer icc;
-   protected CacheManager cacheManager;
+   protected EmbeddedCacheManager cacheManager;
    protected Cache cache;
 
    @BeforeTest

Modified: trunk/core/src/test/java/org/infinispan/config/ConfigurationCloneTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/config/ConfigurationCloneTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/config/ConfigurationCloneTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -23,7 +23,7 @@
 
 import java.lang.reflect.Method;
 
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
 import org.testng.annotations.Test;
@@ -32,7 +32,7 @@
 public class ConfigurationCloneTest extends SingleCacheManagerTest {
 
    @Override
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       return TestCacheManagerFactory.createLocalCacheManager();
    }
 

Modified: trunk/core/src/test/java/org/infinispan/config/ConfigurationValidation2Test.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/config/ConfigurationValidation2Test.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/config/ConfigurationValidation2Test.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -21,7 +21,7 @@
  */
 package org.infinispan.config;
 
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
 import org.testng.annotations.Test;
@@ -48,11 +48,11 @@
 
 
    @Override
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       GlobalConfiguration gc = GlobalConfiguration.getClusteredDefault();
       Configuration config = new Configuration();
       config.setCacheMode(REPL_ASYNC);
-      CacheManager cm = TestCacheManagerFactory.createCacheManager(gc, config);
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(gc, config);
       config = new Configuration();
       config.setCacheMode(LOCAL);
       cm.defineConfiguration("local", config);

Modified: trunk/core/src/test/java/org/infinispan/config/ConfigurationValidationTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/config/ConfigurationValidationTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/config/ConfigurationValidationTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -21,8 +21,7 @@
  */
 package org.infinispan.config;
 
-import org.infinispan.manager.CacheManager;
-import org.infinispan.manager.DefaultCacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
 import org.testng.annotations.Test;
@@ -50,11 +49,11 @@
 
 
    @Override
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       GlobalConfiguration gc = GlobalConfiguration.getNonClusteredDefault();
       Configuration config = new Configuration();
       config.setCacheMode(REPL_ASYNC);
-      CacheManager cm = TestCacheManagerFactory.createCacheManager(gc, config);
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(gc, config);
       config = new Configuration();
       config.setCacheMode(LOCAL);
       cm.defineConfiguration("local", config);

Modified: trunk/core/src/test/java/org/infinispan/config/ProgrammaticConfigurationTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/config/ProgrammaticConfigurationTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/config/ProgrammaticConfigurationTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -1,6 +1,7 @@
 package org.infinispan.config;
 
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.AbstractInfinispanTest;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
 import org.testng.annotations.Test;
@@ -15,7 +16,7 @@
 public class ProgrammaticConfigurationTest extends AbstractInfinispanTest {
 
    public void testDefiningConfigurationOverridingConsistentHashClass() {
-      CacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
       Configuration c = new Configuration();
       c.setConsistentHashClass("org.infinispan.distribution.DefaultConsistentHash");
       Configuration oneCacheConfiguration = cm.defineConfiguration("oneCache", c);

Modified: trunk/core/src/test/java/org/infinispan/config/SampleConfigFilesCorrectnessTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/config/SampleConfigFilesCorrectnessTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/config/SampleConfigFilesCorrectnessTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -5,6 +5,7 @@
 import org.apache.log4j.Logger;
 import org.apache.log4j.spi.LoggingEvent;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
 import org.testng.annotations.AfterMethod;
@@ -48,7 +49,7 @@
    public void testConfigWarnings() throws Exception {
       for (String aConfFile : getConfigFileNames()) {
          System.out.println("Analysing " + aConfFile);
-         CacheManager dcm = TestCacheManagerFactory.fromXml(getRootFolder() + "/" + aConfFile, true);
+         EmbeddedCacheManager dcm = TestCacheManagerFactory.fromXml(getRootFolder() + "/" + aConfFile, true);
          try {
             dcm.getCache();
             assert !appender.isFoundUnknownWarning();

Modified: trunk/core/src/test/java/org/infinispan/config/StringPropertyReplacementTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/config/StringPropertyReplacementTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/config/StringPropertyReplacementTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -1,6 +1,6 @@
 package org.infinispan.config;
 
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
 import org.infinispan.util.concurrent.IsolationLevel;
@@ -19,7 +19,7 @@
 public class StringPropertyReplacementTest extends SingleCacheManagerTest {
 
 
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       System.setProperty("test.property.asyncListenerMaxThreads","2");
       System.setProperty("test.property.IsolationLevel","READ_COMMITTED");
       System.setProperty("test.property.writeSkewCheck","true");

Modified: trunk/core/src/test/java/org/infinispan/distribution/BaseDistCacheStoreTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/distribution/BaseDistCacheStoreTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/distribution/BaseDistCacheStoreTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -25,6 +25,7 @@
 import org.infinispan.config.Configuration;
 import org.infinispan.loaders.dummy.DummyInMemoryCacheStore;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
 
 /**
@@ -38,13 +39,13 @@
    static int id;
 
    @Override
-   protected CacheManager addClusterEnabledCacheManager() {
+   protected EmbeddedCacheManager addClusterEnabledCacheManager() {
       Configuration cfg = new Configuration();
       CacheLoaderManagerConfig clmc = new CacheLoaderManagerConfig();
       clmc.setShared(shared);
       clmc.addCacheLoaderConfig(new DummyInMemoryCacheStore.Cfg(getClass().getSimpleName() + "_" + id++));
       cfg.setCacheLoaderManagerConfig(clmc);
-      CacheManager cm = TestCacheManagerFactory.createClusteredCacheManager(cfg);
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createClusteredCacheManager(cfg);
       cacheManagers.add(cm);
       return cm;
    }

Modified: trunk/core/src/test/java/org/infinispan/distribution/BaseDistFunctionalTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/distribution/BaseDistFunctionalTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/distribution/BaseDistFunctionalTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -9,6 +9,7 @@
 import org.infinispan.container.entries.InternalCacheEntry;
 import org.infinispan.container.entries.MortalCacheEntry;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.remoting.transport.Address;
 import org.infinispan.test.MultipleCacheManagersTest;
 import org.infinispan.test.TestingUtil;
@@ -66,7 +67,10 @@
       if (INIT_CLUSTER_SIZE > 3) c4 = caches.get(3);
 
       cacheAddresses = new ArrayList<Address>(INIT_CLUSTER_SIZE);
-      for (Cache cache : caches) cacheAddresses.add(cache.getCacheManager().getAddress());
+      for (Cache cache : caches) {
+         EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) cache.getCacheManager();
+         cacheAddresses.add(cacheManager.getAddress());
+      }
 
       RehashWaiter.waitForInitRehashToComplete(caches.toArray(new Cache[INIT_CLUSTER_SIZE]));
 
@@ -119,7 +123,8 @@
       
       for (Address a : ch.getCaches()) {
          for (Cache<Object, String> c : caches) {
-            if (a.equals(c.getCacheManager().getAddress())) {
+            EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) c.getCacheManager();
+            if (a.equals(cacheManager.getAddress())) {
                reordered.add(c);
                break;
             }
@@ -159,7 +164,8 @@
    }
 
    protected static Address addressOf(Cache<?, ?> cache) {
-      return cache.getCacheManager().getAddress();
+      EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) cache.getCacheManager();
+      return cacheManager.getAddress();
    }
 
    protected Cache<Object, String> getFirstNonOwner(String key) {

Modified: trunk/core/src/test/java/org/infinispan/distribution/ConcurrentStartWithReplTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/distribution/ConcurrentStartWithReplTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/distribution/ConcurrentStartWithReplTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -5,6 +5,7 @@
 import org.infinispan.config.GlobalConfiguration;
 import org.infinispan.lifecycle.ComponentStatus;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.AbstractInfinispanTest;
 import org.infinispan.test.MultipleCacheManagersTest;
 import org.infinispan.test.TestingUtil;
@@ -115,8 +116,8 @@
    }
 
    private void doTest(boolean inOrder, boolean nonBlockingStartupForDist) throws ExecutionException, InterruptedException {
-      CacheManager cm1 = TestCacheManagerFactory.createCacheManager(GlobalConfiguration.getClusteredDefault());
-      CacheManager cm2 = TestCacheManagerFactory.createCacheManager(GlobalConfiguration.getClusteredDefault());
+      EmbeddedCacheManager cm1 = TestCacheManagerFactory.createCacheManager(GlobalConfiguration.getClusteredDefault());
+      EmbeddedCacheManager cm2 = TestCacheManagerFactory.createCacheManager(GlobalConfiguration.getClusteredDefault());
       try {
          cm1.defineConfiguration("r", replCfg);
          cm1.defineConfiguration("d", distCfg);

Modified: trunk/core/src/test/java/org/infinispan/distribution/SingleOwnerTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/distribution/SingleOwnerTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/distribution/SingleOwnerTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -26,6 +26,8 @@
 import org.infinispan.Cache;
 import org.infinispan.CacheException;
 import org.infinispan.config.Configuration;
+import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.remoting.transport.Address;
 import org.infinispan.util.concurrent.IsolationLevel;
 import org.testng.annotations.Test;
@@ -65,7 +67,10 @@
       c2 = caches.get(1);
 
       cacheAddresses = new ArrayList<Address>(2);
-      for (Cache cache : caches) cacheAddresses.add(cache.getCacheManager().getAddress());
+      for (Cache cache : caches) {
+         EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) cache.getCacheManager();
+         cacheAddresses.add(cacheManager.getAddress());
+      }
 
       RehashWaiter.waitForInitRehashToComplete(c1, c2);
    }

Modified: trunk/core/src/test/java/org/infinispan/distribution/UnknownCacheStartTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/distribution/UnknownCacheStartTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/distribution/UnknownCacheStartTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -3,6 +3,7 @@
 import org.infinispan.Cache;
 import org.infinispan.config.Configuration;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.AbstractCacheTest;
 import org.infinispan.test.AbstractInfinispanTest;
 import org.infinispan.test.MultipleCacheManagersTest;
@@ -20,7 +21,7 @@
 public class UnknownCacheStartTest extends AbstractInfinispanTest {
 
    Configuration configuration;
-   CacheManager cm1, cm2;
+   EmbeddedCacheManager cm1, cm2;
 
    @BeforeTest
    public void setUp() {

Modified: trunk/core/src/test/java/org/infinispan/distribution/rehash/ConcurrentJoinTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/distribution/rehash/ConcurrentJoinTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/distribution/rehash/ConcurrentJoinTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -2,6 +2,7 @@
 
 import org.infinispan.Cache;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.TestingUtil;
 import org.testng.annotations.Test;
 
@@ -14,7 +15,7 @@
 @Test(groups = "functional", testName = "distribution.rehash.ConcurrentJoinTest")
 public class ConcurrentJoinTest extends RehashTestBase {
 
-   List<CacheManager> joinerManagers;
+   List<EmbeddedCacheManager> joinerManagers;
    List<Cache<Object, String>> joiners;
 
    final int numJoiners = 4;
@@ -23,10 +24,10 @@
       Runnable runnable = new Runnable() {
          public void run() {
 
-            joinerManagers = new ArrayList<CacheManager>(numJoiners);
+            joinerManagers = new ArrayList<EmbeddedCacheManager>(numJoiners);
             joiners = new ArrayList<Cache<Object, String>>(numJoiners);
             for (int i = 0; i < numJoiners; i++) {
-               CacheManager joinerManager = addClusterEnabledCacheManager();
+               EmbeddedCacheManager joinerManager = addClusterEnabledCacheManager();
                joinerManager.defineConfiguration(cacheName, configuration);
                Cache<Object, String> joiner = joinerManager.getCache(cacheName);
                joinerManagers.add(joinerManager);

Modified: trunk/core/src/test/java/org/infinispan/distribution/rehash/L1OnRehashTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/distribution/rehash/L1OnRehashTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/distribution/rehash/L1OnRehashTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -1,6 +1,7 @@
 package org.infinispan.distribution.rehash;
 
 import org.infinispan.Cache;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.distribution.BaseDistFunctionalTest;
 import org.infinispan.manager.CacheManager;
@@ -29,7 +30,7 @@
       cleanup = CleanupPhase.AFTER_METHOD;
    }
 
-   CacheManager joinerManager;
+   EmbeddedCacheManager joinerManager;
    Cache<Object, String> joiner;
 
    void performRehashEvent() {

Modified: trunk/core/src/test/java/org/infinispan/distribution/rehash/RehashAfterPartitionMergeTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/distribution/rehash/RehashAfterPartitionMergeTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/distribution/rehash/RehashAfterPartitionMergeTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -62,11 +62,11 @@
       for (Cache<Object, Object> c: caches) {
          assert "value".equals(c.get("1"));
          assert "value".equals(c.get("2"));
-         assert c.getCacheManager().getMembers().size() == 2;
+         assert manager(c).getMembers().size() == 2;
       }
       AtomicInteger ai = new AtomicInteger(0);
-      c1.getCacheManager().addListener(new ViewChangeListener(ai));
-      c2.getCacheManager().addListener(new ViewChangeListener(ai));
+      manager(c1).addListener(new ViewChangeListener(ai));
+      manager(c2).addListener(new ViewChangeListener(ai));
 
       d1.setDiscardAll(true);
       d2.setDiscardAll(true);
@@ -75,7 +75,7 @@
       while (ai.get() < 2) TestingUtil.sleepThread(500);
 
       // we should see a network partition
-      for (Cache<Object, Object> c: caches) assert c.getCacheManager().getMembers().size() == 1;
+      for (Cache<Object, Object> c: caches) assert manager(c).getMembers().size() == 1;
 
       c1.put("3", "value");
       c2.put("4", "value");
@@ -102,7 +102,7 @@
       for (Cache<Object, Object> c: caches) {
          assert "value".equals(c.get("5"));
          assert "value".equals(c.get("6"));
-         assert c.getCacheManager().getMembers().size() == 2;
+         assert manager(c).getMembers().size() == 2;
       }      
    }
 

Modified: trunk/core/src/test/java/org/infinispan/distribution/rehash/RehashCompletedOnJoinTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/distribution/rehash/RehashCompletedOnJoinTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/distribution/rehash/RehashCompletedOnJoinTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -4,6 +4,7 @@
 import org.infinispan.distribution.BaseDistFunctionalTest;
 import org.infinispan.distribution.DistributionManager;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.testng.annotations.Test;
 
 import java.util.ArrayList;
@@ -34,7 +35,7 @@
       for (Cache<Object, String> c : caches) c.put(keys.get(i++), "v" + i);
       log.info("Initialized with keys {0}", keys);
       
-      CacheManager joinerManager = addClusterEnabledCacheManager();
+      EmbeddedCacheManager joinerManager = addClusterEnabledCacheManager();
       joinerManager.defineConfiguration(cacheName, configuration);
       Cache joiner = joinerManager.getCache(cacheName);
       DistributionManager dmi = joiner.getAdvancedCache().getDistributionManager();

Modified: trunk/core/src/test/java/org/infinispan/distribution/rehash/SingleJoinTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/distribution/rehash/SingleJoinTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/distribution/rehash/SingleJoinTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -2,13 +2,14 @@
 
 import org.infinispan.Cache;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.testng.annotations.Test;
 
 import static java.util.concurrent.TimeUnit.SECONDS;
 
 @Test(groups = "functional", testName = "distribution.rehash.SingleJoinTest")
 public class SingleJoinTest extends RehashTestBase {
-   CacheManager joinerManager;
+   EmbeddedCacheManager joinerManager;
    Cache<Object, String> joiner;
 
    void performRehashEvent(boolean offline) {

Modified: trunk/core/src/test/java/org/infinispan/distribution/rehash/WorkDuringJoinTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/distribution/rehash/WorkDuringJoinTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/distribution/rehash/WorkDuringJoinTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -5,6 +5,7 @@
 import org.infinispan.distribution.ConsistentHash;
 import org.infinispan.distribution.ConsistentHashHelper;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.remoting.transport.Address;
 import org.testng.annotations.Test;
 
@@ -22,7 +23,7 @@
 @Test(groups = "functional", testName = "distribution.rehash.WorkDuringJoinTest", enabled = false)
 public class WorkDuringJoinTest extends BaseDistFunctionalTest {
 
-   CacheManager joinerManager;
+   EmbeddedCacheManager joinerManager;
    Cache<Object, String> joiner;
 
    public WorkDuringJoinTest() {
@@ -46,7 +47,7 @@
       joinerManager = addClusterEnabledCacheManager();
       joinerManager.defineConfiguration(cacheName, configuration);
       joiner = joinerManager.getCache(cacheName);
-      return joiner.getCacheManager().getAddress();
+      return manager(joiner).getAddress();
    }
 
    public void testJoinAndGet() throws ClassNotFoundException, InstantiationException, IllegalAccessException {

Modified: trunk/core/src/test/java/org/infinispan/eviction/BaseEvictionFunctionalTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/eviction/BaseEvictionFunctionalTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/eviction/BaseEvictionFunctionalTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -4,7 +4,7 @@
 import java.util.concurrent.CountDownLatch;
 
 import org.infinispan.config.Configuration;
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
 import org.testng.annotations.Test;
@@ -20,13 +20,13 @@
 
    protected abstract EvictionStrategy getEvictionStrategy();
 
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       Configuration cfg = new Configuration();
       cfg.setEvictionStrategy(getEvictionStrategy());
       cfg.setEvictionWakeUpInterval(100);
       cfg.setEvictionMaxEntries(128); // 128 max entries
       cfg.setUseLockStriping(false); // to minimize chances of deadlock in the unit test
-      CacheManager cm = TestCacheManagerFactory.createCacheManager(cfg);
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(cfg);
       cache = cm.getCache();
       return cm;
    }

Modified: trunk/core/src/test/java/org/infinispan/eviction/MarshalledValuesEvictionTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/eviction/MarshalledValuesEvictionTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/eviction/MarshalledValuesEvictionTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -29,6 +29,7 @@
 import org.infinispan.context.InvocationContext;
 import org.infinispan.interceptors.MarshalledValueInterceptor;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.marshall.MarshalledValue;
 import org.infinispan.marshall.MarshalledValueTest;
 import org.infinispan.marshall.Marshaller;
@@ -45,14 +46,14 @@
 
 
    @Override
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       Configuration cfg = new Configuration();
       cfg.setEvictionStrategy(EvictionStrategy.FIFO);
       cfg.setEvictionWakeUpInterval(100);
       cfg.setEvictionMaxEntries(CACHE_SIZE); // CACHE_SIZE max entries
       cfg.setUseLockStriping(false); // to minimise chances of deadlock in the unit test
       cfg.setUseLazyDeserialization(true);
-      CacheManager cm = TestCacheManagerFactory.createCacheManager(cfg);
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(cfg);
       cache = cm.getCache();
       Marshaller marshaller = TestingUtil.extractComponent(cache, Marshaller.class);
       MockMarshalledValueInterceptor interceptor = new MockMarshalledValueInterceptor(marshaller);

Modified: trunk/core/src/test/java/org/infinispan/eviction/MarshalledValuesManualEvictionTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/eviction/MarshalledValuesManualEvictionTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/eviction/MarshalledValuesManualEvictionTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -26,6 +26,7 @@
 import org.infinispan.eviction.MarshalledValuesEvictionTest.MockMarshalledValueInterceptor;
 import org.infinispan.interceptors.MarshalledValueInterceptor;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.marshall.MarshalledValueTest;
 import org.infinispan.marshall.Marshaller;
 import org.infinispan.test.SingleCacheManagerTest;
@@ -37,11 +38,11 @@
 public class MarshalledValuesManualEvictionTest extends SingleCacheManagerTest {
 
    @Override
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       Configuration cfg = new Configuration();
       cfg.setUseLockStriping(false); // to minimise chances of deadlock in the unit test
       cfg.setUseLazyDeserialization(true);
-      CacheManager cm = TestCacheManagerFactory.createCacheManager(cfg);
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(cfg);
       cache = cm.getCache();
       Marshaller marshaller = TestingUtil.extractComponent(cache, Marshaller.class);
       MockMarshalledValueInterceptor interceptor = new MockMarshalledValueInterceptor(marshaller);

Modified: trunk/core/src/test/java/org/infinispan/interceptors/MarshalledValueInterceptorTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/interceptors/MarshalledValueInterceptorTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/interceptors/MarshalledValueInterceptorTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -1,6 +1,7 @@
 package org.infinispan.interceptors;
 
 import org.infinispan.Cache;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
 import org.infinispan.config.Configuration;
 import org.infinispan.manager.CacheManager;
@@ -23,7 +24,7 @@
  */
 @Test(groups = "functional", testName = "interceptors.MarshalledValueInterceptorTest")
 public class MarshalledValueInterceptorTest extends AbstractInfinispanTest {
-   CacheManager cm;
+   EmbeddedCacheManager cm;
 
    @BeforeTest
    public void setUp() {

Modified: trunk/core/src/test/java/org/infinispan/jmx/ActivationAndPassivationInterceptorMBeanTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/jmx/ActivationAndPassivationInterceptorMBeanTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/jmx/ActivationAndPassivationInterceptorMBeanTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -8,7 +8,7 @@
 import org.infinispan.loaders.CacheLoaderManager;
 import org.infinispan.loaders.CacheStore;
 import org.infinispan.loaders.dummy.DummyInMemoryCacheStore;
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -35,7 +35,7 @@
    CacheStore cacheStore;
    private static final String JMX_DOMAIN = ActivationAndPassivationInterceptorMBeanTest.class.getName();
 
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       GlobalConfiguration globalConfiguration = GlobalConfiguration.getNonClusteredDefault();
       globalConfiguration.setMBeanServerLookup(PerThreadMBeanServerLookup.class.getName());
       globalConfiguration.setJmxDomain(JMX_DOMAIN);

Modified: trunk/core/src/test/java/org/infinispan/jmx/CacheLoaderAndCacheStoreInterceptorMBeanTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/jmx/CacheLoaderAndCacheStoreInterceptorMBeanTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/jmx/CacheLoaderAndCacheStoreInterceptorMBeanTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -7,7 +7,7 @@
 import org.infinispan.loaders.CacheLoaderManager;
 import org.infinispan.loaders.CacheStore;
 import org.infinispan.loaders.dummy.DummyInMemoryCacheStore;
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -30,7 +30,7 @@
    private CacheStore cacheStore;
    private static final String JMX_DOMAIN = CacheLoaderAndCacheStoreInterceptorMBeanTest.class.getName();
 
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       GlobalConfiguration globalConfiguration = GlobalConfiguration.getNonClusteredDefault();
       globalConfiguration.setMBeanServerLookup(PerThreadMBeanServerLookup.class.getName());
       globalConfiguration.setJmxDomain(JMX_DOMAIN);

Modified: trunk/core/src/test/java/org/infinispan/jmx/CacheMBeanTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/jmx/CacheMBeanTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/jmx/CacheMBeanTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -32,6 +32,7 @@
 import org.infinispan.lifecycle.ComponentStatus;
 import org.infinispan.manager.CacheManager;
 import org.infinispan.manager.DefaultCacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
 import org.infinispan.util.logging.Log;
@@ -45,7 +46,7 @@
    private MBeanServer server;
 
    @Override
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       cacheManager = TestCacheManagerFactory.createCacheManagerEnforceJmxDomain(JMX_DOMAIN);
       server = PerThreadMBeanServerLookup.getThreadMBeanServer();
       return cacheManager;

Modified: trunk/core/src/test/java/org/infinispan/jmx/CacheManagerMBeanTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/jmx/CacheManagerMBeanTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/jmx/CacheManagerMBeanTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -4,6 +4,7 @@
 
 import org.infinispan.config.Configuration;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
 import org.testng.annotations.Test;
@@ -28,7 +29,7 @@
    private MBeanServer server;
    private ObjectName name;
 
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       cacheManager = TestCacheManagerFactory.createCacheManagerEnforceJmxDomain(JMX_DOMAIN, true, false);
       name = new ObjectName(JMX_DOMAIN + ":cache-name=[global],jmx-resource=CacheManager");
       server = PerThreadMBeanServerLookup.getThreadMBeanServer();

Modified: trunk/core/src/test/java/org/infinispan/jmx/CacheMgmtInterceptorMBeanTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/jmx/CacheMgmtInterceptorMBeanTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/jmx/CacheMgmtInterceptorMBeanTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -3,7 +3,7 @@
 import org.infinispan.AdvancedCache;
 import org.infinispan.config.Configuration;
 import org.infinispan.config.GlobalConfiguration;
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
 import org.testng.annotations.AfterMethod;
@@ -26,7 +26,7 @@
    AdvancedCache advanced;
    private static final String JMX_DOMAIN = CacheMgmtInterceptorMBeanTest.class.getName();
 
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       GlobalConfiguration globalConfiguration = GlobalConfiguration.getNonClusteredDefault();
       globalConfiguration.setExposeGlobalJmxStatistics(true);
       globalConfiguration.setMBeanServerLookup(PerThreadMBeanServerLookup.class.getName());

Modified: trunk/core/src/test/java/org/infinispan/jmx/ComponentsJmxRegistrationTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/jmx/ComponentsJmxRegistrationTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/jmx/ComponentsJmxRegistrationTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -6,6 +6,7 @@
 import org.infinispan.config.GlobalConfiguration;
 import org.infinispan.factories.AbstractComponentRegistry;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.AbstractInfinispanTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -49,7 +50,7 @@
    }
 
    public void testRegisterLocalCache() throws Exception {
-      CacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
       cacheManagers.add(cm);
       cm.start();
       Configuration configuration = config();
@@ -76,7 +77,7 @@
    public void testRegisterReplicatedCache() throws Exception {
       GlobalConfiguration globalConfiguration = GlobalConfiguration.getClusteredDefault();
       globalConfiguration.setAllowDuplicateDomains(true);
-      CacheManager cm = TestCacheManagerFactory.createCacheManager(globalConfiguration);
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(globalConfiguration);
       cacheManagers.add(cm);
       cm.start();
       Configuration configurationOverride = config();
@@ -97,7 +98,7 @@
    public void testLocalAndReplicatedCache() throws Exception {
       GlobalConfiguration globalConfiguration = GlobalConfiguration.getClusteredDefault();
       globalConfiguration.setAllowDuplicateDomains(true);
-      CacheManager cm = TestCacheManagerFactory.createCacheManager(globalConfiguration);
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(globalConfiguration);
       cacheManagers.add(cm);
       cm.start();
       Configuration replicated = config();

Modified: trunk/core/src/test/java/org/infinispan/jmx/JmxStatsFunctionalTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/jmx/JmxStatsFunctionalTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/jmx/JmxStatsFunctionalTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -3,6 +3,7 @@
 import org.infinispan.config.Configuration;
 import org.infinispan.config.GlobalConfiguration;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.AbstractInfinispanTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -29,7 +30,7 @@
 
    public static final String JMX_DOMAIN = JmxStatsFunctionalTest.class.getSimpleName();
    private MBeanServer server;
-   private CacheManager cm, cm2, cm3;
+   private EmbeddedCacheManager cm, cm2, cm3;
 
 
    @AfterMethod(alwaysRun = true)

Modified: trunk/core/src/test/java/org/infinispan/jmx/MvccLockManagerMBeanTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/jmx/MvccLockManagerMBeanTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/jmx/MvccLockManagerMBeanTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -2,7 +2,7 @@
 
 import org.infinispan.config.Configuration;
 import org.infinispan.config.GlobalConfiguration;
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -25,7 +25,7 @@
    private MBeanServer threadMBeanServer;
    private static final String JMX_DOMAIN = "MvccLockManagerMBeanTest";
 
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       GlobalConfiguration globalConfiguration = GlobalConfiguration.getNonClusteredDefault();
       globalConfiguration.setExposeGlobalJmxStatistics(true);
       globalConfiguration.setMBeanServerLookup(PerThreadMBeanServerLookup.class.getName());

Modified: trunk/core/src/test/java/org/infinispan/jmx/TxInterceptorMBeanTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/jmx/TxInterceptorMBeanTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/jmx/TxInterceptorMBeanTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -4,6 +4,7 @@
 import org.infinispan.config.Configuration;
 import org.infinispan.config.GlobalConfiguration;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.MultipleCacheManagersTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -29,9 +30,9 @@
       globalConfiguration.setAllowDuplicateDomains(true);
       globalConfiguration.setMBeanServerLookup(PerThreadMBeanServerLookup.class.getName());
       globalConfiguration.setJmxDomain("TxInterceptorMBeanTest");
-      CacheManager cacheManager1 = TestCacheManagerFactory.createCacheManagerEnforceJmxDomain(globalConfiguration);
+      EmbeddedCacheManager cacheManager1 = TestCacheManagerFactory.createCacheManagerEnforceJmxDomain(globalConfiguration);
       registerCacheManager(cacheManager1);
-      CacheManager cacheManager2 = TestCacheManagerFactory.createCacheManagerEnforceJmxDomain(globalConfiguration.clone());
+      EmbeddedCacheManager cacheManager2 = TestCacheManagerFactory.createCacheManagerEnforceJmxDomain(globalConfiguration.clone());
       registerCacheManager(cacheManager2);
 
       Configuration configuration = getDefaultClusteredConfig(Configuration.CacheMode.REPL_SYNC, true);

Modified: trunk/core/src/test/java/org/infinispan/jndi/BindingTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/jndi/BindingTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/jndi/BindingTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -36,6 +36,7 @@
 import org.infinispan.config.Configuration;
 import org.infinispan.config.GlobalConfiguration;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
 import org.jboss.util.naming.NonSerializableFactory;
@@ -72,7 +73,7 @@
    }
 
    @Override
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       GlobalConfiguration globalConfiguration = GlobalConfiguration.getNonClusteredDefault();
       Configuration configuration = new Configuration();
       cacheManager = TestCacheManagerFactory.createCacheManager(globalConfiguration, configuration);
@@ -86,7 +87,7 @@
       try {
          Context ctx2 = new InitialContext(props);
          try {
-            CacheManager cacheManager2 = (CacheManager) ctx2.lookup(jndiName);
+            EmbeddedCacheManager cacheManager2 = (EmbeddedCacheManager) ctx2.lookup(jndiName);
             assert cacheManager.getStatus() == cacheManager2.getStatus();
          } finally {
             ctx2.close();

Modified: trunk/core/src/test/java/org/infinispan/loaders/BaseCacheStoreFunctionalTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/loaders/BaseCacheStoreFunctionalTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/loaders/BaseCacheStoreFunctionalTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -30,6 +30,7 @@
 import org.infinispan.container.DataContainer;
 import org.infinispan.container.entries.InternalCacheEntry;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.AbstractInfinispanTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -67,7 +68,7 @@
    }
 
    public void testTwoCachesSameCacheStore() {
-      CacheManager localCacheManager = TestCacheManagerFactory.createLocalCacheManager();
+      EmbeddedCacheManager localCacheManager = TestCacheManagerFactory.createLocalCacheManager();
       try {
          GlobalConfiguration configuration = localCacheManager.getGlobalConfiguration();
          CacheLoaderManagerConfig clmConfig = new CacheLoaderManagerConfig();

Modified: trunk/core/src/test/java/org/infinispan/loaders/CacheLoaderFunctionalTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/loaders/CacheLoaderFunctionalTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/loaders/CacheLoaderFunctionalTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -10,6 +10,7 @@
 import org.infinispan.lifecycle.ComponentStatus;
 import org.infinispan.loaders.dummy.DummyInMemoryCacheStore;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.AbstractInfinispanTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -35,7 +36,7 @@
    CacheStore store;
    TransactionManager tm;
    Configuration cfg;
-   CacheManager cm;
+   EmbeddedCacheManager cm;
    long lifespan = 6000000; // very large lifespan so nothing actually expires
 
    @BeforeTest

Modified: trunk/core/src/test/java/org/infinispan/loaders/ClusterCacheLoaderTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/loaders/ClusterCacheLoaderTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/loaders/ClusterCacheLoaderTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -8,6 +8,7 @@
 import org.infinispan.loaders.decorators.ChainingCacheStore;
 import org.infinispan.loaders.dummy.DummyInMemoryCacheStore;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.MultipleCacheManagersTest;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
 import org.testng.annotations.Test;
@@ -21,8 +22,8 @@
 public class ClusterCacheLoaderTest extends MultipleCacheManagersTest {
 
    protected void createCacheManagers() throws Throwable {
-      CacheManager cacheManager1 = TestCacheManagerFactory.createClusteredCacheManager();
-      CacheManager cacheManager2 = TestCacheManagerFactory.createClusteredCacheManager();
+      EmbeddedCacheManager cacheManager1 = TestCacheManagerFactory.createClusteredCacheManager();
+      EmbeddedCacheManager cacheManager2 = TestCacheManagerFactory.createClusteredCacheManager();
       registerCacheManager(cacheManager1, cacheManager2);
 
       Configuration config1 = getDefaultClusteredConfig(Configuration.CacheMode.INVALIDATION_SYNC);

Modified: trunk/core/src/test/java/org/infinispan/loaders/ConcurrentLoadAndEvictTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/loaders/ConcurrentLoadAndEvictTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/loaders/ConcurrentLoadAndEvictTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -12,7 +12,7 @@
 import org.infinispan.interceptors.CacheLoaderInterceptor;
 import org.infinispan.interceptors.base.CommandInterceptor;
 import org.infinispan.loaders.dummy.DummyInMemoryCacheStore;
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -38,7 +38,7 @@
 public class ConcurrentLoadAndEvictTest extends SingleCacheManagerTest {
    SlowDownInterceptor sdi;
 
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       Configuration config = new Configuration();
       // we need a loader:
       CacheLoaderManagerConfig clmc = new CacheLoaderManagerConfig();

Modified: trunk/core/src/test/java/org/infinispan/loaders/ConcurrentLoadAndEvictTxTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/loaders/ConcurrentLoadAndEvictTxTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/loaders/ConcurrentLoadAndEvictTxTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -5,6 +5,7 @@
 import org.infinispan.eviction.EvictionStrategy;
 import org.infinispan.loaders.dummy.DummyInMemoryCacheStore;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
 import org.testng.annotations.Test;
@@ -23,7 +24,7 @@
 
    TransactionManager tm;
 
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       Configuration config = new Configuration();
       config.setEvictionStrategy(EvictionStrategy.FIFO);
       config.setEvictionWakeUpInterval(10);
@@ -31,7 +32,7 @@
       CacheLoaderManagerConfig clmc = new CacheLoaderManagerConfig();
       config.setCacheLoaderManagerConfig(clmc);
       clmc.addCacheLoaderConfig(new DummyInMemoryCacheStore.Cfg());
-      CacheManager cm = TestCacheManagerFactory.createCacheManager(config, true);
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(config, true);
       cache = cm.getCache();
       tm = getTransactionManager(cache);
       return cm;

Modified: trunk/core/src/test/java/org/infinispan/loaders/UnnnecessaryLoadingTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/loaders/UnnnecessaryLoadingTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/loaders/UnnnecessaryLoadingTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -6,7 +6,7 @@
 import org.infinispan.container.entries.InternalEntryFactory;
 import org.infinispan.loaders.decorators.ChainingCacheStore;
 import org.infinispan.loaders.dummy.DummyInMemoryCacheStore;
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -28,13 +28,13 @@
    CacheStore store;
 
    @Override
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       Configuration cfg = getDefaultStandaloneConfig(false);
       CacheLoaderManagerConfig clmc = new CacheLoaderManagerConfig();
       clmc.addCacheLoaderConfig(new CountingCacheStoreConfig());
       clmc.addCacheLoaderConfig(new DummyInMemoryCacheStore.Cfg());
       cfg.setCacheLoaderManagerConfig(clmc);
-      CacheManager cm = TestCacheManagerFactory.createCacheManager(cfg, true);
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(cfg, true);
       cache = cm.getCache();
       store = TestingUtil.extractComponent(cache, CacheLoaderManager.class).getCacheStore();
       return cm;

Modified: trunk/core/src/test/java/org/infinispan/loaders/decorators/SingletonStoreTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/loaders/decorators/SingletonStoreTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/loaders/decorators/SingletonStoreTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -9,6 +9,7 @@
 import org.infinispan.loaders.CacheStore;
 import org.infinispan.loaders.dummy.DummyInMemoryCacheStore;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.MultipleCacheManagersTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.ViewChangeListener;
@@ -34,7 +35,7 @@
 public class SingletonStoreTest extends MultipleCacheManagersTest {
    private static final Log log = LogFactory.getLog(SingletonStoreTest.class);
    private static final AtomicInteger storeCounter = new AtomicInteger(0);
-   private CacheManager cm0, cm1, cm2;
+   private EmbeddedCacheManager cm0, cm1, cm2;
 
    public SingletonStoreTest() {
       cleanup = CleanupPhase.AFTER_METHOD;

Modified: trunk/core/src/test/java/org/infinispan/loaders/file/ClusterFileCacheStoreFunctionalTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/loaders/file/ClusterFileCacheStoreFunctionalTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/loaders/file/ClusterFileCacheStoreFunctionalTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -8,6 +8,7 @@
 import org.infinispan.config.GlobalConfiguration;
 import org.infinispan.loaders.CacheStoreConfig;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.MultipleCacheManagersTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -43,8 +44,8 @@
 
    @Override
    protected void createCacheManagers() throws Throwable {
-      CacheManager cacheManager1 = TestCacheManagerFactory.createCacheManager(GlobalConfiguration.getClusteredDefault(), new Configuration(), true);
-      CacheManager cacheManager2 = TestCacheManagerFactory.createCacheManager(GlobalConfiguration.getClusteredDefault(), new Configuration(), true);
+      EmbeddedCacheManager cacheManager1 = TestCacheManagerFactory.createCacheManager(GlobalConfiguration.getClusteredDefault(), new Configuration(), true);
+      EmbeddedCacheManager cacheManager2 = TestCacheManagerFactory.createCacheManager(GlobalConfiguration.getClusteredDefault(), new Configuration(), true);
       registerCacheManager(cacheManager1, cacheManager2);
 
       Configuration config1 = getDefaultClusteredConfig(Configuration.CacheMode.REPL_SYNC);

Modified: trunk/core/src/test/java/org/infinispan/manager/CacheManagerComponentRegistryTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/manager/CacheManagerComponentRegistryTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/manager/CacheManagerComponentRegistryTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -24,7 +24,7 @@
  */
 @Test(groups = "functional", testName = "manager.CacheManagerComponentRegistryTest")
 public class CacheManagerComponentRegistryTest extends AbstractInfinispanTest {
-   CacheManager cm;
+   EmbeddedCacheManager cm;
 
    @AfterMethod(alwaysRun = true)
    public void tearDown() {

Modified: trunk/core/src/test/java/org/infinispan/manager/CacheManagerTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/manager/CacheManagerTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/manager/CacheManagerTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -17,7 +17,7 @@
 @Test(groups = "functional", testName = "manager.CacheManagerTest")
 public class CacheManagerTest extends AbstractInfinispanTest {
    public void testDefaultCache() {
-      CacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
 
       try {
          assert cm.getCache().getStatus() == ComponentStatus.RUNNING;
@@ -35,8 +35,17 @@
       }
    }
 
+   public void testUnstartedCachemanager() {
+      DefaultCacheManager dcm = new DefaultCacheManager(false);
+      assert dcm.getStatus().equals(ComponentStatus.INSTANTIATED);
+      assert !dcm.getStatus().allowInvocations();
+      Cache<Object, Object> cache = dcm.getCache();
+      cache.put("k","v");
+      assert cache.get("k").equals("v");
+   }
+
    public void testClashingNames() {
-      CacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
       try {
          Configuration c = new Configuration();
          Configuration firstDef = cm.defineConfiguration("aCache", c);
@@ -69,7 +78,7 @@
    }
 
    public void testDefiningConfigurationValidation() {
-      CacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
       try {
          cm.defineConfiguration("cache1", null);
          assert false : "Should fail";
@@ -99,7 +108,7 @@
    }
 
    public void testDefiningConfigurationWithTemplateName() {
-      CacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
 
       Configuration c = new Configuration();
       c.setIsolationLevel(IsolationLevel.NONE);
@@ -129,7 +138,7 @@
    }
 
    public void testDefiningConfigurationOverridingBooleans() {
-      CacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
       Configuration c = new Configuration();
       c.setUseLazyDeserialization(true);
       Configuration lazy = cm.defineConfiguration("lazyDeserialization", c);

Modified: trunk/core/src/test/java/org/infinispan/manager/CacheManagerXmlConfigurationTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/manager/CacheManagerXmlConfigurationTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/manager/CacheManagerXmlConfigurationTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -22,7 +22,7 @@
  */
 @Test(groups = "functional", testName = "manager.CacheManagerXmlConfigurationTest")
 public class CacheManagerXmlConfigurationTest extends AbstractInfinispanTest {
-   CacheManager cm;
+   EmbeddedCacheManager cm;
 
    @AfterMethod
    public void tearDown() {

Modified: trunk/core/src/test/java/org/infinispan/notifications/CacheListenerCacheLoaderTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/notifications/CacheListenerCacheLoaderTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/notifications/CacheListenerCacheLoaderTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -5,6 +5,7 @@
 import org.infinispan.config.Configuration;
 import org.infinispan.loaders.dummy.DummyInMemoryCacheStore;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.notifications.cachelistener.annotation.CacheEntryActivated;
 import org.infinispan.notifications.cachelistener.annotation.CacheEntryLoaded;
 import org.infinispan.notifications.cachelistener.annotation.CacheEntryPassivated;
@@ -23,7 +24,7 @@
 @Test(groups = "functional", testName = "notifications.CacheListenerCacheLoaderTest")
 public class CacheListenerCacheLoaderTest extends AbstractInfinispanTest {
 
-   CacheManager cm;
+   EmbeddedCacheManager cm;
 
    @BeforeMethod
    public void setUp() {

Modified: trunk/core/src/test/java/org/infinispan/notifications/cachemanagerlistener/CacheManagerNotifierTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/notifications/cachemanagerlistener/CacheManagerNotifierTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/notifications/cachemanagerlistener/CacheManagerNotifierTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -5,6 +5,7 @@
 import org.infinispan.Cache;
 import org.infinispan.config.Configuration;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.notifications.Listener;
 import org.infinispan.notifications.cachemanagerlistener.annotation.ViewChanged;
 import org.infinispan.notifications.cachemanagerlistener.event.ViewChangedEvent;
@@ -23,8 +24,8 @@
 
 @Test(groups = "unit", testName = "notifications.cachemanagerlistener.CacheManagerNotifierTest")
 public class CacheManagerNotifierTest extends AbstractInfinispanTest {
-   CacheManager cm1;
-   CacheManager cm2;
+   EmbeddedCacheManager cm1;
+   EmbeddedCacheManager cm2;
 
    @AfterMethod
    public void tearDown() {
@@ -88,7 +89,7 @@
    }
 
    public void testViewChange() throws Exception {
-      CacheManager cmA = TestCacheManagerFactory.createClusteredCacheManager();
+      EmbeddedCacheManager cmA = TestCacheManagerFactory.createClusteredCacheManager();
       cmA.getCache();
       CyclicBarrier barrier = new CyclicBarrier(2);
       GetCacheManagerCheckListener listener = new GetCacheManagerCheckListener(barrier);

Modified: trunk/core/src/test/java/org/infinispan/profiling/AbstractProfileTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/profiling/AbstractProfileTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/profiling/AbstractProfileTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -3,7 +3,7 @@
 import org.infinispan.config.Configuration;
 import org.infinispan.config.GlobalConfiguration;
 import org.infinispan.executors.ExecutorFactory;
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
 import org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup;
@@ -54,7 +54,7 @@
       return cfg;
    }
 
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       GlobalConfiguration gc = GlobalConfiguration.getClusteredDefault();
       gc.setAsyncTransportExecutorFactoryClass(WTE.class.getName());
       cacheManager = TestCacheManagerFactory.createCacheManager(gc);

Modified: trunk/core/src/test/java/org/infinispan/profiling/DeadlockDetectionPerformanceTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/profiling/DeadlockDetectionPerformanceTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/profiling/DeadlockDetectionPerformanceTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -3,6 +3,7 @@
 import org.infinispan.Cache;
 import org.infinispan.config.Configuration;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.AbstractInfinispanTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -123,7 +124,7 @@
    }
 
    private void runDistributedTest() throws Exception {
-      CacheManager cm = null;
+      EmbeddedCacheManager cm = null;
       List<CacheManager> managers = new ArrayList<CacheManager>();
       try {
          CountDownLatch startLatch = new CountDownLatch(1);
@@ -149,7 +150,7 @@
    }
 
    private void runLocalTest() throws Exception {
-      CacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
       try {
          Configuration configuration = getConfiguration();
          cm.defineConfiguration("test", configuration);

Modified: trunk/core/src/test/java/org/infinispan/statetransfer/StateTransferCacheLoaderFunctionalTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/statetransfer/StateTransferCacheLoaderFunctionalTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/statetransfer/StateTransferCacheLoaderFunctionalTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -7,6 +7,7 @@
 import org.infinispan.loaders.CacheStoreConfig;
 import org.infinispan.loaders.dummy.DummyInMemoryCacheStore;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.TestingUtil;
 import org.testng.annotations.Test;
 
@@ -24,7 +25,7 @@
    }
 
    @Override
-   protected CacheManager createCacheManager() {
+   protected EmbeddedCacheManager createCacheManager() {
       // increment the DIMCS store id
       CacheLoaderManagerConfig clmc = new CacheLoaderManagerConfig();
       CacheStoreConfig clc = new DummyInMemoryCacheStore.Cfg("store number " + id++);

Modified: trunk/core/src/test/java/org/infinispan/statetransfer/StateTransferFetchOnlyPersistentStateTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/statetransfer/StateTransferFetchOnlyPersistentStateTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/statetransfer/StateTransferFetchOnlyPersistentStateTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -30,6 +30,7 @@
 import org.infinispan.loaders.CacheStoreConfig;
 import org.infinispan.loaders.dummy.DummyInMemoryCacheStore;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.MultipleCacheManagersTest;
 import org.testng.annotations.Test;
 
@@ -46,7 +47,7 @@
    protected void createCacheManagers() throws Throwable {
       for (int i = 0; i < 2; i++) {
          Configuration cfg = createConfiguration(i + 1);
-         CacheManager cm = addClusterEnabledCacheManager();
+         EmbeddedCacheManager cm = addClusterEnabledCacheManager();
          cm.defineConfiguration("onlyFetchPersistent", cfg);
       }
    }

Modified: trunk/core/src/test/java/org/infinispan/statetransfer/StateTransferFileCacheLoaderFunctionalTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/statetransfer/StateTransferFileCacheLoaderFunctionalTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/statetransfer/StateTransferFileCacheLoaderFunctionalTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -34,6 +34,7 @@
 import org.infinispan.config.Configuration;
 import org.infinispan.loaders.file.FileCacheStoreConfig;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.MultipleCacheManagersTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.util.logging.Log;
@@ -111,7 +112,7 @@
       clmc.setShared(sharedCacheLoader.get());
       config.setCacheLoaderManagerConfig(clmc);
 
-      CacheManager cm = addClusterEnabledCacheManager();
+      EmbeddedCacheManager cm = addClusterEnabledCacheManager();
       cm.defineConfiguration(cacheName, config.clone());
       return cm;
    }

Modified: trunk/core/src/test/java/org/infinispan/statetransfer/StateTransferFunctionalTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/statetransfer/StateTransferFunctionalTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/statetransfer/StateTransferFunctionalTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -3,6 +3,7 @@
 import org.infinispan.Cache;
 import org.infinispan.config.Configuration;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.MultipleCacheManagersTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.data.Address;
@@ -53,8 +54,8 @@
       config.setUseLockStriping(false); // reduces the odd chance of a key collision and deadlock
    }
 
-   protected CacheManager createCacheManager() {
-      CacheManager cm = addClusterEnabledCacheManager();
+   protected EmbeddedCacheManager createCacheManager() {
+      EmbeddedCacheManager cm = addClusterEnabledCacheManager();
       cm.defineConfiguration(cacheName, config.clone());
       return cm;
    }
@@ -156,7 +157,7 @@
       testCount++;
       log.info("testInitialStateTransferCacheNotPresent start - " + testCount);
       Cache<Object, Object> cache1, cache2;
-      CacheManager cacheManager1 = createCacheManager();
+      EmbeddedCacheManager cacheManager1 = createCacheManager();
       cache1 = cacheManager1.getCache(cacheName);
       writeInitialData(cache1);
       cache2 = createCacheManager().getCache(cacheName);

Modified: trunk/core/src/test/java/org/infinispan/test/AbstractCacheTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/test/AbstractCacheTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/test/AbstractCacheTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -3,6 +3,7 @@
 import org.infinispan.Cache;
 import org.infinispan.config.Configuration;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
 import org.infinispan.util.logging.Log;
 import org.infinispan.util.logging.LogFactory;
@@ -72,4 +73,8 @@
       LockManager lockManager = TestingUtil.extractLockManager(cache);
       assert lockManager.isLocked(key) : "expected key '" + key + "' to be locked, but it is not";
    }
+
+   public EmbeddedCacheManager manager(Cache c) {
+      return (EmbeddedCacheManager) c.getCacheManager();
+   }
 }

Modified: trunk/core/src/test/java/org/infinispan/test/MultipleCacheManagersTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/test/MultipleCacheManagersTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/test/MultipleCacheManagersTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -3,6 +3,7 @@
 import org.infinispan.Cache;
 import org.infinispan.config.Configuration;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.AfterMethod;
@@ -12,6 +13,7 @@
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.IdentityHashMap;
 import java.util.List;
 
@@ -43,7 +45,7 @@
 @Test
 public abstract class MultipleCacheManagersTest extends AbstractCacheTest {
 
-   protected List<CacheManager> cacheManagers = new ArrayList<CacheManager>();
+   protected List<EmbeddedCacheManager> cacheManagers = new ArrayList<EmbeddedCacheManager>();
    private IdentityHashMap<Cache, ReplListener> listeners = new IdentityHashMap<Cache, ReplListener>();
 
    @BeforeClass (alwaysRun = true)
@@ -80,7 +82,7 @@
          log.debug("*** Test method complete; clearing contents on all caches.");
          if (cacheManagers.isEmpty())
             throw new IllegalStateException("No caches registered! Use registerCacheManager(Cache... caches) do that!");
-         for (CacheManager cacheManager : cacheManagers) {
+         for (EmbeddedCacheManager cacheManager : cacheManagers) {
             TestingUtil.clearContent(cacheManager);
          }
       } else {
@@ -96,7 +98,7 @@
     * and result in an intermittent failure for the assertion
     */
    protected void assertSupportedConfig() {
-      for (CacheManager cm : cacheManagers) {
+      for (EmbeddedCacheManager cm : cacheManagers) {
          for (Cache cache : TestingUtil.getRunningCaches(cm)) {
             Configuration config = cache.getConfiguration();
             try {
@@ -111,7 +113,9 @@
    }
 
    final protected void registerCacheManager(CacheManager... cacheManagers) {
-      this.cacheManagers.addAll(Arrays.asList(cacheManagers));
+      for (CacheManager ecm : cacheManagers) {
+         this.cacheManagers.add((EmbeddedCacheManager) ecm);
+      }
    }
 
    /**
@@ -120,8 +124,8 @@
     *
     * @return the new CacheManager
     */
-   protected CacheManager addClusterEnabledCacheManager() {
-      CacheManager cm = TestCacheManagerFactory.createClusteredCacheManager();
+   protected EmbeddedCacheManager addClusterEnabledCacheManager() {
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createClusteredCacheManager();
       cacheManagers.add(cm);
       return cm;
    }
@@ -133,14 +137,14 @@
     * @param defaultConfig default cfg to use
     * @return the new CacheManager
     */
-   protected CacheManager addClusterEnabledCacheManager(Configuration defaultConfig) {
-      CacheManager cm = TestCacheManagerFactory.createClusteredCacheManager(defaultConfig);
+   protected EmbeddedCacheManager addClusterEnabledCacheManager(Configuration defaultConfig) {
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createClusteredCacheManager(defaultConfig);
       cacheManagers.add(cm);
       return cm;
    }
 
    protected void defineConfigurationOnAllManagers(String cacheName, Configuration c) {
-      for (CacheManager cm : cacheManagers) {
+      for (EmbeddedCacheManager cm : cacheManagers) {
          cm.defineConfiguration(cacheName, c);
       }
    }
@@ -148,7 +152,7 @@
    protected <K, V> List<Cache<K, V>> createClusteredCaches(int numMembersInCluster, String cacheName, Configuration c) {
       List<Cache<K, V>> caches = new ArrayList<Cache<K, V>>(numMembersInCluster);
       for (int i = 0; i < numMembersInCluster; i++) {
-         CacheManager cm = addClusterEnabledCacheManager();
+         EmbeddedCacheManager cm = addClusterEnabledCacheManager();
          cm.defineConfiguration(cacheName, c);
          Cache<K, V> cache = cm.getCache(cacheName);
          caches.add(cache);
@@ -160,7 +164,7 @@
    protected <K, V> List<Cache<K, V>> createClusteredCaches(int numMembersInCluster, Configuration defaultConfig) {
       List<Cache<K, V>> caches = new ArrayList<Cache<K, V>>(numMembersInCluster);
       for (int i = 0; i < numMembersInCluster; i++) {
-         CacheManager cm = addClusterEnabledCacheManager(defaultConfig);
+         EmbeddedCacheManager cm = addClusterEnabledCacheManager(defaultConfig);
          Cache<K, V> cache = cm.getCache();
          caches.add(cache);
       }
@@ -177,7 +181,7 @@
       return listener;
    }
 
-   public CacheManager manager(int i) {
+   public EmbeddedCacheManager manager(int i) {
       return cacheManagers.get(i);
    }
 
@@ -186,13 +190,13 @@
    }
 
    protected void assertClusterSize(String message, int size) {
-      for (CacheManager cm : cacheManagers) {
+      for (EmbeddedCacheManager cm : cacheManagers) {
          assert cm.getMembers() != null && cm.getMembers().size() == size : message;
       }
    }
 
    protected void removeCacheFromCluster(String cacheName) {
-      for (CacheManager cm : cacheManagers) {
+      for (EmbeddedCacheManager cm : cacheManagers) {
          TestingUtil.killCaches(cm.getCache(cacheName));
       }
    }

Modified: trunk/core/src/test/java/org/infinispan/test/ReplListener.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/test/ReplListener.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/test/ReplListener.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -8,6 +8,8 @@
 import org.infinispan.context.InvocationContext;
 import org.infinispan.context.impl.TxInvocationContext;
 import org.infinispan.interceptors.base.CommandInterceptor;
+import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.util.logging.Log;
 import org.infinispan.util.logging.LogFactory;
 
@@ -164,7 +166,8 @@
          boolean successful = (expectAny && sawAtLeastOneInvocation) || (!expectAny && expectedCommands.isEmpty());
          info("Expect Any is " + expectAny + ", saw at least one? " + sawAtLeastOneInvocation + " Successful? " + successful + " Expected commands " + expectedCommands);
          if (!successful && !latch.await(time, unit)) {
-            assert false : "Waiting for more than " + time + " " + unit + " and following commands did not replicate: " + expectedCommands + " on cache [" + c.getCacheManager().getAddress() + "]";
+            EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) c.getCacheManager();
+            assert false : "Waiting for more than " + time + " " + unit + " and following commands did not replicate: " + expectedCommands + " on cache [" + cacheManager.getAddress() + "]";
          } else {
             info("Exiting wait for rpc with expected commands " + expectedCommands);
          }

Modified: trunk/core/src/test/java/org/infinispan/test/SingleCacheManagerTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/test/SingleCacheManagerTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/test/SingleCacheManagerTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -3,6 +3,7 @@
 import org.infinispan.Cache;
 import org.infinispan.config.Configuration;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
 import org.infinispan.util.logging.Log;
 import org.infinispan.util.logging.LogFactory;
@@ -22,7 +23,7 @@
 @Test
 public abstract class SingleCacheManagerTest extends AbstractCacheTest {
 
-   protected CacheManager cacheManager;
+   protected EmbeddedCacheManager cacheManager;
    protected Cache<Object, Object> cache;
 
    @BeforeClass()
@@ -68,5 +69,5 @@
       return TestCacheManagerFactory.getDefaultConfiguration(transactional);
    }
 
-   protected abstract CacheManager createCacheManager() throws Exception;
+   protected abstract EmbeddedCacheManager createCacheManager() throws Exception;
 }

Modified: trunk/core/src/test/java/org/infinispan/test/TestingUtil.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/test/TestingUtil.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/test/TestingUtil.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -25,6 +25,7 @@
 import org.infinispan.loaders.CacheLoaderManager;
 import org.infinispan.manager.CacheManager;
 import org.infinispan.manager.DefaultCacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.remoting.ReplicationQueue;
 import org.infinispan.remoting.transport.Address;
 import org.infinispan.util.concurrent.locks.LockManager;
@@ -151,7 +152,7 @@
 
    /**
     * Waits for the given memebrs to be removed from the cluster. The difference between this and {@link
-    * #blockUntilViewsReceived(long, org.infinispan.manager.CacheManager[])} methods(s) is that it does not barf if
+    * #blockUntilViewsReceived(long, org.infinispan.manager.CacheManager...)} methods(s) is that it does not barf if
     * more than expected memebers is in the cluster - this is because we expect to start with a grater number fo
     * memebers than we eventually expect. It will barf though, if the number of members is not the one expected but
     * only after the timeout expieres.
@@ -238,7 +239,8 @@
 
       while (System.currentTimeMillis() < failTime) {
          sleepThread(100);
-         if (isCacheViewComplete(cache.getCacheManager().getMembers(), cache.getCacheManager().getAddress(), groupSize, barfIfTooManyMembersInView)) {
+         EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) cache.getCacheManager();
+         if (isCacheViewComplete(cacheManager.getMembers(), cacheManager.getAddress(), groupSize, barfIfTooManyMembersInView)) {
             return;
          }
       }
@@ -247,7 +249,7 @@
    }
 
    /**
-    * Checks each cache to see if the number of elements in the array returned by {@link CacheManager#getMembers()}
+    * Checks each cache to see if the number of elements in the array returned by {@link EmbeddedCacheManager#getMembers()}
     * matches the size of the <code>caches</code> parameter.
     *
     * @param caches caches that should form a View
@@ -262,7 +264,8 @@
       int memberCount = caches.length;
 
       for (int i = 0; i < memberCount; i++) {
-         if (!isCacheViewComplete(caches[i].getCacheManager().getMembers(), caches[i].getCacheManager().getAddress(), memberCount, barfIfTooManyMembers)) {
+         EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) caches[i].getCacheManager();
+         if (!isCacheViewComplete(cacheManager.getMembers(), cacheManager.getAddress(), memberCount, barfIfTooManyMembers)) {
             return false;
          }
       }
@@ -275,7 +278,8 @@
       int memberCount = cacheManagers.length;
 
       for (int i = 0; i < memberCount; i++) {
-         if (!isCacheViewComplete(cacheManagers[i].getMembers(), cacheManagers[i].getAddress(), memberCount, barfIfTooManyMembers)) {
+         EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) cacheManagers[i];
+         if (!isCacheViewComplete(cacheManager.getMembers(), cacheManager.getAddress(), memberCount, barfIfTooManyMembers)) {
             return false;
          }
       }
@@ -319,7 +323,8 @@
     * @param memberCount
     */
    public static boolean isCacheViewComplete(Cache c, int memberCount) {
-      return isCacheViewComplete(c.getCacheManager().getMembers(), c.getCacheManager().getAddress(), memberCount, true);
+      EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) c.getCacheManager();
+      return isCacheViewComplete(cacheManager.getMembers(), cacheManager.getAddress(), memberCount, true);
    }
 
    public static boolean isCacheViewComplete(List members, Address address, int memberCount, boolean barfIfTooManyMembers) {
@@ -400,7 +405,7 @@
       }
    }
 
-   public static void killCacheManagers(Collection<CacheManager> cacheManagers) {
+   public static void killCacheManagers(Collection<? extends CacheManager> cacheManagers) {
       killCacheManagers(cacheManagers.toArray(new CacheManager[cacheManagers.size()]));
    }
    
@@ -410,7 +415,7 @@
          for (Cache cache : runningCaches) {
             clearRunningTx(cache);
          }
-         if (!cacheManager.getStatus().allowInvocations()) return;
+         if (!((EmbeddedCacheManager)cacheManager).getStatus().allowInvocations()) return;
          for (Cache cache : runningCaches) {
             removeInMemoryData(cache);
             clearCacheLoader(cache);
@@ -460,7 +465,7 @@
    }
    
    private static void removeInMemoryData(Cache cache) {
-      CacheManager mgr = cache.getCacheManager();
+      EmbeddedCacheManager mgr = (EmbeddedCacheManager) cache.getCacheManager();
       Address a = mgr.getAddress();
       String str;
       if (a == null)
@@ -655,7 +660,8 @@
          if (c == null) {
             System.out.println("  ** Cache " + count + " is null!");
          } else {
-            System.out.println("  ** Cache " + count + " is " + c.getCacheManager().getAddress());
+            EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) c.getCacheManager();
+            System.out.println("  ** Cache " + count + " is " + cacheManager.getAddress());
          }
          count++;
       }

Modified: trunk/core/src/test/java/org/infinispan/test/ViewChangeListener.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/test/ViewChangeListener.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/test/ViewChangeListener.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -2,6 +2,7 @@
 
 import org.infinispan.Cache;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.notifications.Listener;
 import org.infinispan.notifications.cachemanagerlistener.annotation.ViewChanged;
 import org.infinispan.notifications.cachemanagerlistener.event.ViewChangedEvent;
@@ -19,10 +20,10 @@
    final CountDownLatch latch = new CountDownLatch(1);
 
    public ViewChangeListener(Cache c) {
-      this(c.getCacheManager());
+      this((EmbeddedCacheManager) c.getCacheManager());
    }
 
-   public ViewChangeListener(CacheManager cm) {
+   public ViewChangeListener(EmbeddedCacheManager cm) {
       this.cm = cm;
       cm.addListener(this);
    }

Modified: trunk/core/src/test/java/org/infinispan/test/fwk/TestCacheManagerFactory.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/test/fwk/TestCacheManagerFactory.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/test/fwk/TestCacheManagerFactory.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -5,8 +5,8 @@
 import org.infinispan.config.GlobalConfiguration;
 import org.infinispan.config.InfinispanConfiguration;
 import org.infinispan.jmx.PerThreadMBeanServerLookup;
-import org.infinispan.manager.CacheManager;
 import org.infinispan.manager.DefaultCacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.remoting.transport.jgroups.JGroupsTransport;
 import org.infinispan.util.Util;
 import org.infinispan.util.logging.Log;
@@ -14,9 +14,7 @@
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -50,7 +48,7 @@
       return newDefaultCacheManager(gc, c);
    }
 
-   public static CacheManager fromXml(String xmlFile, boolean allowDupeDomains) throws IOException {
+   public static EmbeddedCacheManager fromXml(String xmlFile, boolean allowDupeDomains) throws IOException {
       InfinispanConfiguration parser = InfinispanConfiguration.newInfinispanConfiguration(
                xmlFile,
                InfinispanConfiguration.resolveSchemaPath(),
@@ -58,22 +56,22 @@
       return fromConfigFileParser(parser, allowDupeDomains);
    }
 
-   public static CacheManager fromXml(String xmlFile) throws IOException {
+   public static EmbeddedCacheManager fromXml(String xmlFile) throws IOException {
       return fromXml(xmlFile, false);
    }
 
-   public static CacheManager fromStream(InputStream is) throws IOException {
+   public static EmbeddedCacheManager fromStream(InputStream is) throws IOException {
       return fromStream(is, false);
    }
 
-   public static CacheManager fromStream(InputStream is, boolean allowDupeDomains) throws IOException {
+   public static EmbeddedCacheManager fromStream(InputStream is, boolean allowDupeDomains) throws IOException {
       InfinispanConfiguration parser = InfinispanConfiguration.newInfinispanConfiguration(
                is, InfinispanConfiguration.findSchemaInputStream(),
                new ConfigurationValidatingVisitor());
       return fromConfigFileParser(parser, allowDupeDomains);
    }
 
-   private static CacheManager fromConfigFileParser(InfinispanConfiguration parser, boolean allowDupeDomains) {
+   private static EmbeddedCacheManager fromConfigFileParser(InfinispanConfiguration parser, boolean allowDupeDomains) {
       GlobalConfiguration gc = parser.parseGlobalConfiguration();
       if (allowDupeDomains) gc.setAllowDuplicateDomains(true);
       Map<String, Configuration> named = parser.parseNamedConfigurations();
@@ -81,7 +79,7 @@
 
       minimizeThreads(gc);
 
-      CacheManager cm = newDefaultCacheManager(gc, c, false);
+      EmbeddedCacheManager cm = newDefaultCacheManager(gc, c, false);
       for (Map.Entry<String, Configuration> e: named.entrySet()) cm.defineConfiguration(e.getKey(), e.getValue());
       cm.start();
       return cm;
@@ -90,7 +88,7 @@
    /**
     * Creates an cache manager that does not support clustering or transactions.
     */
-   public static CacheManager createLocalCacheManager() {
+   public static EmbeddedCacheManager createLocalCacheManager() {
       return createLocalCacheManager(false);
    }
 
@@ -99,7 +97,7 @@
     *
     * @param transactional if true, the cache manager will support transactions by default.
     */
-   public static CacheManager createLocalCacheManager(boolean transactional) {
+   public static EmbeddedCacheManager createLocalCacheManager(boolean transactional) {
       GlobalConfiguration globalConfiguration = GlobalConfiguration.getNonClusteredDefault();
       amendMarshaller(globalConfiguration);
       minimizeThreads(globalConfiguration);
@@ -115,14 +113,14 @@
    /**
     * Creates an cache manager that does support clustering.
     */
-   public static CacheManager createClusteredCacheManager() {
+   public static EmbeddedCacheManager createClusteredCacheManager() {
       return createClusteredCacheManager(new Configuration());
    }
 
    /**
     * Creates an cache manager that does support clustering with a given default cache configuration.
     */
-   public static CacheManager createClusteredCacheManager(Configuration defaultCacheConfig) {
+   public static EmbeddedCacheManager createClusteredCacheManager(Configuration defaultCacheConfig) {
       GlobalConfiguration globalConfiguration = GlobalConfiguration.getClusteredDefault();
       amendMarshaller(globalConfiguration);
       minimizeThreads(globalConfiguration);
@@ -136,7 +134,7 @@
     * Creates a cache manager and amends the supplied configuration in order to avoid conflicts (e.g. jmx, jgroups)
     * during running tests in parallel.
     */
-   public static CacheManager createCacheManager(GlobalConfiguration configuration) {
+   public static EmbeddedCacheManager createCacheManager(GlobalConfiguration configuration) {
       return internalCreateJmxDomain(configuration, false);
    }
 
@@ -145,11 +143,11 @@
     * This method must be used with care, and one should make sure that no domain name collision happens when the parallel suite executes.
     * An approach to ensure this, is to set the domain name to the name of the test class that instantiates the CacheManager.
     */
-   public static CacheManager createCacheManagerEnforceJmxDomain(GlobalConfiguration configuration) {
+   public static EmbeddedCacheManager createCacheManagerEnforceJmxDomain(GlobalConfiguration configuration) {
       return internalCreateJmxDomain(configuration, true);
    }
 
-   private static CacheManager internalCreateJmxDomain(GlobalConfiguration configuration, boolean enforceJmxDomain) {
+   private static EmbeddedCacheManager internalCreateJmxDomain(GlobalConfiguration configuration, boolean enforceJmxDomain) {
       amendMarshaller(configuration);
       minimizeThreads(configuration);
       amendTransport(configuration);
@@ -160,7 +158,7 @@
     * Creates a local cache manager and amends so that it won't conflict (e.g. jmx) with other managers whilst running
     * tests in parallel.  This is a non-transactional cache manager.
     */
-   public static CacheManager createCacheManager(Configuration defaultCacheConfig) {
+   public static EmbeddedCacheManager createCacheManager(Configuration defaultCacheConfig) {
       if (defaultCacheConfig.getTransactionManagerLookup() != null || defaultCacheConfig.getTransactionManagerLookupClass() != null) {
          log.error("You have passed in a default configuration which has transactional elements set.  If you wish to use transactions, use the TestCacheManagerFactory.createCacheManager(Configuration defaultCacheConfig, boolean transactional) method.");
       }
@@ -169,7 +167,7 @@
       return createCacheManager(defaultCacheConfig, false);
    }
 
-   public static CacheManager createCacheManager(Configuration defaultCacheConfig, boolean transactional) {
+   public static EmbeddedCacheManager createCacheManager(Configuration defaultCacheConfig, boolean transactional) {
       GlobalConfiguration globalConfiguration;
       if (defaultCacheConfig.getCacheMode().isClustered())
          globalConfiguration = GlobalConfiguration.getClusteredDefault();
@@ -181,11 +179,11 @@
       return newDefaultCacheManager(globalConfiguration, defaultCacheConfig, false);
    }
 
-   public static CacheManager createCacheManager(GlobalConfiguration configuration, Configuration defaultCfg) {
+   public static EmbeddedCacheManager createCacheManager(GlobalConfiguration configuration, Configuration defaultCfg) {
       return createCacheManager(configuration, defaultCfg, false, false);
    }
 
-   public static CacheManager createCacheManager(GlobalConfiguration configuration, Configuration defaultCfg, boolean transactional) {
+   public static EmbeddedCacheManager createCacheManager(GlobalConfiguration configuration, Configuration defaultCfg, boolean transactional) {
       minimizeThreads(configuration);
       amendMarshaller(configuration);
       amendTransport(configuration);
@@ -193,11 +191,11 @@
       return newDefaultCacheManager(configuration, defaultCfg, false);
    }
 
-   private static CacheManager createCacheManager(GlobalConfiguration configuration, Configuration defaultCfg, boolean transactional, boolean keepJmxDomainName) {
+   private static EmbeddedCacheManager createCacheManager(GlobalConfiguration configuration, Configuration defaultCfg, boolean transactional, boolean keepJmxDomainName) {
       return createCacheManager(configuration, defaultCfg, transactional, keepJmxDomainName, false);
    }
 
-   public static CacheManager createCacheManager(GlobalConfiguration configuration, Configuration defaultCfg, boolean transactional, boolean keepJmxDomainName, boolean dontFixTransport) {
+   public static EmbeddedCacheManager createCacheManager(GlobalConfiguration configuration, Configuration defaultCfg, boolean transactional, boolean keepJmxDomainName, boolean dontFixTransport) {
       minimizeThreads(configuration);
       amendMarshaller(configuration);
       if (!dontFixTransport) amendTransport(configuration);
@@ -208,14 +206,14 @@
    /**
     * @see #createCacheManagerEnforceJmxDomain(String)
     */
-   public static CacheManager createCacheManagerEnforceJmxDomain(String jmxDomain) {
+   public static EmbeddedCacheManager createCacheManagerEnforceJmxDomain(String jmxDomain) {
       return createCacheManagerEnforceJmxDomain(jmxDomain, true, true);
    }
 
    /**
     * @see #createCacheManagerEnforceJmxDomain(String)
     */
-   public static CacheManager createCacheManagerEnforceJmxDomain(String jmxDomain, boolean exposeGlobalJmx, boolean exposeCacheJmx) {
+   public static EmbeddedCacheManager createCacheManagerEnforceJmxDomain(String jmxDomain, boolean exposeGlobalJmx, boolean exposeCacheJmx) {
       GlobalConfiguration globalConfiguration = GlobalConfiguration.getNonClusteredDefault();
       globalConfiguration.setJmxDomain(jmxDomain);
       globalConfiguration.setMBeanServerLookup(PerThreadMBeanServerLookup.class.getName());
@@ -286,11 +284,11 @@
    }
 
    private static class PerThreadCacheManagers {
-      HashMap<String, CacheManager> cacheManagers = new HashMap<String, CacheManager>();
+      HashMap<String, EmbeddedCacheManager> cacheManagers = new HashMap<String, EmbeddedCacheManager>();
 
       public void checkManagersClosed(String testName) {
          for (String cmName : cacheManagers.keySet()) {
-            CacheManager cm = cacheManagers.get(cmName);
+            EmbeddedCacheManager cm = cacheManagers.get(cmName);
             if (cm.getStatus().allowInvocations()) {
                String thName = Thread.currentThread().getName();
                String errorMessage = '\n' +

Modified: trunk/core/src/test/java/org/infinispan/tx/LocalDeadlockDetectionTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/tx/LocalDeadlockDetectionTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/tx/LocalDeadlockDetectionTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -1,7 +1,7 @@
 package org.infinispan.tx;
 
 import org.infinispan.config.Configuration;
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.PerCacheExecutorThread;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.TestingUtil;
@@ -30,7 +30,7 @@
    private Object response1;
    private Object response2;
 
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       cacheManager = TestCacheManagerFactory.createLocalCacheManager();
       Configuration configuration = getDefaultStandaloneConfig(true);
       configuration.setEnableDeadlockDetection(true);

Modified: trunk/core/src/test/java/org/infinispan/tx/LocalModeTxTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/tx/LocalModeTxTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/tx/LocalModeTxTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -21,7 +21,7 @@
  */
 package org.infinispan.tx;
 
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -33,8 +33,8 @@
 @Test(groups = "functional", testName = "tx.LocalModeTxTest")
 public class LocalModeTxTest extends SingleCacheManagerTest {
 
-   protected CacheManager createCacheManager() {
-      CacheManager cm = TestCacheManagerFactory.createLocalCacheManager(true);
+   protected EmbeddedCacheManager createCacheManager() {
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createLocalCacheManager(true);
       cache = cm.getCache();
       return cm;
    }

Modified: trunk/core/src/test/java/org/infinispan/tx/MarkAsRollbackTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/tx/MarkAsRollbackTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/tx/MarkAsRollbackTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -2,6 +2,7 @@
 
 import org.infinispan.config.Configuration;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -13,8 +14,8 @@
 @Test(groups = "functional", testName = "tx.MarkAsRollbackTest")
 public class MarkAsRollbackTest extends SingleCacheManagerTest {
 
-   protected CacheManager createCacheManager() throws Exception {
-      CacheManager cm = TestCacheManagerFactory.createCacheManager(new Configuration(), true);
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(new Configuration(), true);
       cache = cm.getCache();
       return cm;
    }

Modified: trunk/core/src/test/java/org/infinispan/tx/StaleLockRecoveryTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/tx/StaleLockRecoveryTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/tx/StaleLockRecoveryTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -2,6 +2,8 @@
 
 import org.infinispan.Cache;
 import org.infinispan.config.Configuration;
+import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.MultipleCacheManagersTest;
 import org.infinispan.test.TestingUtil;
 import org.testng.annotations.Test;
@@ -46,7 +48,8 @@
 
       cacheManagers.get(0).stop();
 
-      assert c2.getCacheManager().getMembers().size() == 1;
+      EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) c2.getCacheManager();
+      assert cacheManager.getMembers().size() == 1;
 
       // may take a while from when the view change is seen through to when the lock is cleared
       TestingUtil.sleepThread(1000);

Modified: trunk/core/src/test/java/org/infinispan/tx/TransactionsSpanningCaches.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/tx/TransactionsSpanningCaches.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/core/src/test/java/org/infinispan/tx/TransactionsSpanningCaches.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -3,6 +3,7 @@
 import org.infinispan.Cache;
 import org.infinispan.config.Configuration;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -14,8 +15,8 @@
 @Test(groups = "functional", sequential = true, testName = "tx.TransactionsSpanningCaches")
 public class TransactionsSpanningCaches extends SingleCacheManagerTest {
 
-   protected CacheManager createCacheManager() throws Exception {
-      CacheManager cm = TestCacheManagerFactory.createCacheManager(new Configuration(), true);
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(new Configuration(), true);
       cm.defineConfiguration("c1", cm.getCache().getConfiguration());
       cm.defineConfiguration("c2", cm.getCache().getConfiguration());
       return cm;

Modified: trunk/demos/directory/src/main/java/org/infinispan/demos/directory/FilesystemDirectory.java
===================================================================
--- trunk/demos/directory/src/main/java/org/infinispan/demos/directory/FilesystemDirectory.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/demos/directory/src/main/java/org/infinispan/demos/directory/FilesystemDirectory.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -5,6 +5,7 @@
 import org.infinispan.config.GlobalConfiguration;
 import org.infinispan.manager.CacheManager;
 import org.infinispan.manager.DefaultCacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.jgroups.util.Util;
 
 import java.io.File;
@@ -19,7 +20,7 @@
  * @version $Id$
  */
 public class FilesystemDirectory {
-    CacheManager manager;
+    EmbeddedCacheManager manager;
     Cache<String,byte[]> cache;
 
 

Modified: trunk/demos/ec2/src/main/java/org/infinispan/ec2demo/CacheBuilder.java
===================================================================
--- trunk/demos/ec2/src/main/java/org/infinispan/ec2demo/CacheBuilder.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/demos/ec2/src/main/java/org/infinispan/ec2demo/CacheBuilder.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -8,6 +8,7 @@
 import org.infinispan.config.GlobalConfiguration;
 import org.infinispan.manager.CacheManager;
 import org.infinispan.manager.DefaultCacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.remoting.transport.jgroups.JGroupsTransport;
 import org.infinispan.util.logging.Log;
 import org.infinispan.util.logging.LogFactory;
@@ -18,7 +19,7 @@
  * @author noconnor at redhat.com
  */
 public class CacheBuilder {
-	private CacheManager cache_manager;
+	private EmbeddedCacheManager cache_manager;
 	private static final Log myLogger = LogFactory.getLog(CacheBuilder.class);
 
 	public CacheBuilder(String inConfigFile) throws IOException {
@@ -55,7 +56,7 @@
 		//Runtime.getRuntime().addShutdownHook(shutdownHook);
 	}
 
-	public CacheManager getCacheManager() {
+	public EmbeddedCacheManager getCacheManager() {
 		return this.cache_manager;
 	}
 

Modified: trunk/demos/gui/src/main/java/org/infinispan/demo/InfinispanDemo.java
===================================================================
--- trunk/demos/gui/src/main/java/org/infinispan/demo/InfinispanDemo.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/demos/gui/src/main/java/org/infinispan/demo/InfinispanDemo.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -3,7 +3,9 @@
 import org.infinispan.Cache;
 import org.infinispan.container.entries.InternalCacheEntry;
 import org.infinispan.lifecycle.ComponentStatus;
+import org.infinispan.manager.CacheManager;
 import org.infinispan.manager.DefaultCacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.notifications.Listener;
 import org.infinispan.notifications.cachelistener.annotation.CacheEntryEvicted;
 import org.infinispan.notifications.cachelistener.annotation.CacheEntryModified;
@@ -338,8 +340,9 @@
 
                CacheListener cl = new CacheListener();
                cache.addListener(cl);
-               cache.getCacheManager().addListener(cl);
-               updateClusterTable(cache.getCacheManager().getMembers());
+               EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) cache.getCacheManager();
+               cacheManager.addListener(cl);
+               updateClusterTable(cacheManager.getMembers());
 
                lifespanSpinner.setValue(cache.getConfiguration().getExpirationLifespan());
                maxIdleSpinner.setValue(cache.getConfiguration().getExpirationMaxIdle());
@@ -393,13 +396,15 @@
    }
 
    private String getLocalAddress() {
-      Address a = cache.getCacheManager().getAddress();
+      EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) cache.getCacheManager();
+      Address a = cacheManager.getAddress();
       if (a == null) return "(LOCAL mode)";
       else return a.toString();
    }
 
    private String getClusterSize() {
-      List<Address> members = cache.getCacheManager().getMembers();
+      EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) cache.getCacheManager();
+      List<Address> members = cacheManager.getMembers();
       return members == null || members.isEmpty() ? "N/A" : "" + members.size();
    }
 
@@ -476,7 +481,8 @@
                String extraInfo = "Member";
                // if this is the first member then this is the coordinator
                if (memberStates.isEmpty()) extraInfo += " (coord)";
-               if (a.equals(cache.getCacheManager().getAddress()))
+               EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) cache.getCacheManager();
+               if (a.equals(cacheManager.getAddress()))
                   extraInfo += " (me)";
 
                memberStates.add(extraInfo);

Modified: trunk/demos/lucene-directory-demo/src/main/java/org/infinispan/lucenedemo/DemoActions.java
===================================================================
--- trunk/demos/lucene-directory-demo/src/main/java/org/infinispan/lucenedemo/DemoActions.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/demos/lucene-directory-demo/src/main/java/org/infinispan/lucenedemo/DemoActions.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -42,6 +42,8 @@
 import org.apache.lucene.search.ScoreDoc;
 import org.apache.lucene.search.TopDocs;
 import org.infinispan.lucene.InfinispanDirectory;
+import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.remoting.transport.Address;
 
 /**
@@ -133,7 +135,8 @@
     * Returns a list of Addresses of all members in the cluster 
     */
    public List<Address> listAllMembers() {
-      return index.getCache().getCacheManager().getMembers();
+      EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) index.getCache().getCacheManager();
+      return cacheManager.getMembers();
    }
 
 }

Modified: trunk/jopr-plugin/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- trunk/jopr-plugin/src/main/resources/META-INF/rhq-plugin.xml	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/jopr-plugin/src/main/resources/META-INF/rhq-plugin.xml	2010-05-24 08:58:40 UTC (rev 1830)
@@ -27,9 +27,9 @@
                 </c:template>
             </plugin-configuration>
 
-           <operation name="startCache" displayName="Starts the default cache." description="Starts the default cache associated with this cache manager.">
+           <operation name="startCache" displayName="Starts the default cache" description="Starts the default cache associated with this cache manager">
            </operation>
-           <operation name="startCacheWithCacheName" displayName="Starts a cache with the given name." description="Starts a named cache from this cache manager.">
+           <operation name="startCacheWithCacheName" displayName="Starts a cache with the given name" description="Starts a named cache from this cache manager">
               <parameters>
                  <c:simple-property name="cacheName" description="Name of cache to start"/>
               </parameters>
@@ -61,14 +61,32 @@
           >
 
 
+           <operation name="CacheLoader.resetStatistics" displayName="[CacheLoader] Reset Statistics" description="Resets statistics gathered by this component">
+           </operation>
+           <operation name="Cache.start" displayName="[Cache] Starts cache." description="Starts the cache.">
+           </operation>
+           <operation name="Cache.stop" displayName="[Cache] Stops cache." description="Stops the cache.">
+           </operation>
+           <operation name="Transactions.resetStatistics" displayName="[Transactions] Reset Statistics" description="Resets statistics gathered by this component">
+           </operation>
+           <operation name="Transactions.setStatisticsEnabled" displayName="[Transactions] Enable/disable statistics" description="Enable/disable statistics">
+              <parameters>
+                 <c:simple-property name="enabled" description="Whether statistics should be enabled or disabled (true/false)"/>
+              </parameters>
+           </operation>
+           <operation name="Invalidation.resetStatistics" displayName="[Invalidation] Reset statistics" description="Resets statistics gathered by this component">
+           </operation>
+           <operation name="Invalidation.setStatisticsEnabled" displayName="[Invalidation] Enable/disable statistics" description="Enable/disable statistics">
+              <parameters>
+                 <c:simple-property name="enabled" description="Whether statistics should be enabled or disabled (true/false)"/>
+              </parameters>
+           </operation>
            <operation name="Statistics.resetStatistics" displayName="[Statistics] Reset Statistics (Statistics)" description="Resets statistics gathered by this component">
            </operation>
-           <operation name="CacheLoader.resetStatistics" displayName="[CacheLoader] Reset Statistics" description="Resets statistics gathered by this component">
+           <operation name="DeadlockDetectingLockManager.resetStatistics" displayName="[DeadlockDetectingLockManager] Reset statistics" description="Resets statistics gathered by this component">
            </operation>
-           <operation name="Activation.resetStatistics" displayName="[Activation] Reset statistics" description="Resets statistics gathered by this component">
+           <operation name="CacheStore.resetStatistics" displayName="[CacheStore] Reset statistics" description="Resets statistics gathered by this component">
            </operation>
-           <operation name="Passivation.resetStatistics" displayName="[Passivation] Reset statistics" description="Resets statistics gathered by this component">
-           </operation>
            <operation name="DistributionManager.isAffectedByRehash" displayName="[DistributionManager] Could key be affected by reshah?" description="Determines whether a given key is affected by an ongoing rehash, if any.">
               <parameters>
                  <c:simple-property name="key" description="Key to check"/>
@@ -93,12 +111,10 @@
                  <c:simple-property name="operationResult" />
               </results>
            </operation>
-           <operation name="Cache.start" displayName="[Cache] Starts cache." description="Starts the cache.">
+           <operation name="Activation.resetStatistics" displayName="[Activation] Reset statistics" description="Resets statistics gathered by this component">
            </operation>
-           <operation name="Cache.stop" displayName="[Cache] Stops cache." description="Stops the cache.">
+           <operation name="Passivation.resetStatistics" displayName="[Passivation] Reset statistics" description="Resets statistics gathered by this component">
            </operation>
-           <operation name="CacheStore.resetStatistics" displayName="[CacheStore] Reset statistics" description="Resets statistics gathered by this component">
-           </operation>
            <operation name="RpcManager.resetStatistics" displayName="[RpcManager] Reset statistics" description="Resets statistics gathered by this component">
            </operation>
            <operation name="RpcManager.setStatisticsEnabled" displayName="[RpcManager] Enable/disable statistics" description="Enable/disable statistics">
@@ -106,29 +122,37 @@
                  <c:simple-property name="enabled" description="Whether statistics should be enabled or disabled (true/false)"/>
               </parameters>
            </operation>
-           <operation name="DeadlockDetectingLockManager.resetStatistics" displayName="[DeadlockDetectingLockManager] Reset statistics" description="Resets statistics gathered by this component">
-           </operation>
-           <operation name="Transactions.resetStatistics" displayName="[Transactions] Reset Statistics" description="Resets statistics gathered by this component">
-           </operation>
-           <operation name="Transactions.setStatisticsEnabled" displayName="[Transactions] Enable/disable statistics" description="Enable/disable statistics">
-              <parameters>
-                 <c:simple-property name="enabled" description="Whether statistics should be enabled or disabled (true/false)"/>
-              </parameters>
-           </operation>
-           <operation name="Invalidation.resetStatistics" displayName="[Invalidation] Reset statistics" description="Resets statistics gathered by this component">
-           </operation>
-           <operation name="Invalidation.setStatisticsEnabled" displayName="[Invalidation] Enable/disable statistics" description="Enable/disable statistics">
-              <parameters>
-                 <c:simple-property name="enabled" description="Whether statistics should be enabled or disabled (true/false)"/>
-              </parameters>
-           </operation>
 
-           <metric property="Statistics.Stores" displayName="[Statistics] Number of cache puts" displayType="summary" units="none" dataType="measurement"
-                   description="number of cache attribute put operations" />
+           <metric property="CacheLoader.CacheLoaderLoads" displayName="[CacheLoader] Number of cache store loads" displayType="detail" units="none" dataType="measurement"
+                   description="Number of entries loaded from cache store" />
+           <metric property="CacheLoader.CacheLoaderMisses" displayName="[CacheLoader] Number of cache store load misses" displayType="detail" units="none" dataType="measurement"
+                   description="Number of entries that did not exist in cache store" />
+           <metric property="Cache.CacheStatus" displayName="[Cache] Cache status" displayType="summary" units="none" dataType="trait"
+                   description="Returns the cache status" />
+           <metric property="Cache.CacheName" displayName="[Cache] Cache name" displayType="summary" units="none" dataType="trait"
+                   description="Returns the cache name" />
+           <metric property="Transactions.StatisticsEnabled" displayName="[Transactions] Statistics enabled" displayType="detail" units="none" dataType="trait"
+                   description="Statistics enabled" />
+           <metric property="Transactions.Prepares" displayName="[Transactions] Prepares" displayType="summary" units="none" dataType="measurement"
+                   description="Number of transaction prepares performed since last reset" />
+           <metric property="Transactions.Commits" displayName="[Transactions] Commits" displayType="summary" units="none" dataType="measurement"
+                   description="Number of transaction commits performed since last reset" />
+           <metric property="Transactions.Rollbacks" displayName="[Transactions] Rollbacks" displayType="summary" units="none" dataType="measurement"
+                   description="Number of transaction rollbacks performed since last reset" />
+           <metric property="Invalidation.StatisticsEnabled" displayName="[Invalidation] Statistics enabled" displayType="detail" units="none" dataType="trait"
+                   description="Statistics enabled" />
+           <metric property="Invalidation.Invalidations" displayName="[Invalidation] Number of invalidations" displayType="detail" units="none" dataType="measurement"
+                   description="Number of invalidations" />
            <metric property="Statistics.Hits" displayName="[Statistics] Number of cache hits" displayType="summary" units="none" dataType="measurement"
                    description="Number of cache attribute hits" />
            <metric property="Statistics.Misses" displayName="[Statistics] Number of cache misses" displayType="summary" units="none" dataType="measurement"
                    description="Number of cache attribute misses" />
+           <metric property="Statistics.RemoveHits" displayName="[Statistics] Number of cache removal hits" displayType="summary" units="none" dataType="measurement"
+                   description="Number of cache removal hits" />
+           <metric property="Statistics.RemoveMisses" displayName="[Statistics] Number of cache removal misses" displayType="summary" units="none" dataType="measurement"
+                   description="Number of cache removals where keys were not found" />
+           <metric property="Statistics.Stores" displayName="[Statistics] Number of cache puts" displayType="summary" units="none" dataType="measurement"
+                   description="number of cache attribute put operations" />
            <metric property="Statistics.Evictions" displayName="[Statistics] Number of cache evictions" displayType="summary" units="none" dataType="measurement"
                    description="Number of cache eviction operations" />
            <metric property="Statistics.HitRatio" displayName="[Statistics] Hit ratio" displayType="summary" units="percentage" dataType="measurement"
@@ -139,86 +163,66 @@
                    description="Average number of milliseconds for a read operation on the cache" />
            <metric property="Statistics.AverageWriteTime" displayName="[Statistics] Average write time" displayType="summary" units="milliseconds" dataType="measurement"
                    description="Average number of milliseconds for a write operation in the cache" />
-           <metric property="Statistics.NumberOfEntries" displayName="[Statistics] Number of cache entries" displayType="summary" units="none" dataType="measurement"
-                   description="Number of entries in the cache" />
+           <metric property="Statistics.NumberOfEntries" displayName="[Statistics] Number of current cache entries" displayType="summary" units="none" dataType="measurement"
+                   description="Number of entries currently in the cache" />
            <metric property="Statistics.ElapsedTime" displayName="[Statistics] Seconds since cache started" displayType="summary" units="seconds" dataType="measurement"
                    description="Number of seconds since cache started" />
            <metric property="Statistics.TimeSinceReset" displayName="[Statistics] Seconds since cache statistics were reset" displayType="summary" units="seconds" dataType="measurement"
                    description="Number of seconds since the cache statistics were last reset" />
-           <metric property="CacheLoader.CacheLoaderLoads" displayName="[CacheLoader] Number of cache store loads" displayType="detail" units="none" dataType="measurement"
-                   description="Number of entries loaded from cache store" />
-           <metric property="CacheLoader.CacheLoaderMisses" displayName="[CacheLoader] Number of cache store load misses" displayType="detail" units="none" dataType="measurement"
-                   description="Number of entries that did not exist in cache store" />
+           <metric property="DeadlockDetectingLockManager.OverlapWithNotDeadlockAwareLockOwners" displayName="[DeadlockDetectingLockManager] Number of unsolvable deadlock situations" displayType="detail" units="none" dataType="measurement"
+                   description="Number of situtations when we try to determine a deadlock and the other lock owner is e.g. a local tx. In this scenario we cannot run the deadlock detection mechanism" />
+           <metric property="DeadlockDetectingLockManager.LocallyInterruptedTransactions" displayName="[DeadlockDetectingLockManager] Number of interrupted local transactions" displayType="detail" units="none" dataType="measurement"
+                   description="Number of locally originated transactions that were interrupted as a deadlock situation was detected" />
+           <metric property="DeadlockDetectingLockManager.DetectedRemoteDeadlocks" displayName="[DeadlockDetectingLockManager] Number of detected remote deadlocks" displayType="detail" units="none" dataType="measurement"
+                   description="Number of remote deadlocks detected" />
+           <metric property="DeadlockDetectingLockManager.DetectedLocalDeadlocks" displayName="[DeadlockDetectingLockManager] Number of detected local deadlocks" displayType="detail" units="none" dataType="measurement"
+                   description="Number of local detected deadlocks" />
+           <metric property="DeadlockDetectingLockManager.TotalNumberOfDetectedDeadlocks" displayName="[DeadlockDetectingLockManager] Number of total detected deadlocks" displayType="detail" units="none" dataType="measurement"
+                   description="Total number of local detected deadlocks" />
+           <metric property="DeadlockDetectingLockManager.ConcurrencyLevel" displayName="[DeadlockDetectingLockManager] Concurrency level" displayType="detail" units="none" dataType="trait"
+                   description="The concurrency level that the MVCC Lock Manager has been configured with." />
+           <metric property="DeadlockDetectingLockManager.NumberOfLocksHeld" displayName="[DeadlockDetectingLockManager] Number of locks held" displayType="detail" units="none" dataType="measurement"
+                   description="The number of exclusive locks that are held." />
+           <metric property="DeadlockDetectingLockManager.NumberOfLocksAvailable" displayName="[DeadlockDetectingLockManager] Number of locks available" displayType="detail" units="none" dataType="measurement"
+                   description="The number of exclusive locks that are available." />
+           <metric property="CacheStore.CacheLoaderStores" displayName="[CacheStore] Number of cache stores" displayType="detail" units="none" dataType="measurement"
+                   description="number of cache loader stores" />
+           <metric property="DistributionManager.RehashInProgress" displayName="[DistributionManager] Is rehash in progress?" displayType="detail" units="none" dataType="trait"
+                   description="Checks whether the node is involved in a rehash." />
+           <metric property="DistributionManager.JoinComplete" displayName="[DistributionManager] Is join completed?" displayType="detail" units="none" dataType="trait"
+                   description="If true, the node has successfully joined the grid and is considered to hold state.  If false, the join process is still in progress." />
            <metric property="Activation.Activations" displayName="[Activation] Number of cache entries activated" displayType="detail" units="none" dataType="measurement"
                    description="Number of activation events" />
            <metric property="Activation.CacheLoaderLoads" displayName="[Activation] Number of cache store loads" displayType="detail" units="none" dataType="measurement"
                    description="Number of entries loaded from cache store" />
            <metric property="Activation.CacheLoaderMisses" displayName="[Activation] Number of cache store load misses" displayType="detail" units="none" dataType="measurement"
                    description="Number of entries that did not exist in cache store" />
+           <metric property="Passivation.Passivations" displayName="[Passivation] Number of cache passivations" displayType="detail" units="none" dataType="measurement"
+                   description="Number of passivation events" />
            <metric property="LockManager.ConcurrencyLevel" displayName="[LockManager] Concurrency level" displayType="detail" units="none" dataType="trait"
                    description="The concurrency level that the MVCC Lock Manager has been configured with." />
            <metric property="LockManager.NumberOfLocksHeld" displayName="[LockManager] Number of locks held" displayType="detail" units="none" dataType="measurement"
                    description="The number of exclusive locks that are held." />
            <metric property="LockManager.NumberOfLocksAvailable" displayName="[LockManager] Number of locks available" displayType="detail" units="none" dataType="measurement"
                    description="The number of exclusive locks that are available." />
-           <metric property="Passivation.Passivations" displayName="[Passivation] Number of cache passivations" displayType="detail" units="none" dataType="measurement"
-                   description="Number of passivation events" />
-           <metric property="DistributionManager.RehashInProgress" displayName="[DistributionManager] Is rehash in progress?" displayType="detail" units="none" dataType="trait"
-                   description="Checks whether the node is involved in a rehash." />
-           <metric property="DistributionManager.JoinComplete" displayName="[DistributionManager] Is join completed?" displayType="detail" units="none" dataType="trait"
-                   description="If true, the node has successfully joined the grid and is considered to hold state.  If false, the join process is still in progress." />
-           <metric property="Cache.CacheName" displayName="[Cache] Cache name" displayType="summary" units="none" dataType="trait"
-                   description="Returns the cache name" />
-           <metric property="Cache.CacheStatus" displayName="[Cache] Cache status" displayType="summary" units="none" dataType="trait"
-                   description="Returns the cache status" />
-           <metric property="CacheStore.CacheLoaderStores" displayName="[CacheStore] Number of cache stores" displayType="detail" units="none" dataType="measurement"
-                   description="number of cache loader stores" />
            <metric property="RpcManager.Address" displayName="[RpcManager] Network address" displayType="summary" units="none" dataType="trait"
                    description="The network address associated with this instance" />
            <metric property="RpcManager.Members" displayName="[RpcManager] Cluster members" displayType="summary" units="none" dataType="trait"
                    description="List of members in the cluster" />
+           <metric property="RpcManager.StatisticsEnabled" displayName="[RpcManager] Statistics enabled" displayType="detail" units="none" dataType="trait"
+                   description="Statistics enabled" />
            <metric property="RpcManager.ReplicationCount" displayName="[RpcManager] Number of successfull replications" displayType="summary" units="none" dataType="measurement"
                    description="Number of successful replications" />
            <metric property="RpcManager.ReplicationFailures" displayName="[RpcManager] Number of failed replications" displayType="summary" units="none" dataType="measurement"
                    description="Number of failed replications" />
-           <metric property="RpcManager.StatisticsEnabled" displayName="[RpcManager] Statistics enabled" displayType="detail" units="none" dataType="trait"
-                   description="Statistics enabled" />
-           <metric property="RpcManager.PhysicalAddress" displayName="[RpcManager] Physical network address" displayType="summary" units="none" dataType="trait"
-                   description="The physical network address associated with this instance" />
+           <metric property="RpcManager.PhysicalAddresses" displayName="[RpcManager] Physical network addresses" displayType="summary" units="none" dataType="trait"
+                   description="The physical network addresses associated with this instance" />
            <metric property="RpcManager.ClusterSize" displayName="[RpcManager] Cluster size" displayType="summary" units="none" dataType="measurement"
                    description="Size of the cluster in number of nodes" />
            <metric property="RpcManager.SuccessRatioFloatingPoint" displayName="[RpcManager] Successful replication ratio" displayType="summary" units="percentage" dataType="measurement"
                    description="Successful replications as a ratio of total replications in numeric double format" />
            <metric property="RpcManager.AverageReplicationTime" displayName="[RpcManager] Average time spent in the transport layer" displayType="summary" units="milliseconds" dataType="measurement"
                    description="The average time spent in the transport layer, in milliseconds" />
-           <metric property="DeadlockDetectingLockManager.OverlapWithNotDeadlockAwareLockOwners" displayName="[DeadlockDetectingLockManager] Number of unsolvable deadlock situations" displayType="detail" units="none" dataType="measurement"
-                   description="Number of situtations when we try to determine a deadlock and the other lock owner is e.g. a local tx. In this scenario we cannot run the deadlock detection mechanism" />
-           <metric property="DeadlockDetectingLockManager.LocallyInterruptedTransactions" displayName="[DeadlockDetectingLockManager] Number of interrupted local transactions" displayType="detail" units="none" dataType="measurement"
-                   description="Number of locally originated transactions that were interrupted as a deadlock situation was detected" />
-           <metric property="DeadlockDetectingLockManager.DetectedRemoteDeadlocks" displayName="[DeadlockDetectingLockManager] Number of detected remote deadlocks" displayType="detail" units="none" dataType="measurement"
-                   description="Number of remote deadlocks detected" />
-           <metric property="DeadlockDetectingLockManager.DetectedLocalDeadlocks" displayName="[DeadlockDetectingLockManager] Number of detected local deadlocks" displayType="detail" units="none" dataType="measurement"
-                   description="Number of local detected deadlocks" />
-           <metric property="DeadlockDetectingLockManager.TotalNumberOfDetectedDeadlocks" displayName="[DeadlockDetectingLockManager] Number of total detected deadlocks" displayType="detail" units="none" dataType="measurement"
-                   description="Total number of local detected deadlocks" />
-           <metric property="DeadlockDetectingLockManager.ConcurrencyLevel" displayName="[DeadlockDetectingLockManager] Concurrency level" displayType="detail" units="none" dataType="trait"
-                   description="The concurrency level that the MVCC Lock Manager has been configured with." />
-           <metric property="DeadlockDetectingLockManager.NumberOfLocksHeld" displayName="[DeadlockDetectingLockManager] Number of locks held" displayType="detail" units="none" dataType="measurement"
-                   description="The number of exclusive locks that are held." />
-           <metric property="DeadlockDetectingLockManager.NumberOfLocksAvailable" displayName="[DeadlockDetectingLockManager] Number of locks available" displayType="detail" units="none" dataType="measurement"
-                   description="The number of exclusive locks that are available." />
-           <metric property="Transactions.StatisticsEnabled" displayName="[Transactions] Statistics enabled" displayType="detail" units="none" dataType="trait"
-                   description="Statistics enabled" />
-           <metric property="Transactions.Prepares" displayName="[Transactions] Prepares" displayType="summary" units="none" dataType="measurement"
-                   description="Number of transaction prepares performed since last reset" />
-           <metric property="Transactions.Commits" displayName="[Transactions] Commits" displayType="summary" units="none" dataType="measurement"
-                   description="Number of transaction commits performed since last reset" />
-           <metric property="Transactions.Rollbacks" displayName="[Transactions] Rollbacks" displayType="summary" units="none" dataType="measurement"
-                   description="Number of transaction rollbacks performed since last reset" />
-           <metric property="Invalidation.StatisticsEnabled" displayName="[Invalidation] Statistics enabled" displayType="detail" units="none" dataType="trait"
-                   description="Statistics enabled" />
-           <metric property="Invalidation.Invalidations" displayName="[Invalidation] Number of invalidations" displayType="detail" units="none" dataType="measurement"
-                   description="Number of invalidations" />
 
 
        </service>

Modified: trunk/jopr-plugin/src/test/java/org/infinispan/jopr/InfinispanJoprTest.java
===================================================================
--- trunk/jopr-plugin/src/test/java/org/infinispan/jopr/InfinispanJoprTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/jopr-plugin/src/test/java/org/infinispan/jopr/InfinispanJoprTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -21,8 +21,8 @@
 import org.infinispan.Cache;
 import org.infinispan.config.Configuration;
 import org.infinispan.config.GlobalConfiguration;
-import org.infinispan.manager.CacheManager;
 import org.infinispan.manager.DefaultCacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 
 /**
  * Standalone cache for infinispan testing
@@ -39,7 +39,7 @@
       // org.infinispan:cache-name=[global],jmx-resource=CacheManager
       myGlobalConfig.setJmxDomain("org.infinispan");
       myGlobalConfig.setExposeGlobalJmxStatistics(true);
-      CacheManager manager = new DefaultCacheManager(myGlobalConfig);
+      EmbeddedCacheManager manager = new DefaultCacheManager(myGlobalConfig);
 
       // org.infinispan:cache-name=myCustomcache(local),jmx-resource=CacheMgmgtInterceptor
       // org.infinispan:cache-name=myCustomcache(local),jmx-resource=MvccLockManager

Modified: trunk/lucene-directory/src/test/java/org/infinispan/lucene/DynamicClusterIndexStressTest.java
===================================================================
--- trunk/lucene-directory/src/test/java/org/infinispan/lucene/DynamicClusterIndexStressTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/lucene-directory/src/test/java/org/infinispan/lucene/DynamicClusterIndexStressTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -39,6 +39,7 @@
 import org.apache.lucene.store.LockObtainFailedException;
 import org.infinispan.Cache;
 import org.infinispan.lucene.testutils.ClusteredCacheFactory;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.TestingUtil;
 import org.testng.Assert;
 import org.testng.annotations.AfterClass;
@@ -152,7 +153,8 @@
    }
    
    private static String buildName(Cache cache) {
-      return Thread.currentThread().getName() +  "[" + cache.getCacheManager().getAddress().toString() + "]";
+      EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) cache.getCacheManager();
+      return Thread.currentThread().getName() +  "[" + cacheManager.getAddress().toString() + "]";
    }
 
    private class LuceneUserThread implements Runnable {


Property changes on: trunk/query
___________________________________________________________________
Name: svn:ignore
   - target
.classpath
.project
.settings
*.iml

   + .classpath
.project
target
.settings


Modified: trunk/query/src/test/java/org/infinispan/query/blackbox/BrokenAnnotationTest.java
===================================================================
--- trunk/query/src/test/java/org/infinispan/query/blackbox/BrokenAnnotationTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/query/src/test/java/org/infinispan/query/blackbox/BrokenAnnotationTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -22,7 +22,7 @@
 package org.infinispan.query.blackbox;
 
 import org.infinispan.Cache;
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.query.helper.TestQueryHelperFactory;
 import org.infinispan.query.test.BrokenDocumentId;
 import org.infinispan.query.test.BrokenProvided;
@@ -53,8 +53,8 @@
       TestQueryHelperFactory.createTestQueryHelperInstance(c, BrokenDocumentId.class);
    }
 
-   protected CacheManager createCacheManager() throws Exception {
-      CacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
       c = cm.getCache();
       return cm;
    }

Modified: trunk/query/src/test/java/org/infinispan/query/blackbox/KeyTypeTest.java
===================================================================
--- trunk/query/src/test/java/org/infinispan/query/blackbox/KeyTypeTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/query/src/test/java/org/infinispan/query/blackbox/KeyTypeTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -26,6 +26,7 @@
 import org.infinispan.Cache;
 import org.infinispan.config.Configuration;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.query.CacheQuery;
 import org.infinispan.query.QueryFactory;
 import org.infinispan.query.backend.QueryHelper;
@@ -63,7 +64,7 @@
    }
 
    @Override
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       Configuration c = getDefaultClusteredConfig(LOCAL, true);
       c.setIndexingEnabled(true);
       c.setIndexLocalOnly(false);

Modified: trunk/query/src/test/java/org/infinispan/query/blackbox/LocalCacheTest.java
===================================================================
--- trunk/query/src/test/java/org/infinispan/query/blackbox/LocalCacheTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/query/src/test/java/org/infinispan/query/blackbox/LocalCacheTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -23,6 +23,7 @@
 
 import org.infinispan.config.Configuration;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.query.helper.TestQueryHelperFactory;
 import org.infinispan.query.test.Person;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -42,7 +43,7 @@
       // no op, meant to be overridden
    }
 
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       Configuration c = getDefaultClusteredConfig(LOCAL, true);
       c.setIndexingEnabled(true);
       c.setIndexLocalOnly(false);

Modified: trunk/query/src/test/java/org/infinispan/query/config/DeclarativeConfigTest.java
===================================================================
--- trunk/query/src/test/java/org/infinispan/query/config/DeclarativeConfigTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/query/src/test/java/org/infinispan/query/config/DeclarativeConfigTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -22,7 +22,7 @@
 package org.infinispan.query.config;
 
 import org.apache.lucene.queryParser.ParseException;
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.query.CacheQuery;
 import org.infinispan.query.QueryFactory;
 import org.infinispan.query.backend.QueryHelper;
@@ -43,7 +43,7 @@
    QueryFactory qf;
 
    @Override
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       String config = TestingUtil.INFINISPAN_START_TAG +
             "   <default>\n" +
             "      <indexing enabled=\"true\" indexLocalOnly=\"true\"/>\n" +

Modified: trunk/query/src/test/java/org/infinispan/query/tx/TransactionalQueryTest.java
===================================================================
--- trunk/query/src/test/java/org/infinispan/query/tx/TransactionalQueryTest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/query/src/test/java/org/infinispan/query/tx/TransactionalQueryTest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -26,7 +26,7 @@
 import org.hibernate.search.annotations.ProvidedId;
 import org.infinispan.Cache;
 import org.infinispan.config.Configuration;
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.query.CacheQuery;
 import org.infinispan.query.QueryFactory;
 import org.infinispan.query.backend.QueryHelper;
@@ -40,13 +40,13 @@
 
 @Test(groups = "functional", testName = "query.tx.TransactionalQueryTest")
 public class TransactionalQueryTest extends SingleCacheManagerTest {
-   protected CacheManager m_cacheManager;
+   protected EmbeddedCacheManager m_cacheManager;
    private QueryHelper m_queryHelper;
    private Cache<String, Session> m_cache;
    private TransactionManager m_transactionManager;
 
    @Override
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       Configuration c = getDefaultStandaloneConfig(true);
       c.setIndexingEnabled(true);
       c.setIndexLocalOnly(true);

Modified: trunk/server/core/src/main/scala/org/infinispan/server/core/AbstractProtocolServer.scala
===================================================================
--- trunk/server/core/src/main/scala/org/infinispan/server/core/AbstractProtocolServer.scala	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/server/core/src/main/scala/org/infinispan/server/core/AbstractProtocolServer.scala	2010-05-24 08:58:40 UTC (rev 1830)
@@ -3,8 +3,8 @@
 import java.net.InetSocketAddress
 import transport.netty.{EncoderAdapter, NettyTransport}
 import transport.Transport
-import org.infinispan.manager.CacheManager
 import org.infinispan.server.core.VersionGenerator._
+import org.infinispan.manager.{EmbeddedCacheManager, CacheManager}
 
 /**
  * // TODO: Document this
@@ -17,9 +17,9 @@
    private var masterThreads: Int = _
    private var workerThreads: Int = _
    private var transport: Transport = _
-   private var cacheManager: CacheManager = _
+   private var cacheManager: EmbeddedCacheManager = _
 
-   override def start(host: String, port: Int, cacheManager: CacheManager, masterThreads: Int, workerThreads: Int, idleTimeout: Int) {
+   override def start(host: String, port: Int, cacheManager: EmbeddedCacheManager, masterThreads: Int, workerThreads: Int, idleTimeout: Int) {
       this.host = host
       this.port = port
       this.masterThreads = masterThreads

Modified: trunk/server/core/src/main/scala/org/infinispan/server/core/ProtocolServer.scala
===================================================================
--- trunk/server/core/src/main/scala/org/infinispan/server/core/ProtocolServer.scala	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/server/core/src/main/scala/org/infinispan/server/core/ProtocolServer.scala	2010-05-24 08:58:40 UTC (rev 1830)
@@ -1,7 +1,7 @@
 package org.infinispan.server.core
 
-import org.infinispan.manager.CacheManager
 import transport.{Decoder, Encoder}
+import org.infinispan.manager.{EmbeddedCacheManager}
 
 /**
  * // TODO: Document this
@@ -9,7 +9,7 @@
  * @since 4.1
  */
 trait ProtocolServer {
-   def start(host: String, port: Int, cacheManager: CacheManager, masterThreads: Int, workerThreads: Int, idleTimeout: Int)
+   def start(host: String, port: Int, cacheManager: EmbeddedCacheManager, masterThreads: Int, workerThreads: Int, idleTimeout: Int)
    def stop
    def getEncoder: Encoder
    def getDecoder: Decoder

Modified: trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/Decoder10.scala
===================================================================
--- trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/Decoder10.scala	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/Decoder10.scala	2010-05-24 08:58:40 UTC (rev 1830)
@@ -3,7 +3,6 @@
 import org.infinispan.server.core.Operation._
 import HotRodOperation._
 import OperationStatus._
-import org.infinispan.manager.CacheManager
 import org.infinispan.server.core.transport.{ChannelBuffer}
 import org.infinispan.Cache
 import org.infinispan.stats.Stats
@@ -13,6 +12,7 @@
 import org.infinispan.util.concurrent.TimeoutException
 import java.io.IOException
 import org.infinispan.context.Flag.SKIP_REMOTE_LOOKUP
+import org.infinispan.manager.EmbeddedCacheManager
 
 /**
  * HotRod protocol decoder specific for specification version 1.0.
@@ -20,7 +20,7 @@
  * @author Galder Zamarreño
  * @since 4.1
  */
-class Decoder10(cacheManager: CacheManager) extends AbstractVersionedDecoder {
+class Decoder10(cacheManager: EmbeddedCacheManager) extends AbstractVersionedDecoder {
    import RequestResolver._
    import ResponseResolver._
    import OperationResponse._

Modified: trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/HotRodDecoder.scala
===================================================================
--- trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/HotRodDecoder.scala	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/HotRodDecoder.scala	2010-05-24 08:58:40 UTC (rev 1830)
@@ -4,7 +4,7 @@
 import org.infinispan.server.core._
 import transport._
 import OperationStatus._
-import org.infinispan.manager.{DefaultCacheManager, CacheManager}
+import org.infinispan.manager.{DefaultCacheManager, EmbeddedCacheManager}
 import java.io.StreamCorruptedException
 import org.infinispan.server.hotrod.ProtocolFlag._
 import org.infinispan.server.hotrod.OperationResponse._
@@ -16,7 +16,7 @@
  * @author Galder Zamarreño
  * @since 4.1
  */
-class HotRodDecoder(cacheManager: CacheManager) extends AbstractProtocolDecoder[CacheKey, CacheValue] {
+class HotRodDecoder(cacheManager: EmbeddedCacheManager) extends AbstractProtocolDecoder[CacheKey, CacheValue] {
    import HotRodDecoder._
    import HotRodServer.TopologyCacheName
    

Modified: trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/HotRodServer.scala
===================================================================
--- trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/HotRodServer.scala	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/HotRodServer.scala	2010-05-24 08:58:40 UTC (rev 1830)
@@ -1,6 +1,5 @@
 package org.infinispan.server.hotrod
 
-import org.infinispan.manager.CacheManager
 import org.infinispan.server.core.transport.{Decoder, Encoder}
 import org.infinispan.server.core.{Logging, AbstractProtocolServer}
 import org.infinispan.config.Configuration
@@ -13,7 +12,8 @@
 import java.util.Random
 import org.infinispan.util.Util
 import org.infinispan.{CacheException, Cache}
-import org.infinispan.remoting.transport.Address;
+import org.infinispan.remoting.transport.Address
+import org.infinispan.manager.EmbeddedCacheManager;
 
 /**
  * // TODO: Document this
@@ -34,7 +34,7 @@
 
    override def getDecoder: Decoder = new HotRodDecoder(getCacheManager)
 
-   override def start(host: String, port: Int, cacheManager: CacheManager, masterThreads: Int, workerThreads: Int, idleTimeout: Int) {
+   override def start(host: String, port: Int, cacheManager: EmbeddedCacheManager, masterThreads: Int, workerThreads: Int, idleTimeout: Int) {
       super.start(host, port, cacheManager, masterThreads, workerThreads, idleTimeout)
       // Start defined caches to avoid issues with lazily started caches
       for (cacheName <- asIterator(cacheManager.getCacheNames.iterator))
@@ -46,7 +46,7 @@
          addSelfToTopologyView(host, port, cacheManager)
    }
 
-   private def addSelfToTopologyView(host: String, port: Int, cacheManager: CacheManager) {
+   private def addSelfToTopologyView(host: String, port: Int, cacheManager: EmbeddedCacheManager) {
       defineTopologyCacheConfig(cacheManager)
       topologyCache = cacheManager.getCache(TopologyCacheName)
       address = TopologyAddress(host, port, Map.empty, cacheManager.getAddress)
@@ -116,7 +116,7 @@
       }
    }
 
-   protected def defineTopologyCacheConfig(cacheManager: CacheManager) {
+   protected def defineTopologyCacheConfig(cacheManager: EmbeddedCacheManager) {
       val topologyCacheConfig = new Configuration
       topologyCacheConfig.setCacheMode(CacheMode.REPL_SYNC)
       topologyCacheConfig.setSyncReplTimeout(10000) // Milliseconds

Modified: trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodIdleTimeoutTest.scala
===================================================================
--- trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodIdleTimeoutTest.scala	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodIdleTimeoutTest.scala	2010-05-24 08:58:40 UTC (rev 1830)
@@ -4,8 +4,8 @@
 import java.lang.reflect.Method
 import test.HotRodTestingUtil._
 import org.testng.Assert._
-import org.infinispan.manager.CacheManager
 import test.{HotRodClient, UniquePortThreadLocal}
+import org.infinispan.manager.{EmbeddedCacheManager, CacheManager}
 
 /**
  * // TODO: Document this
@@ -15,7 +15,7 @@
 @Test(groups = Array("functional"), testName = "server.hotrod.HotRodIdleTimeoutTest")
 class HotRodIdleTimeoutTest extends HotRodSingleNodeTest {
 
-   override protected def createStartHotRodServer(cacheManager: CacheManager) =
+   override protected def createStartHotRodServer(cacheManager: EmbeddedCacheManager) =
       startHotRodServer(cacheManager, UniquePortThreadLocal.get.intValue, 5)
 
    override protected def connectClient = new HotRodClient("127.0.0.1", server.getPort, cacheName, 10)

Modified: trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodSingleNodeTest.scala
===================================================================
--- trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodSingleNodeTest.scala	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodSingleNodeTest.scala	2010-05-24 08:58:40 UTC (rev 1830)
@@ -4,11 +4,11 @@
 import org.infinispan.server.core.CacheValue
 import test.HotRodClient
 import org.infinispan.AdvancedCache
-import org.infinispan.manager.CacheManager
 import test.HotRodTestingUtil._
 import org.testng.annotations.AfterClass
 import org.jboss.netty.channel.ChannelFuture
 import org.infinispan.test.fwk.TestCacheManagerFactory
+import org.infinispan.manager.EmbeddedCacheManager
 
 /**
  * // TODO: Document this
@@ -22,7 +22,7 @@
    private var advancedCache: AdvancedCache[CacheKey, CacheValue] = _
    private var hotRodJmxDomain = getClass.getSimpleName
    
-   override def createCacheManager: CacheManager = {
+   override def createCacheManager: EmbeddedCacheManager = {
       val cacheManager = createTestCacheManager
       cacheManager.defineConfiguration(cacheName, cacheManager.getDefaultConfiguration)
       advancedCache = cacheManager.getCache[CacheKey, CacheValue](cacheName).getAdvancedCache
@@ -31,9 +31,9 @@
       cacheManager
    }
 
-   protected def createTestCacheManager: CacheManager = TestCacheManagerFactory.createLocalCacheManager(true)
+   protected def createTestCacheManager: EmbeddedCacheManager = TestCacheManagerFactory.createLocalCacheManager(true)
 
-   protected def createStartHotRodServer(cacheManager: CacheManager) = startHotRodServer(cacheManager)
+   protected def createStartHotRodServer(cacheManager: EmbeddedCacheManager) = startHotRodServer(cacheManager)
 
    @AfterClass(alwaysRun = true)
    override def destroyAfterClass {

Modified: trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodStatsTest.scala
===================================================================
--- trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodStatsTest.scala	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/HotRodStatsTest.scala	2010-05-24 08:58:40 UTC (rev 1830)
@@ -5,7 +5,7 @@
 import org.infinispan.test.fwk.TestCacheManagerFactory
 import java.lang.reflect.Method
 import org.testng.Assert._
-import org.infinispan.manager.CacheManager
+import org.infinispan.manager.EmbeddedCacheManager
 
 /**
  * // TODO: Document this
@@ -15,7 +15,7 @@
 @Test(groups = Array("functional"), testName = "server.hotrod.FunctionalTest")
 class HotRodStatsTest extends HotRodSingleNodeTest {
 
-   override def createTestCacheManager: CacheManager = TestCacheManagerFactory.createCacheManagerEnforceJmxDomain(jmxDomain)
+   override def createTestCacheManager: EmbeddedCacheManager = TestCacheManagerFactory.createCacheManagerEnforceJmxDomain(jmxDomain)
 
    def testStats(m: Method) {
       var s = client.stats

Modified: trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/test/HotRodTestingUtil.scala
===================================================================
--- trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/test/HotRodTestingUtil.scala	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/test/HotRodTestingUtil.scala	2010-05-24 08:58:40 UTC (rev 1830)
@@ -1,7 +1,6 @@
 package org.infinispan.server.hotrod.test
 
 import java.util.concurrent.atomic.AtomicInteger
-import org.infinispan.manager.CacheManager
 import java.lang.reflect.Method
 import org.infinispan.server.core.Logging
 import java.util.Arrays
@@ -11,6 +10,7 @@
 import org.infinispan.server.hotrod._
 import org.infinispan.config.Configuration.CacheMode
 import org.infinispan.config.Configuration
+import org.infinispan.manager.EmbeddedCacheManager
 
 /**
  * // TODO: Document this
@@ -23,16 +23,16 @@
 
    def host = "127.0.0.1"
 
-   def startHotRodServer(manager: CacheManager): HotRodServer =
+   def startHotRodServer(manager: EmbeddedCacheManager): HotRodServer =
       startHotRodServer(manager, UniquePortThreadLocal.get.intValue)
 
-   def startHotRodServer(manager: CacheManager, port: Int): HotRodServer =
+   def startHotRodServer(manager: EmbeddedCacheManager, port: Int): HotRodServer =
       startHotRodServer(manager, port, 0)
 
-   def startHotRodServer(manager: CacheManager, port: Int, idleTimeout: Int): HotRodServer = {
+   def startHotRodServer(manager: EmbeddedCacheManager, port: Int, idleTimeout: Int): HotRodServer = {
       val server = new HotRodServer {
          import HotRodServer._
-         override protected def defineTopologyCacheConfig(cacheManager: CacheManager) {
+         override protected def defineTopologyCacheConfig(cacheManager: EmbeddedCacheManager) {
             cacheManager.defineConfiguration(TopologyCacheName, createTopologyCacheConfig)
          }
       }
@@ -40,10 +40,10 @@
       server
    }
 
-   def startCrashingHotRodServer(manager: CacheManager, port: Int): HotRodServer = {
+   def startCrashingHotRodServer(manager: EmbeddedCacheManager, port: Int): HotRodServer = {
       val server = new HotRodServer {
          import HotRodServer._
-         override protected def defineTopologyCacheConfig(cacheManager: CacheManager) {
+         override protected def defineTopologyCacheConfig(cacheManager: EmbeddedCacheManager) {
             cacheManager.defineConfiguration(TopologyCacheName, createTopologyCacheConfig)
          }
 

Modified: trunk/server/memcached/src/test/scala/org/infinispan/server/memcached/MemcachedSingleNodeTest.scala
===================================================================
--- trunk/server/memcached/src/test/scala/org/infinispan/server/memcached/MemcachedSingleNodeTest.scala	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/server/memcached/src/test/scala/org/infinispan/server/memcached/MemcachedSingleNodeTest.scala	2010-05-24 08:58:40 UTC (rev 1830)
@@ -2,10 +2,10 @@
 
 import test.MemcachedTestingUtil
 import org.infinispan.test.SingleCacheManagerTest
-import org.infinispan.manager.CacheManager
 import org.infinispan.test.fwk.TestCacheManagerFactory
 import net.spy.memcached.MemcachedClient
 import org.testng.annotations.{Test, AfterClass}
+import org.infinispan.manager.EmbeddedCacheManager
 
 /**
  * // TODO: Document this
@@ -17,14 +17,14 @@
    private var memcachedServer: MemcachedServer = _
    private val operationTimeout: Int = 60
 
-   override def createCacheManager: CacheManager = {
+   override def createCacheManager: EmbeddedCacheManager = {
       cacheManager = createTestCacheManager
       memcachedServer = startMemcachedTextServer(cacheManager)
       memcachedClient = createMemcachedClient(60000, server.getPort)
       return cacheManager
    }
 
-   protected def createTestCacheManager: CacheManager = TestCacheManagerFactory.createLocalCacheManager
+   protected def createTestCacheManager: EmbeddedCacheManager = TestCacheManagerFactory.createLocalCacheManager
 
    @AfterClass(alwaysRun = true)
    override def destroyAfterClass {

Modified: trunk/server/memcached/src/test/scala/org/infinispan/server/memcached/MemcachedStatsTest.scala
===================================================================
--- trunk/server/memcached/src/test/scala/org/infinispan/server/memcached/MemcachedStatsTest.scala	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/server/memcached/src/test/scala/org/infinispan/server/memcached/MemcachedStatsTest.scala	2010-05-24 08:58:40 UTC (rev 1830)
@@ -1,13 +1,13 @@
 package org.infinispan.server.memcached
 
 import org.testng.annotations.Test
-import org.infinispan.manager.CacheManager
 import org.infinispan.test.fwk.TestCacheManagerFactory
 import java.lang.reflect.Method
 import org.testng.Assert._
 import java.util.concurrent.TimeUnit
 import org.infinispan.Version
 import org.infinispan.test.TestingUtil
+import org.infinispan.manager.EmbeddedCacheManager
 
 /**
  * // TODO: Document this
@@ -18,7 +18,7 @@
 class MemcachedStatsTest extends MemcachedSingleNodeTest {
    private var jmxDomain = classOf[MemcachedStatsTest].getSimpleName
 
-   override def createTestCacheManager: CacheManager = TestCacheManagerFactory.createCacheManagerEnforceJmxDomain(jmxDomain)
+   override def createTestCacheManager: EmbeddedCacheManager = TestCacheManagerFactory.createCacheManagerEnforceJmxDomain(jmxDomain)
 
    def testUnsupportedStats(m: Method) {
       val stats = getStats

Modified: trunk/server/memcached/src/test/scala/org/infinispan/server/memcached/test/MemcachedTestingUtil.scala
===================================================================
--- trunk/server/memcached/src/test/scala/org/infinispan/server/memcached/test/MemcachedTestingUtil.scala	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/server/memcached/src/test/scala/org/infinispan/server/memcached/test/MemcachedTestingUtil.scala	2010-05-24 08:58:40 UTC (rev 1830)
@@ -5,9 +5,9 @@
 import java.util.Arrays
 import java.net.InetSocketAddress
 import java.util.concurrent.atomic.AtomicInteger
-import org.infinispan.manager.CacheManager
 import org.infinispan.server.core.transport.Decoder
 import org.infinispan.server.memcached.{MemcachedDecoder, MemcachedValue, MemcachedServer}
+import org.infinispan.manager.EmbeddedCacheManager
 
 /**
  * // TODO: Document this
@@ -32,20 +32,20 @@
       return new MemcachedClient(d, Arrays.asList(new InetSocketAddress(host, port)))
    }
 
-   def startMemcachedTextServer(cacheManager: CacheManager): MemcachedServer =
+   def startMemcachedTextServer(cacheManager: EmbeddedCacheManager): MemcachedServer =
       startMemcachedTextServer(cacheManager, UniquePortThreadLocal.get.intValue)
 
-   def startMemcachedTextServer(cacheManager: CacheManager, port: Int): MemcachedServer = {
+   def startMemcachedTextServer(cacheManager: EmbeddedCacheManager, port: Int): MemcachedServer = {
       val server = new MemcachedServer
       server.start(host, port, cacheManager, 0, 0, 0)
       server
    }
 
-   def startMemcachedTextServer(cacheManager: CacheManager, cacheName: String): MemcachedServer = {
+   def startMemcachedTextServer(cacheManager: EmbeddedCacheManager, cacheName: String): MemcachedServer = {
       startMemcachedTextServer(cacheManager, UniquePortThreadLocal.get.intValue, cacheName)
    }
 
-   def startMemcachedTextServer(cacheManager: CacheManager, port: Int, cacheName: String): MemcachedServer = {
+   def startMemcachedTextServer(cacheManager: EmbeddedCacheManager, port: Int, cacheName: String): MemcachedServer = {
       val server = new MemcachedServer {
          override def getDecoder: Decoder =
             new MemcachedDecoder(getCacheManager.getCache[String, MemcachedValue](cacheName), scheduler)

Modified: trunk/server/rest/src/main/scala/org/infinispan/rest/Server.scala
===================================================================
--- trunk/server/rest/src/main/scala/org/infinispan/rest/Server.scala	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/server/rest/src/main/scala/org/infinispan/rest/Server.scala	2010-05-24 08:58:40 UTC (rev 1830)
@@ -128,7 +128,7 @@
  * Just wrap a single instance of the Infinispan cache manager. 
  */
 object ManagerInstance {
-   var instance: CacheManager = null
+   var instance: EmbeddedCacheManager = null
    def getCache(name: String) = {
       instance.getCache(name).asInstanceOf[Cache[String, Any]]
    }

Modified: trunk/server/websocket/src/main/java/org/infinispan/server/websocket/WebSocketServer.java
===================================================================
--- trunk/server/websocket/src/main/java/org/infinispan/server/websocket/WebSocketServer.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/server/websocket/src/main/java/org/infinispan/server/websocket/WebSocketServer.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -34,6 +34,7 @@
 
 import org.infinispan.Cache;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.server.core.AbstractProtocolServer;
 import org.infinispan.server.websocket.handlers.GetHandler;
 import org.infinispan.server.websocket.handlers.NotifyHandler;
@@ -76,7 +77,7 @@
    }
 
    @Override
-   public void start(String host, int port, CacheManager cacheManager, int masterThreads, int workerThreads,
+   public void start(String host, int port, EmbeddedCacheManager cacheManager, int masterThreads, int workerThreads,
                      int idleTimeout) {
       InetSocketAddress address = new InetSocketAddress(host, port);
 

Modified: trunk/tree/src/test/java/org/infinispan/api/tree/NodeAPITest.java
===================================================================
--- trunk/tree/src/test/java/org/infinispan/api/tree/NodeAPITest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/tree/src/test/java/org/infinispan/api/tree/NodeAPITest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -2,6 +2,7 @@
 
 import org.infinispan.config.Configuration;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -35,11 +36,11 @@
    TreeCache cache;
 
    @Override
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       // start a single cache instance
       Configuration c = getDefaultStandaloneConfig(true);
       c.setInvocationBatchingEnabled(true);
-      CacheManager cm = TestCacheManagerFactory.createCacheManager(c, true);
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(c, true);
       cache = new TreeCacheImpl(cm.getCache());
       tm = TestingUtil.getTransactionManager(cache.getCache());
       return cm;

Modified: trunk/tree/src/test/java/org/infinispan/api/tree/NodeMoveAPITest.java
===================================================================
--- trunk/tree/src/test/java/org/infinispan/api/tree/NodeMoveAPITest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/tree/src/test/java/org/infinispan/api/tree/NodeMoveAPITest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -5,7 +5,7 @@
 import org.infinispan.container.DataContainer;
 import org.infinispan.context.InvocationContextContainer;
 import org.infinispan.factories.ComponentRegistry;
-import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -16,13 +16,14 @@
 import org.infinispan.util.concurrent.locks.LockManager;
 import org.infinispan.util.logging.Log;
 import org.infinispan.util.logging.LogFactory;
-import static org.testng.AssertJUnit.*;
 import org.testng.annotations.Test;
 
 import javax.transaction.TransactionManager;
 import java.util.Random;
 import java.util.concurrent.CountDownLatch;
 
+import static org.testng.AssertJUnit.*;
+
 /**
  * Excercises and tests the new move() api
  *
@@ -46,8 +47,8 @@
    TransactionManager tm;
    DataContainer dc;
 
-   protected CacheManager createCacheManager() throws Exception {
-      CacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
       Configuration c = new Configuration();
       c.setFetchInMemoryState(false);
       c.setInvocationBatchingEnabled(true);

Modified: trunk/tree/src/test/java/org/infinispan/api/tree/TreeCacheAPITest.java
===================================================================
--- trunk/tree/src/test/java/org/infinispan/api/tree/TreeCacheAPITest.java	2010-05-21 15:49:11 UTC (rev 1829)
+++ trunk/tree/src/test/java/org/infinispan/api/tree/TreeCacheAPITest.java	2010-05-24 08:58:40 UTC (rev 1830)
@@ -5,6 +5,7 @@
 import org.infinispan.atomic.AtomicMapLookup;
 import org.infinispan.config.Configuration;
 import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.test.SingleCacheManagerTest;
 import org.infinispan.test.TestingUtil;
 import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -38,12 +39,12 @@
    private Log log = LogFactory.getLog(TreeCacheAPITest.class);
 
    @Override
-   protected CacheManager createCacheManager() throws Exception {
+   protected EmbeddedCacheManager createCacheManager() throws Exception {
       // start a single cache instance
       Configuration c = new Configuration();
       c.setTransactionManagerLookupClass(TransactionSetup.getManagerLookup());
       c.setInvocationBatchingEnabled(true);
-      CacheManager cm = TestCacheManagerFactory.createCacheManager(c);
+      EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(c);
 
       Cache flatcache = cm.getCache();
       cache = new TreeCacheImpl(flatcache);
@@ -164,7 +165,7 @@
    }
 
    public void testRpcManagerElements() {
-      assertEquals("CacheMode.LOCAL cache has no address", null, cache.getCache().getCacheManager().getAddress());
-      assertEquals("CacheMode.LOCAL cache has no members list", null, cache.getCache().getCacheManager().getMembers());
+      assertEquals("CacheMode.LOCAL cache has no address", null, manager(cache.getCache()).getAddress());
+      assertEquals("CacheMode.LOCAL cache has no members list", null, manager(cache.getCache()).getMembers());
    }
 }



More information about the infinispan-commits mailing list