[jbosscache-commits] JBoss Cache SVN: r7672 - in core/branches/flat/src: main/java/org/horizon and 11 other directories.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Tue Feb 10 06:54:45 EST 2009


Author: manik.surtani at jboss.com
Date: 2009-02-10 06:54:44 -0500 (Tue, 10 Feb 2009)
New Revision: 7672

Added:
   core/branches/flat/src/main/java/org/horizon/lifecycle/ComponentStatus.java
Removed:
   core/branches/flat/src/main/java/org/horizon/ComponentStatus.java
   core/branches/flat/src/main/java/org/horizon/factories/annotations/Destroy.java
Modified:
   core/branches/flat/src/main/docbook/userguide/en/modules/cache_loaders.xml
   core/branches/flat/src/main/java/org/horizon/Cache.java
   core/branches/flat/src/main/java/org/horizon/CacheDelegate.java
   core/branches/flat/src/main/java/org/horizon/config/AbstractNamedCacheConfigurationBean.java
   core/branches/flat/src/main/java/org/horizon/config/GlobalConfiguration.java
   core/branches/flat/src/main/java/org/horizon/factories/AbstractComponentRegistry.java
   core/branches/flat/src/main/java/org/horizon/factories/ComponentRegistry.java
   core/branches/flat/src/main/java/org/horizon/lifecycle/Lifecycle.java
   core/branches/flat/src/main/java/org/horizon/manager/CacheManager.java
   core/branches/flat/src/main/java/org/horizon/manager/DefaultCacheManager.java
   core/branches/flat/src/main/java/org/horizon/marshall/Marshaller.java
   core/branches/flat/src/main/java/org/horizon/notifications/AbstractListenerImpl.java
   core/branches/flat/src/main/java/org/horizon/tree/TreeCache.java
   core/branches/flat/src/main/java/org/horizon/util/TestingUtil.java
   core/branches/flat/src/test/java/org/horizon/config/parsing/ConfigurationParserTest.java
   core/branches/flat/src/test/java/org/horizon/manager/CacheManagerTest.java
Log:
ComponentStatus changes

Modified: core/branches/flat/src/main/docbook/userguide/en/modules/cache_loaders.xml
===================================================================
--- core/branches/flat/src/main/docbook/userguide/en/modules/cache_loaders.xml	2009-02-09 21:28:30 UTC (rev 7671)
+++ core/branches/flat/src/main/docbook/userguide/en/modules/cache_loaders.xml	2009-02-10 11:54:44 UTC (rev 7672)
@@ -147,7 +147,7 @@
          details.
       </para>
 
-      <programlisting role="XML"><![CDATA[<![CDATA[<![CDATA[
+      <programlisting role="XML"><![CDATA[
 ...
 
 <!-- Cache loader config block -->
@@ -198,7 +198,7 @@
             <!-- implementation class for singleton store functionality which must extend
                  org.jboss.cache.loader.AbstractDelegatingCacheLoader. Default implementation
            org.horizon.loader.SingletonStoreCacheLoadercheLoader -->
-            <class>org.horizon.loader.SingletonStoreCacheLoader</class>
+            <class>org.horizon.loader.SingletonStoreCacheLoaderOld</class>
 
             <!-- properties and default values for the default singleton store functionality
                  implementation -->
@@ -211,7 +211,8 @@
 
    </config>
 </attribute>
-]]>]]>]]></programlisting>
+]]>]]>]]>]]>
+      </programlisting>
 
       <para>The
          <literal>class</literal>
@@ -377,7 +378,7 @@
             singleton store functionality. This class must extend
             <literal>org.jboss.cache.loader.AbstractDelegatingCacheLoader</literal>
             , and if absent, it defaults to
-            <literal>org.horizon.loader.SingletonStoreCacheLoader</literal>
+            <literal>org.horizon.loader.SingletonStoreCacheLoaderOld</literal>
             .
          </para>
 
@@ -983,7 +984,9 @@
             </programlisting>
             If you do not use Maven, you can still download the
             amazon-s3 library by navigating the repository or through
-            <ulink url="http://e-xml.sourceforge.net/maven2/repository/net/noderunner/amazon-s3/1.0.0.0/amazon-s3-1.0.0.0.jar">this URL</ulink>.
+            <ulink
+                  url="http://e-xml.sourceforge.net/maven2/repository/net/noderunner/amazon-s3/1.0.0.0/amazon-s3-1.0.0.0.jar">
+               this URL</ulink>.
          </section>
 
          <section>
@@ -1026,22 +1029,22 @@
                      Name of the bucket to store data.
                      For different caches using the same access key, use a different bucket name.
                      Read the S3 documentation on the definition of a bucket.
-                     The default value is <literal>jboss-cache</literal>.
+                     The default value is<literal>jboss-cache</literal>.
                   </listitem>
 
                   <listitem>
                      <literal>cache.s3.callingFormat</literal>
                      -
-                     One of <literal>PATH</literal>, <literal>SUBDOMAIN</literal>, or
+                     One of<literal>PATH</literal>,<literal>SUBDOMAIN</literal>, or
                      <literal>VANITY</literal>.
                      Read the S3 documentation on the use of calling domains.
-                     The default value is <literal>SUBDOMAIN</literal>.
+                     The default value is<literal>SUBDOMAIN</literal>.
                   </listitem>
 
                   <listitem>
                      <literal>cache.s3.optimize</literal>
                      -
-                     The default is <literal>false</literal>.
+                     The default is<literal>false</literal>.
                      If true,
                      <literal>put(Map)</literal>
                      operations
@@ -1053,7 +1056,7 @@
                   <listitem>
                      <literal>cache.s3.parentCache</literal>
                      -
-                     The default is <literal>true</literal>.
+                     The default is<literal>true</literal>.
                      Set this value to
                      <literal>false</literal>
                      if you are using multiple caches
@@ -1078,9 +1081,10 @@
                      -
                      This choses a primary storage location for your data
                      to reduce loading and retrevial latency.
-                     Set to <literal>EU</literal>
+                     Set to
+                     <literal>EU</literal>
                      to store data in Europe.
-                     The default is <literal>null</literal>, to store data in
+                     The default is<literal>null</literal>, to store data in
                      the United States.
                   </listitem>
                </itemizedlist>

Modified: core/branches/flat/src/main/java/org/horizon/Cache.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/Cache.java	2009-02-09 21:28:30 UTC (rev 7671)
+++ core/branches/flat/src/main/java/org/horizon/Cache.java	2009-02-10 11:54:44 UTC (rev 7672)
@@ -22,6 +22,7 @@
 package org.horizon;
 
 import org.horizon.config.Configuration;
+import org.horizon.lifecycle.ComponentStatus;
 import org.horizon.lifecycle.Lifecycle;
 import org.horizon.manager.CacheManager;
 import org.horizon.notifications.Listenable;
@@ -56,7 +57,7 @@
     *
     * @param key   key with which the specified value is to be associated.
     * @param value value to be associated with the specified key.
-    * @throws IllegalStateException if {@link #getCacheStatus()} would not return {@link ComponentStatus#STARTED}.
+    * @throws IllegalStateException if {@link #getStatus()} would not return {@link org.horizon.lifecycle.ComponentStatus#STARTED}.
     */
    void putForExternalRead(K key, V value);
 
@@ -64,8 +65,6 @@
 
    Configuration getConfiguration();
 
-   ComponentStatus getCacheStatus();
-
    /**
     * @return true if a batch was successfully started; false if one was available and already running.
     */
@@ -140,4 +139,6 @@
    boolean replace(K key, V oldValue, V value, long lifespan, TimeUnit unit);
 
    AdvancedCache<K, V> getAdvancedCache();
+
+   ComponentStatus getStatus();
 }

Modified: core/branches/flat/src/main/java/org/horizon/CacheDelegate.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/CacheDelegate.java	2009-02-09 21:28:30 UTC (rev 7671)
+++ core/branches/flat/src/main/java/org/horizon/CacheDelegate.java	2009-02-10 11:54:44 UTC (rev 7672)
@@ -46,6 +46,7 @@
 import org.horizon.interceptors.base.CommandInterceptor;
 import org.horizon.invocation.InvocationContextContainer;
 import org.horizon.invocation.Options;
+import org.horizon.lifecycle.ComponentStatus;
 import org.horizon.logging.Log;
 import org.horizon.logging.LogFactory;
 import org.horizon.manager.CacheManager;
@@ -347,8 +348,8 @@
       return get(key);
    }
 
-   public ComponentStatus getCacheStatus() {
-      return componentRegistry.getState();
+   public ComponentStatus getStatus() {
+      return componentRegistry.getStatus();
    }
 
    public boolean startBatch() {

Deleted: core/branches/flat/src/main/java/org/horizon/ComponentStatus.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/ComponentStatus.java	2009-02-09 21:28:30 UTC (rev 7671)
+++ core/branches/flat/src/main/java/org/horizon/ComponentStatus.java	2009-02-10 11:54:44 UTC (rev 7672)
@@ -1,177 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.horizon;
-
-import org.horizon.logging.Log;
-import org.horizon.logging.LogFactory;
-
-/**
- * Various states that an object that has a four stage lifecycle (i.e. <code>create()</code>, <code>start()</code>,
- * <code>stop()</code> and <code>destroy()</code>) might be in.
- *
- * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
- * @since 1.0
- */
-public enum ComponentStatus {
-   /**
-    * Object has been instantiated, but create() has not been called.
-    */
-   INSTANTIATED,
-   /**
-    * The <code>create()</code> method has been called but not yet completed.
-    */
-   CREATING,
-   /**
-    * The <code>create()</code> method has been completed but <code>start()</code> has not been called.
-    */
-   CREATED,
-   /**
-    * The <code>start()</code> method has been called but has not yet completed.
-    */
-   STARTING,
-   /**
-    * The <code>start()</code> method has completed.
-    */
-   STARTED,
-   /**
-    * The <code>stop()</code> method has been called but has not yet completed.
-    */
-   STOPPING,
-   /**
-    * The <code>stop()</code> method has completed but <code>destroy()</code> has not yet been called. Conceptually
-    * equivalent to {@link #CREATED}.
-    */
-   STOPPED,
-   /**
-    * The <code>destroy()</code> method has been called but has not yet completed.
-    */
-   DESTROYING,
-   /**
-    * The <code>destroy()</code> method has completed. Conceptually equivalent to {@link #INSTANTIATED}.
-    */
-   DESTROYED,
-   /**
-    * A failure occurred during the execution of <code>create()</code>, <code>start()</code>, <code>stop()</code> or
-    * <code>destroy()</code>. The next logical transition is to call <code>destroy()</code>.
-    */
-   FAILED;
-
-   private static final Log log = LogFactory.getLog(ComponentStatus.class);
-
-   public boolean createAllowed() {
-      switch (this) {
-         case CREATING:
-         case CREATED:
-         case STARTING:
-         case STARTED:
-         case STOPPED:
-         case FAILED:
-         case STOPPING:
-         case DESTROYING:
-            return false;
-         default:
-            return true;
-      }
-   }
-
-   public boolean needToDestroyFailedCache() {
-      return this == ComponentStatus.FAILED;
-   }
-
-   public boolean startAllowed() {
-      switch (this) {
-         case INSTANTIATED:
-         case DESTROYED:
-         case STARTING:
-         case STARTED:
-         case FAILED:
-         case STOPPING:
-         case DESTROYING:
-            return false;
-         default:
-            return true;
-      }
-   }
-
-   public boolean needCreateBeforeStart() {
-      switch (this) {
-         case INSTANTIATED:
-         case DESTROYED:
-            return true;
-         default:
-            return false;
-      }
-   }
-
-   public boolean stopAllowed() {
-      switch (this) {
-         case INSTANTIATED:
-         case CREATED:
-         case STOPPED:
-         case DESTROYED:
-            log.debug("Ignoring call to stop() as current state is " + this);
-            return false;
-         case CREATING:
-         case STARTING:
-         case STOPPING:
-         case DESTROYING:
-            log.warn("Ignoring call to stop() as current state is " + this);
-            return false;
-         case FAILED:
-         case STARTED:
-         default:
-            return true;
-      }
-
-   }
-
-   public boolean destroyAllowed() {
-      switch (this) {
-         case INSTANTIATED:
-         case DESTROYED:
-            log.debug("Ignoring call to destroy() as current state is " + this);
-            return false;
-         case CREATING:
-         case STARTING:
-         case STOPPING:
-         case DESTROYING:
-            log.warn("Ignoring call to destroy() as current state iswhile cache is " + this);
-            return false;
-         case STARTED:
-            // stop first
-            return false;
-         case CREATED:
-         case STOPPED:
-         case FAILED:
-         default:
-            return true;
-      }
-   }
-
-   public boolean needStopBeforeDestroy() {
-      return this == ComponentStatus.STARTED;
-   }
-
-   public boolean allowInvocations() {
-      return (this == ComponentStatus.STARTED);
-   }
-}

Modified: core/branches/flat/src/main/java/org/horizon/config/AbstractNamedCacheConfigurationBean.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/config/AbstractNamedCacheConfigurationBean.java	2009-02-09 21:28:30 UTC (rev 7671)
+++ core/branches/flat/src/main/java/org/horizon/config/AbstractNamedCacheConfigurationBean.java	2009-02-10 11:54:44 UTC (rev 7672)
@@ -1,10 +1,10 @@
 package org.horizon.config;
 
-import org.horizon.ComponentStatus;
 import org.horizon.factories.ComponentRegistry;
 import org.horizon.factories.annotations.Inject;
 import org.horizon.factories.scopes.Scope;
 import org.horizon.factories.scopes.Scopes;
+import org.horizon.lifecycle.ComponentStatus;
 
 /**
  * Adds named cache specific features to the {@link org.horizon.config.AbstractConfigurationBean}.
@@ -23,6 +23,6 @@
    }
 
    protected boolean hasComponentStarted() {
-      return cr != null && cr.getState() != null && cr.getState() == ComponentStatus.STARTED;
+      return cr != null && cr.getStatus() != null && cr.getStatus() == ComponentStatus.RUNNING;
    }
 }

Modified: core/branches/flat/src/main/java/org/horizon/config/GlobalConfiguration.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/config/GlobalConfiguration.java	2009-02-09 21:28:30 UTC (rev 7671)
+++ core/branches/flat/src/main/java/org/horizon/config/GlobalConfiguration.java	2009-02-10 11:54:44 UTC (rev 7672)
@@ -1,7 +1,6 @@
 package org.horizon.config;
 
 import org.horizon.CacheException;
-import org.horizon.ComponentStatus;
 import org.horizon.Version;
 import org.horizon.executors.DefaultExecutorFactory;
 import org.horizon.executors.DefaultScheduledExecutorFactory;
@@ -10,6 +9,7 @@
 import org.horizon.factories.annotations.NonVolatile;
 import org.horizon.factories.scopes.Scope;
 import org.horizon.factories.scopes.Scopes;
+import org.horizon.lifecycle.ComponentStatus;
 import org.horizon.marshall.VersionAwareMarshaller;
 import org.horizon.remoting.transport.jgroups.JGroupsTransport;
 import org.horizon.util.TypedProperties;
@@ -75,7 +75,7 @@
    }
 
    protected boolean hasComponentStarted() {
-      return gcr != null && gcr.getState() != null && gcr.getState() == ComponentStatus.STARTED;
+      return gcr != null && gcr.getStatus() != null && gcr.getStatus() == ComponentStatus.RUNNING;
    }
 
    public String getAsyncListenerExecutorFactoryClass() {

Modified: core/branches/flat/src/main/java/org/horizon/factories/AbstractComponentRegistry.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/factories/AbstractComponentRegistry.java	2009-02-09 21:28:30 UTC (rev 7671)
+++ core/branches/flat/src/main/java/org/horizon/factories/AbstractComponentRegistry.java	2009-02-10 11:54:44 UTC (rev 7672)
@@ -22,20 +22,19 @@
 package org.horizon.factories;
 
 import org.horizon.CacheException;
-import org.horizon.ComponentStatus;
 import org.horizon.Version;
 import org.horizon.config.Configuration;
 import org.horizon.config.ConfigurationException;
 import org.horizon.config.RuntimeConfig;
 import org.horizon.factories.annotations.ComponentName;
 import org.horizon.factories.annotations.DefaultFactoryFor;
-import org.horizon.factories.annotations.Destroy;
 import org.horizon.factories.annotations.Inject;
 import org.horizon.factories.annotations.NonVolatile;
 import org.horizon.factories.annotations.Start;
 import org.horizon.factories.annotations.Stop;
 import org.horizon.factories.scopes.Scope;
 import org.horizon.factories.scopes.Scopes;
+import org.horizon.lifecycle.ComponentStatus;
 import org.horizon.lifecycle.Lifecycle;
 import org.horizon.logging.Log;
 import org.horizon.util.BeanUtils;
@@ -65,13 +64,13 @@
  * <p/>
  * Default factories are treated as components too and will need to be wired before being used.
  * <p/>
- * The registry can exist in one of several states, as defined by the {@link org.horizon.ComponentStatus} enumeration.
- * In terms of the cache, state changes in the following manner: <ul> <li>INSTANTIATED - when first constructed</li>
- * <li>CONSTRUCTED - when created using the DefaultCacheFactory</li> <li>STARTED - when {@link
+ * The registry can exist in one of several states, as defined by the {@link org.horizon.lifecycle.ComponentStatus}
+ * enumeration. In terms of the cache, state changes in the following manner: <ul> <li>INSTANTIATED - when first
+ * constructed</li> <li>CONSTRUCTED - when created using the DefaultCacheFactory</li> <li>STARTED - when {@link
  * org.horizon.Cache#start()} is called</li> <li>STOPPED - when {@link org.horizon.Cache#stop()} is called</li> </ul>
  * <p/>
  * Cache configuration can only be changed and will only be reinjected if the cache is not in the {@link
- * org.horizon.ComponentStatus#STARTED} state.
+ * org.horizon.lifecycle.ComponentStatus#RUNNING} state.
  *
  * @author Manik Surtani (<a href="mailto:manik at jboss.org">manik at jboss.org</a>)
  * @since 1.0
@@ -101,7 +100,7 @@
     *
     * @return state of the registry
     */
-   public ComponentStatus getState() {
+   public ComponentStatus getStatus() {
       return state;
    }
 
@@ -189,7 +188,7 @@
          old.methodsScanned = false;
          c = old;
 
-         if (state == ComponentStatus.STARTED) populateLifecycleMethods();
+         if (state == ComponentStatus.RUNNING) populateLifecycleMethods();
       } else {
          c = new Component();
          c.name = name;
@@ -503,7 +502,6 @@
             c.methodsScanned = true;
             c.startMethods.clear();
             c.stopMethods.clear();
-            c.destroyMethods.clear();
 
             List<Method> methods = ReflectionUtil.getAllMethods(c.instance.getClass(), Start.class);
             for (Method m : methods) {
@@ -522,15 +520,6 @@
                em.priority = m.getAnnotation(Stop.class).priority();
                c.stopMethods.add(em);
             }
-
-            methods = ReflectionUtil.getAllMethods(c.instance.getClass(), Destroy.class);
-            for (Method m : methods) {
-               PrioritizedMethod em = new PrioritizedMethod();
-               em.component = c;
-               em.method = m;
-               em.priority = m.getAnnotation(Destroy.class).priority();
-               c.destroyMethods.add(em);
-            }
          }
       }
    }
@@ -556,15 +545,11 @@
 
    /**
     * Creates the components needed by a cache instance and sets the cache status to {@link
-    * org.horizon.ComponentStatus#CREATED} when it is done.
+    * org.horizon.lifecycle.ComponentStatus#INITIALIZING} when it is done.
     */
-   public void create() {
-      if (!state.createAllowed()) {
-         if (state.needToDestroyFailedCache())
-            destroy();
-         else
-            return;
-      }
+   private void init() {
+      if (state.needToDestroyFailedCache())
+         destroy();
 
       try {
          internalCreate();
@@ -576,16 +561,17 @@
 
    /**
     * This starts the components in the cache, connecting to channels, starting service threads, etc.  If the cache is
-    * not in the {@link org.horizon.ComponentStatus#CREATED} state, {@link #create()} will be invoked first.
+    * not in the {@link org.horizon.lifecycle.ComponentStatus#INITIALIZING} state, {@link #init()} will be invoked
+    * first.
     */
    public void start() {
       boolean createdInStart = false;
       if (!state.startAllowed()) {
          if (state.needToDestroyFailedCache())
-            destroy(); // this will take us back to DESTROYED
+            destroy(); // this will take us back to TERMINATED
 
-         if (state.needCreateBeforeStart()) {
-            create();
+         if (state.needToInitializeBeforeStart()) {
+            init();
             createdInStart = true;
          } else
             return;
@@ -600,8 +586,8 @@
    }
 
    /**
-    * Stops the cache and sets the cache status to {@link org.horizon.ComponentStatus#STOPPED} once it is done.  If the
-    * cache is not in the {@link org.horizon.ComponentStatus#STARTED} state, this is a no-op.
+    * Stops the cache and sets the cache status to {@link org.horizon.lifecycle.ComponentStatus#TERMINATED} once it is
+    * done.  If the cache is not in the {@link org.horizon.lifecycle.ComponentStatus#RUNNING} state, this is a no-op.
     */
    public void stop() {
       if (!state.stopAllowed()) {
@@ -622,36 +608,31 @@
          handleLifecycleTransitionFailure(t);
       }
       finally {
-         if (!failed) state = ComponentStatus.STOPPED;
+         if (!failed) state = ComponentStatus.TERMINATED;
       }
    }
 
    /**
     * Destroys the cache and frees up any resources.  Sets the cache status to {@link
-    * org.horizon.ComponentStatus#DESTROYED} when it is done.
+    * org.horizon.lifecycle.ComponentStatus#TERMINATED} when it is done.
     * <p/>
-    * If the cache is in {@link org.horizon.ComponentStatus#STARTED} when this method is called, it will first call
-    * {@link #stop()} to stop the cache.
+    * If the cache is in {@link org.horizon.lifecycle.ComponentStatus#RUNNING} when this method is called, it will first
+    * call {@link #stop()} to stop the cache.
     */
-   public void destroy() {
-      if (!state.destroyAllowed()) {
-         if (state.needStopBeforeDestroy()) {
-            try {
-               stop();
-            }
-            catch (CacheException e) {
-               getLog().warn("Needed to call stop() before destroying but stop() threw exception. Proceeding to destroy", e);
-            }
-         } else
-            return;
+   private void destroy() {
+      try {
+         stop();
       }
+      catch (CacheException e) {
+         getLog().warn("Needed to call stop() before destroying but stop() threw exception. Proceeding to destroy", e);
+      }
 
       try {
-         internalDestroy();
+         resetNonVolatile();
       }
       finally {
          // We always progress to destroyed
-         state = ComponentStatus.DESTROYED;
+         state = ComponentStatus.TERMINATED;
       }
    }
    // ------------------------------ END: Publicly available lifecycle methods -----------------------------
@@ -680,10 +661,9 @@
     * The actual create implementation.
     */
    private void internalCreate() {
-      state = ComponentStatus.CREATING;
+      state = ComponentStatus.INITIALIZING;
       resetNonVolatile();
       rewire();
-      state = ComponentStatus.CREATED;
    }
 
    private void internalStart(boolean createdInStart) throws CacheException, IllegalArgumentException {
@@ -694,8 +674,6 @@
          rewire();
       }
 
-      state = ComponentStatus.STARTING;
-
       // start all internal components
       // first cache all start, stop and destroy methods.
       populateLifecycleMethods();
@@ -713,8 +691,8 @@
 
       addShutdownHook();
 
-      getLog().info("JBoss Cache version: " + Version.printVersion());
-      state = ComponentStatus.STARTED;
+      getLog().info("Horizon version: " + Version.printVersion());
+      state = ComponentStatus.RUNNING;
    }
 
    protected void addShutdownHook() {
@@ -740,35 +718,15 @@
       // fire all STOP methods according to priority
       for (PrioritizedMethod em : stopMethods) em.invoke();
 
-      state = ComponentStatus.STOPPED;
+      destroy();
    }
 
-   /**
-    * Actual destroy
-    */
-   private void internalDestroy() {
-
-      state = ComponentStatus.DESTROYING;
-
-      resetNonVolatile();
-
-      List<PrioritizedMethod> destroyMethods = new ArrayList<PrioritizedMethod>(componentLookup.size());
-      for (Component c : componentLookup.values()) destroyMethods.addAll(c.destroyMethods);
-
-      Collections.sort(destroyMethods);
-
-      // fire all DESTROY methods according to priority
-      for (PrioritizedMethod em : destroyMethods) em.invoke();
-
-      state = ComponentStatus.DESTROYED;
-   }
-
    // ------------------------------ END: Actual internal lifecycle methods --------------------------------
 
    /**
     * Asserts whether invocations are allowed on the cache or not.  Returns <tt>true</tt> if invocations are to be
     * allowed, <tt>false</tt> otherwise.  If the origin of the call is remote and the cache status is {@link
-    * org.horizon.ComponentStatus#STARTING}, this method will block for up to {@link
+    * org.horizon.lifecycle.ComponentStatus#INITIALIZING}, this method will block for up to {@link
     * Configuration#getStateRetrievalTimeout()} millis, checking for a valid state.
     *
     * @param originLocal true if the call originates locally (i.e., from the {@link org.horizon.CacheDelegate} or false
@@ -785,8 +743,8 @@
       getLog().trace("Is remotely originating.");
 
       // else if this is a remote call and the status is STARTING, wait until the cache starts.
-      if (state == ComponentStatus.STARTING) {
-         getLog().trace("Cache is starting; block.");
+      if (state == ComponentStatus.INITIALIZING) {
+         getLog().trace("Cache is initializing; block.");
          try {
             blockUntilCacheStarts();
             return true;
@@ -801,9 +759,9 @@
    }
 
    /**
-    * Blocks until the current cache instance is in its {@link org.horizon.ComponentStatus#STARTED started} phase.
-    * Blocks for up to {@link Configuration#getStateRetrievalTimeout()} milliseconds, throwing an IllegalStateException
-    * if the cache doesn't reach this state even after this maximum wait time.
+    * Blocks until the current cache instance is in its {@link org.horizon.lifecycle.ComponentStatus#RUNNING started}
+    * phase. Blocks for up to {@link Configuration#getStateRetrievalTimeout()} milliseconds, throwing an
+    * IllegalStateException if the cache doesn't reach this state even after this maximum wait time.
     *
     * @throws InterruptedException  if interrupted while waiting
     * @throws IllegalStateException if even after waiting the cache has not started.
@@ -842,7 +800,6 @@
       List<Method> injectionMethods = new ArrayList<Method>(2);
       List<PrioritizedMethod> startMethods = new ArrayList<PrioritizedMethod>(2);
       List<PrioritizedMethod> stopMethods = new ArrayList<PrioritizedMethod>(2);
-      List<PrioritizedMethod> destroyMethods = new ArrayList<PrioritizedMethod>(2);
       /**
        * If true, then this component is not flushed before starting the ComponentRegistry.
        */

Modified: core/branches/flat/src/main/java/org/horizon/factories/ComponentRegistry.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/factories/ComponentRegistry.java	2009-02-09 21:28:30 UTC (rev 7671)
+++ core/branches/flat/src/main/java/org/horizon/factories/ComponentRegistry.java	2009-02-10 11:54:44 UTC (rev 7672)
@@ -2,12 +2,12 @@
 
 import org.horizon.AdvancedCache;
 import org.horizon.CacheException;
-import org.horizon.ComponentStatus;
 import org.horizon.config.Configuration;
 import org.horizon.config.ConfigurationException;
 import org.horizon.factories.annotations.Inject;
 import org.horizon.factories.scopes.ScopeDetector;
 import org.horizon.factories.scopes.Scopes;
+import org.horizon.lifecycle.ComponentStatus;
 import org.horizon.logging.Log;
 import org.horizon.logging.LogFactory;
 import org.horizon.notifications.cachemanagerlistener.CacheManagerNotifier;
@@ -105,12 +105,12 @@
 
    @Override
    public void start() {
-      if (globalComponents.getState() != ComponentStatus.STARTED || globalComponents.getState() != ComponentStatus.STARTING) {
+      if (globalComponents.getStatus() != ComponentStatus.RUNNING || globalComponents.getStatus() != ComponentStatus.INITIALIZING) {
          globalComponents.start();
       }
-      boolean needToNotify = state != ComponentStatus.STARTED && state != ComponentStatus.STARTING;
+      boolean needToNotify = state != ComponentStatus.RUNNING && state != ComponentStatus.INITIALIZING;
       super.start();
-      if (needToNotify && state == ComponentStatus.STARTED) {
+      if (needToNotify && state == ComponentStatus.RUNNING) {
          globalComponents.registerNamedComponentRegistry(this, cacheName);
          cacheManagerNotifier.notifyCacheStarted(cacheName);
       }
@@ -119,8 +119,8 @@
    @Override
    public void stop() {
       if (state.stopAllowed()) globalComponents.unregisterNamedComponentRegistry(cacheName);
-      boolean needToNotify = state == ComponentStatus.STARTED || state == ComponentStatus.STARTING;
+      boolean needToNotify = state == ComponentStatus.RUNNING || state == ComponentStatus.INITIALIZING;
       super.stop();
-      if (state == ComponentStatus.STOPPED && needToNotify) cacheManagerNotifier.notifyCacheStopped(cacheName);
+      if (state == ComponentStatus.TERMINATED && needToNotify) cacheManagerNotifier.notifyCacheStopped(cacheName);
    }
 }

Deleted: core/branches/flat/src/main/java/org/horizon/factories/annotations/Destroy.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/factories/annotations/Destroy.java	2009-02-09 21:28:30 UTC (rev 7671)
+++ core/branches/flat/src/main/java/org/horizon/factories/annotations/Destroy.java	2009-02-10 11:54:44 UTC (rev 7672)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.horizon.factories.annotations;
-
-import static java.lang.annotation.ElementType.METHOD;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Method level annotation that indicates a (no-param) method to be called on a component registered in the
- * ComponentRegistry when the cache is destroyed.
- * <p/>
- *
- * @author Manik Surtani (<a href="mailto:manik at jboss.org">manik at jboss.org</a>)
- * @since 1.0
- */
- at Target(METHOD)
- at Retention(RetentionPolicy.RUNTIME)
-public @interface Destroy {
-   /**
-    * Optional parameter which defines the order in which this method will be called when the ComponentRegistry moves to
-    * the STARTED state.  Defaults to 10.
-    *
-    * @return execution priority
-    * @since 1.0
-    */
-   public abstract int priority() default 10;
-}
\ No newline at end of file

Copied: core/branches/flat/src/main/java/org/horizon/lifecycle/ComponentStatus.java (from rev 7666, core/branches/flat/src/main/java/org/horizon/ComponentStatus.java)
===================================================================
--- core/branches/flat/src/main/java/org/horizon/lifecycle/ComponentStatus.java	                        (rev 0)
+++ core/branches/flat/src/main/java/org/horizon/lifecycle/ComponentStatus.java	2009-02-10 11:54:44 UTC (rev 7672)
@@ -0,0 +1,102 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.horizon.lifecycle;
+
+import org.horizon.logging.Log;
+import org.horizon.logging.LogFactory;
+
+/**
+ * Different states a component may be in.
+ *
+ * @author Manik Surtani
+ * @see org.horizon.lifecycle.Lifecycle
+ * @since 1.0
+ */
+public enum ComponentStatus {
+   /**
+    * Object has been instantiated, but start() has not been called.
+    */
+   INSTANTIATED,
+   /**
+    * The <code>start()</code> method has been called but not yet completed.
+    */
+   INITIALIZING,
+   /**
+    * The <code>start()</code> method has been completed and the component is running.
+    */
+   RUNNING,
+   /**
+    * The <code>stop()</code> method has been called but has not yet completed.
+    */
+   STOPPING,
+   /**
+    * The <code>stop()</code> method has completed and the component has terminated.
+    */
+   TERMINATED,
+   /**
+    * The component is in a failed state due to a problem with one of the other lifecycle transition phases.
+    */
+   FAILED;
+
+   private static final Log log = LogFactory.getLog(ComponentStatus.class);
+
+   public boolean needToDestroyFailedCache() {
+      return this == ComponentStatus.FAILED;
+   }
+
+   public boolean startAllowed() {
+      switch (this) {
+         case INSTANTIATED:
+         case TERMINATED:
+            return true;
+         default:
+            return false;
+      }
+   }
+
+   public boolean needToInitializeBeforeStart() {
+      switch (this) {
+         case INSTANTIATED:
+            return true;
+         default:
+            return false;
+      }
+   }
+
+   public boolean stopAllowed() {
+      switch (this) {
+         case INSTANTIATED:
+         case TERMINATED:
+         case STOPPING:
+         case INITIALIZING:
+            log.debug("Ignoring call to stop() as current state is " + this);
+            return false;
+         default:
+            return true;
+      }
+
+   }
+
+   public boolean allowInvocations() {
+      return this == ComponentStatus.RUNNING;
+   }
+}


Property changes on: core/branches/flat/src/main/java/org/horizon/lifecycle/ComponentStatus.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: core/branches/flat/src/main/java/org/horizon/lifecycle/Lifecycle.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/lifecycle/Lifecycle.java	2009-02-09 21:28:30 UTC (rev 7671)
+++ core/branches/flat/src/main/java/org/horizon/lifecycle/Lifecycle.java	2009-02-10 11:54:44 UTC (rev 7672)
@@ -28,7 +28,9 @@
  * @since 1.0
  */
 public interface Lifecycle {
+
    void start();
 
    void stop();
+
 }

Modified: core/branches/flat/src/main/java/org/horizon/manager/CacheManager.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/manager/CacheManager.java	2009-02-09 21:28:30 UTC (rev 7671)
+++ core/branches/flat/src/main/java/org/horizon/manager/CacheManager.java	2009-02-10 11:54:44 UTC (rev 7672)
@@ -1,12 +1,12 @@
 package org.horizon.manager;
 
 import org.horizon.Cache;
-import org.horizon.ComponentStatus;
 import org.horizon.config.Configuration;
 import org.horizon.config.DuplicateCacheNameException;
 import org.horizon.factories.annotations.NonVolatile;
 import org.horizon.factories.scopes.Scope;
 import org.horizon.factories.scopes.Scopes;
+import org.horizon.lifecycle.ComponentStatus;
 import org.horizon.lifecycle.Lifecycle;
 import org.horizon.notifications.Listenable;
 import org.horizon.remoting.transport.Address;
@@ -98,7 +98,7 @@
 
    Address getAddress();
 
+   boolean isCoordinator();
+
    ComponentStatus getStatus();
-
-   boolean isCoordinator();
 }

Modified: core/branches/flat/src/main/java/org/horizon/manager/DefaultCacheManager.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/manager/DefaultCacheManager.java	2009-02-09 21:28:30 UTC (rev 7671)
+++ core/branches/flat/src/main/java/org/horizon/manager/DefaultCacheManager.java	2009-02-10 11:54:44 UTC (rev 7672)
@@ -22,7 +22,6 @@
 package org.horizon.manager;
 
 import org.horizon.Cache;
-import org.horizon.ComponentStatus;
 import org.horizon.config.Configuration;
 import org.horizon.config.ConfigurationException;
 import org.horizon.config.DuplicateCacheNameException;
@@ -34,6 +33,7 @@
 import org.horizon.factories.annotations.NonVolatile;
 import org.horizon.factories.scopes.Scope;
 import org.horizon.factories.scopes.Scopes;
+import org.horizon.lifecycle.ComponentStatus;
 import org.horizon.lifecycle.Lifecycle;
 import org.horizon.notifications.cachemanagerlistener.CacheManagerNotifier;
 import org.horizon.remoting.RPCManager;
@@ -372,6 +372,6 @@
    }
 
    public ComponentStatus getStatus() {
-      return globalComponentRegistry.getState();
+      return globalComponentRegistry.getStatus();
    }
 }

Modified: core/branches/flat/src/main/java/org/horizon/marshall/Marshaller.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/marshall/Marshaller.java	2009-02-09 21:28:30 UTC (rev 7671)
+++ core/branches/flat/src/main/java/org/horizon/marshall/Marshaller.java	2009-02-10 11:54:44 UTC (rev 7672)
@@ -47,8 +47,8 @@
  * This interface is used to marshall {@link org.horizon.commands.ReplicableCommand}s, their parameters and their
  * response values.
  * <p/>
- * The interface is also used by the {@link org.horizon.loader.CacheLoader} framework to efficiently serialize data to
- * be persisted, as well as the {@link org.horizon.statetransfer.StateTransferManager} when serializing the cache for
+ * The interface is also used by the {@link org.horizon.loader.CacheLoaderOld} framework to efficiently serialize data
+ * to be persisted, as well as the {@link org.horizon.statetransfer.StateTransferManager} when serializing the cache for
  * transferring state en-masse.
  *
  * @author <a href="mailto://manik@jboss.org">Manik Surtani</a>

Modified: core/branches/flat/src/main/java/org/horizon/notifications/AbstractListenerImpl.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/notifications/AbstractListenerImpl.java	2009-02-09 21:28:30 UTC (rev 7671)
+++ core/branches/flat/src/main/java/org/horizon/notifications/AbstractListenerImpl.java	2009-02-10 11:54:44 UTC (rev 7672)
@@ -3,7 +3,6 @@
 import org.horizon.CacheException;
 import org.horizon.factories.KnownComponentNames;
 import org.horizon.factories.annotations.ComponentName;
-import org.horizon.factories.annotations.Destroy;
 import org.horizon.factories.annotations.Inject;
 import org.horizon.factories.annotations.Start;
 import org.horizon.factories.annotations.Stop;
@@ -44,11 +43,6 @@
       this.asyncProcessor = executor;
    }
 
-   @Destroy
-   void destroy() {
-      removeAllCacheListeners();
-   }
-
    @Start
    public void start() {
       syncProcessor = new WithinThreadExecutor();

Modified: core/branches/flat/src/main/java/org/horizon/tree/TreeCache.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/tree/TreeCache.java	2009-02-09 21:28:30 UTC (rev 7671)
+++ core/branches/flat/src/main/java/org/horizon/tree/TreeCache.java	2009-02-10 11:54:44 UTC (rev 7672)
@@ -264,8 +264,7 @@
     * @param newParent  new location under which to attach the node being moved.
     * @throws NodeNotExistsException may throw one of these if the target node does not exist or if a different thread
     *                                has moved this node elsewhere already.
-    * @throws IllegalStateException  if {@link Cache#getCacheStatus()} would not return {@link
-    *                                org.horizon.ComponentStatus#STARTED}.
+    * @throws IllegalStateException  if {@link #getStatus()} would not return {@link org.horizon.lifecycle.ComponentStatus#STARTED}.
     */
    void move(Fqn nodeToMove, Fqn newParent) throws NodeNotExistsException;
 
@@ -274,8 +273,7 @@
    /**
     * Convenience method that takes in string representations of Fqns.  Otherwise identical to {@link #move(Fqn, Fqn)}
     *
-    * @throws IllegalStateException if {@link Cache#getCacheStatus()} would not return {@link
-    *                               org.horizon.ComponentStatus#STARTED}.
+    * @throws IllegalStateException if {@link #getStatus()} would not return {@link org.horizon.lifecycle.ComponentStatus#STARTED}.
     */
    void move(String nodeToMove, String newParent) throws NodeNotExistsException;
 
@@ -288,8 +286,7 @@
     * @param fqn
     * @return map of data, or an empty map
     * @throws CacheException
-    * @throws IllegalStateException if {@link Cache#getCacheStatus()} would not return {@link
-    *                               org.horizon.ComponentStatus#STARTED}.
+    * @throws IllegalStateException if {@link #getStatus()} would not return {@link org.horizon.lifecycle.ComponentStatus#STARTED}.
     */
    Map<K, V> getData(Fqn fqn);
 
@@ -310,8 +307,7 @@
     * A convenience method to retrieving a node and getting keys from the node directly.
     *
     * @param fqn name of the node
-    * @throws IllegalStateException if {@link Cache#getCacheStatus()} would not return {@link
-    *                               org.horizon.ComponentStatus#STARTED}.
+    * @throws IllegalStateException if {@link #getStatus()} would not return {@link org.horizon.lifecycle.ComponentStatus#STARTED}.
     */
    Set<K> getKeys(Fqn fqn);
 
@@ -321,8 +317,7 @@
     * Convenience method that takes in a String represenation of the Fqn.  Otherwise identical to {@link
     * #clearData(Fqn)}.
     *
-    * @throws IllegalStateException if {@link Cache#getCacheStatus()} would not return {@link
-    *                               org.horizon.ComponentStatus#STARTED}.
+    * @throws IllegalStateException if {@link #getStatus()} would not return {@link org.horizon.lifecycle.ComponentStatus#STARTED}.
     */
    void clearData(String fqn);
 
@@ -334,8 +329,7 @@
     * A convenience method to retrieving a node and getting keys from the node directly.
     *
     * @param fqn name of the node
-    * @throws IllegalStateException if {@link Cache#getCacheStatus()} would not return {@link
-    *                               org.horizon.ComponentStatus#STARTED}.
+    * @throws IllegalStateException if {@link #getStatus()} would not return {@link org.horizon.lifecycle.ComponentStatus#STARTED}.
     */
    void clearData(Fqn fqn);
 

Modified: core/branches/flat/src/main/java/org/horizon/util/TestingUtil.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/util/TestingUtil.java	2009-02-09 21:28:30 UTC (rev 7671)
+++ core/branches/flat/src/main/java/org/horizon/util/TestingUtil.java	2009-02-10 11:54:44 UTC (rev 7672)
@@ -10,13 +10,13 @@
 import org.horizon.AdvancedCache;
 import org.horizon.Cache;
 import org.horizon.CacheDelegate;
-import org.horizon.ComponentStatus;
 import org.horizon.commands.CommandsFactory;
 import org.horizon.commands.VisitableCommand;
 import org.horizon.factories.ComponentRegistry;
 import org.horizon.factories.GlobalComponentRegistry;
 import org.horizon.interceptors.InterceptorChain;
 import org.horizon.interceptors.base.CommandInterceptor;
+import org.horizon.lifecycle.ComponentStatus;
 import org.horizon.lock.LockManager;
 import org.horizon.manager.CacheManager;
 import org.horizon.remoting.transport.Address;
@@ -185,7 +185,7 @@
    }
 
    /**
-    * Loops, continually calling {@link #areCacheViewsComplete(CacheSPI[])} until it either returns true or
+    * Loops, continually calling {@link #areCacheViewsComplete(Cache[])} until it either returns true or
     * <code>timeout</code> ms have elapsed.
     *
     * @param groupSize number of caches expected in the group
@@ -211,8 +211,8 @@
    }
 
    /**
-    * Checks each cache to see if the number of elements in the array returned by {@link CacheSPI#getMembers()} matches
-    * the size of the <code>caches</code> parameter.
+    * Checks each cache to see if the number of elements in the array returned by {@link CacheManager#getMembers()}
+    * matches the size of the <code>caches</code> parameter.
     *
     * @param caches caches that should form a View
     * @return <code>true</code> if all caches have <code>caches.length</code> members; false otherwise
@@ -383,7 +383,7 @@
    public static void killCaches(Cache... caches) {
       for (Cache c : caches) {
          try {
-            if (c != null && c.getCacheStatus() == ComponentStatus.STARTED) {
+            if (c != null && c.getStatus() == ComponentStatus.RUNNING) {
                TransactionManager tm = getTransactionManager(c);
                if (tm != null) {
                   try {
@@ -424,7 +424,7 @@
     */
    public static void killTransactions(Cache... caches) {
       for (Cache c : caches) {
-         if (c != null && c.getCacheStatus() == ComponentStatus.STARTED) {
+         if (c != null && c.getStatus() == ComponentStatus.RUNNING) {
             TransactionManager tm = getTransactionManager(c);
             if (tm != null) {
                try {
@@ -509,7 +509,7 @@
       AdvancedCache spi = cache.getAdvancedCache();
       long killTime = System.currentTimeMillis() + timeout;
       while (System.currentTimeMillis() < killTime) {
-         if (spi.getCacheStatus() == cacheStatus) return;
+         if (spi.getStatus() == cacheStatus) return;
          sleepThread(50);
       }
       throw new RuntimeException("Timed out waiting for condition");

Modified: core/branches/flat/src/test/java/org/horizon/config/parsing/ConfigurationParserTest.java
===================================================================
--- core/branches/flat/src/test/java/org/horizon/config/parsing/ConfigurationParserTest.java	2009-02-09 21:28:30 UTC (rev 7671)
+++ core/branches/flat/src/test/java/org/horizon/config/parsing/ConfigurationParserTest.java	2009-02-10 11:54:44 UTC (rev 7672)
@@ -211,7 +211,7 @@
 
       CacheLoaderConfig.IndividualCacheLoaderConfig.SingletonStoreConfig ssc = iclc.getSingletonStoreConfig();
       assert ssc.isSingletonStoreEnabled();
-      assert ssc.getClassName().equals("org.horizon.loader.SingletonStoreCacheLoader");
+      assert ssc.getClassName().equals("org.horizon.loader.SingletonStoreCacheLoaderOld");
       assert ssc.getSingletonStoreProperties().isEmpty();
    }
 

Modified: core/branches/flat/src/test/java/org/horizon/manager/CacheManagerTest.java
===================================================================
--- core/branches/flat/src/test/java/org/horizon/manager/CacheManagerTest.java	2009-02-09 21:28:30 UTC (rev 7671)
+++ core/branches/flat/src/test/java/org/horizon/manager/CacheManagerTest.java	2009-02-10 11:54:44 UTC (rev 7672)
@@ -1,9 +1,9 @@
 package org.horizon.manager;
 
 import org.horizon.Cache;
-import org.horizon.ComponentStatus;
 import org.horizon.config.Configuration;
 import org.horizon.config.DuplicateCacheNameException;
+import org.horizon.lifecycle.ComponentStatus;
 import org.horizon.util.TestingUtil;
 import org.testng.annotations.Test;
 
@@ -17,7 +17,7 @@
       CacheManager cm = new DefaultCacheManager();
 
       try {
-         assert cm.getCache().getCacheStatus() == ComponentStatus.STARTED;
+         assert cm.getCache().getStatus() == ComponentStatus.RUNNING;
          assert cm.getCache().getName().equals(DefaultCacheManager.DEFAULT_CACHE_NAME);
 
          try {
@@ -59,15 +59,15 @@
          Cache c2 = cm.getCache("cache2");
          Cache c3 = cm.getCache("cache3");
 
-         assert c1.getCacheStatus() == ComponentStatus.STARTED;
-         assert c2.getCacheStatus() == ComponentStatus.STARTED;
-         assert c3.getCacheStatus() == ComponentStatus.STARTED;
+         assert c1.getStatus() == ComponentStatus.RUNNING;
+         assert c2.getStatus() == ComponentStatus.RUNNING;
+         assert c3.getStatus() == ComponentStatus.RUNNING;
 
          cm.stop();
 
-         assert c1.getCacheStatus() == ComponentStatus.STOPPED;
-         assert c2.getCacheStatus() == ComponentStatus.STOPPED;
-         assert c3.getCacheStatus() == ComponentStatus.STOPPED;
+         assert c1.getStatus() == ComponentStatus.TERMINATED;
+         assert c2.getStatus() == ComponentStatus.TERMINATED;
+         assert c3.getStatus() == ComponentStatus.TERMINATED;
       } finally {
          TestingUtil.killCacheManagers(cm);
       }




More information about the jbosscache-commits mailing list