[infinispan-commits] Infinispan SVN: r937 - in trunk/core/src/main/java/org/infinispan: config and 12 other directories.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Sun Oct 11 19:41:02 EDT 2009


Author: manik.surtani at jboss.com
Date: 2009-10-11 19:41:01 -0400 (Sun, 11 Oct 2009)
New Revision: 937

Added:
   trunk/core/src/main/java/org/infinispan/factories/annotations/SurvivesRestarts.java
Removed:
   trunk/core/src/main/java/org/infinispan/factories/annotations/NonVolatile.java
Modified:
   trunk/core/src/main/java/org/infinispan/CacheDelegate.java
   trunk/core/src/main/java/org/infinispan/config/Configuration.java
   trunk/core/src/main/java/org/infinispan/config/GlobalConfiguration.java
   trunk/core/src/main/java/org/infinispan/context/InvocationContextContainer.java
   trunk/core/src/main/java/org/infinispan/eviction/EvictionManager.java
   trunk/core/src/main/java/org/infinispan/factories/AbstractComponentRegistry.java
   trunk/core/src/main/java/org/infinispan/factories/BootstrapFactory.java
   trunk/core/src/main/java/org/infinispan/factories/GlobalComponentRegistry.java
   trunk/core/src/main/java/org/infinispan/jmx/CacheJmxRegistration.java
   trunk/core/src/main/java/org/infinispan/jmx/CacheManagerJmxRegistration.java
   trunk/core/src/main/java/org/infinispan/lifecycle/ComponentStatus.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/marshall/VersionAwareMarshaller.java
   trunk/core/src/main/java/org/infinispan/notifications/cachelistener/CacheNotifier.java
   trunk/core/src/main/java/org/infinispan/notifications/cachemanagerlistener/CacheManagerNotifier.java
   trunk/core/src/main/java/org/infinispan/remoting/InboundInvocationHandlerImpl.java
   trunk/core/src/main/java/org/infinispan/remoting/transport/Transport.java
Log:
Fixes to prevent rewiring before starting a component registry

Modified: trunk/core/src/main/java/org/infinispan/CacheDelegate.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/CacheDelegate.java	2009-10-11 23:37:51 UTC (rev 936)
+++ trunk/core/src/main/java/org/infinispan/CacheDelegate.java	2009-10-11 23:41:01 UTC (rev 937)
@@ -45,7 +45,7 @@
 import org.infinispan.eviction.EvictionManager;
 import org.infinispan.factories.ComponentRegistry;
 import org.infinispan.factories.annotations.Inject;
-import org.infinispan.factories.annotations.NonVolatile;
+import org.infinispan.factories.annotations.SurvivesRestarts;
 import org.infinispan.interceptors.InterceptorChain;
 import org.infinispan.interceptors.base.CommandInterceptor;
 import org.infinispan.jmx.annotations.MBean;
@@ -81,7 +81,7 @@
  * @author Galder Zamarreño
  * @since 4.0
  */
- at NonVolatile
+ at SurvivesRestarts
 @MBean(objectName = CacheDelegate.OBJECT_NAME, description = "Component that acts as a manager, factory and container for caches in the system.")
 public class CacheDelegate<K, V> implements AdvancedCache<K, V> {
    public static final String OBJECT_NAME = "Cache";

Modified: trunk/core/src/main/java/org/infinispan/config/Configuration.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/config/Configuration.java	2009-10-11 23:37:51 UTC (rev 936)
+++ trunk/core/src/main/java/org/infinispan/config/Configuration.java	2009-10-11 23:41:01 UTC (rev 937)
@@ -25,7 +25,7 @@
 import org.infinispan.eviction.EvictionStrategy;
 import org.infinispan.factories.ComponentRegistry;
 import org.infinispan.factories.annotations.Inject;
-import org.infinispan.factories.annotations.NonVolatile;
+import org.infinispan.factories.annotations.SurvivesRestarts;
 import org.infinispan.factories.annotations.Start;
 import org.infinispan.transaction.lookup.GenericTransactionManagerLookup;
 import org.infinispan.transaction.lookup.TransactionManagerLookup;
@@ -44,7 +44,6 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-import java.util.Random;
 import java.util.concurrent.TimeUnit;
 
 /**
@@ -67,7 +66,7 @@
  * @author Galder Zamarreño
  * @since 4.0
  */
- at NonVolatile
+ at SurvivesRestarts
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(propOrder={})
 public class Configuration extends AbstractNamedCacheConfigurationBean {  

Modified: trunk/core/src/main/java/org/infinispan/config/GlobalConfiguration.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/config/GlobalConfiguration.java	2009-10-11 23:37:51 UTC (rev 936)
+++ trunk/core/src/main/java/org/infinispan/config/GlobalConfiguration.java	2009-10-11 23:41:01 UTC (rev 937)
@@ -6,7 +6,7 @@
 import org.infinispan.executors.DefaultScheduledExecutorFactory;
 import org.infinispan.factories.GlobalComponentRegistry;
 import org.infinispan.factories.annotations.Inject;
-import org.infinispan.factories.annotations.NonVolatile;
+import org.infinispan.factories.annotations.SurvivesRestarts;
 import org.infinispan.factories.scopes.Scope;
 import org.infinispan.factories.scopes.Scopes;
 import org.infinispan.jmx.PlatformMBeanServerLookup;
@@ -38,7 +38,7 @@
  * @author Vladimir Blagojevic
  * @since 4.0
  */
- at NonVolatile
+ at SurvivesRestarts
 @Scope(Scopes.GLOBAL)
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(propOrder={})

Modified: trunk/core/src/main/java/org/infinispan/context/InvocationContextContainer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/context/InvocationContextContainer.java	2009-10-11 23:37:51 UTC (rev 936)
+++ trunk/core/src/main/java/org/infinispan/context/InvocationContextContainer.java	2009-10-11 23:41:01 UTC (rev 937)
@@ -3,7 +3,7 @@
 import org.infinispan.context.impl.LocalTxInvocationContext;
 import org.infinispan.context.impl.RemoteTxInvocationContext;
 import org.infinispan.context.impl.NonTxInvocationContext;
-import org.infinispan.factories.annotations.NonVolatile;
+import org.infinispan.factories.annotations.SurvivesRestarts;
 import org.infinispan.factories.scopes.Scope;
 import org.infinispan.factories.scopes.Scopes;
 
@@ -15,7 +15,7 @@
  * @author Mircea.Markus at jboss.com
  * @since 4.0
  */
- at NonVolatile
+ at SurvivesRestarts
 @Scope(Scopes.NAMED_CACHE)
 public interface InvocationContextContainer {
 

Modified: trunk/core/src/main/java/org/infinispan/eviction/EvictionManager.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/eviction/EvictionManager.java	2009-10-11 23:37:51 UTC (rev 936)
+++ trunk/core/src/main/java/org/infinispan/eviction/EvictionManager.java	2009-10-11 23:41:01 UTC (rev 937)
@@ -1,7 +1,6 @@
 package org.infinispan.eviction;
 
 import net.jcip.annotations.ThreadSafe;
-import org.infinispan.factories.annotations.NonVolatile;
 import org.infinispan.factories.scopes.Scope;
 import org.infinispan.factories.scopes.Scopes;
 
@@ -20,7 +19,6 @@
  * @since 4.0
  */
 @ThreadSafe
- at NonVolatile
 @Scope(Scopes.NAMED_CACHE)
 public interface EvictionManager {
 

Modified: trunk/core/src/main/java/org/infinispan/factories/AbstractComponentRegistry.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/factories/AbstractComponentRegistry.java	2009-10-11 23:37:51 UTC (rev 936)
+++ trunk/core/src/main/java/org/infinispan/factories/AbstractComponentRegistry.java	2009-10-11 23:41:01 UTC (rev 937)
@@ -28,7 +28,7 @@
 import org.infinispan.factories.annotations.ComponentName;
 import org.infinispan.factories.annotations.DefaultFactoryFor;
 import org.infinispan.factories.annotations.Inject;
-import org.infinispan.factories.annotations.NonVolatile;
+import org.infinispan.factories.annotations.SurvivesRestarts;
 import org.infinispan.factories.annotations.Start;
 import org.infinispan.factories.annotations.Stop;
 import org.infinispan.factories.scopes.Scope;
@@ -76,7 +76,7 @@
  * @author Galder Zamarreño
  * @since 4.0
  */
- at NonVolatile
+ at SurvivesRestarts
 @Scope(Scopes.NAMED_CACHE)
 public abstract class AbstractComponentRegistry implements Lifecycle, Cloneable {
 
@@ -197,7 +197,7 @@
          c.instance = component;
          componentLookup.put(name, c);
       }
-      c.nonVolatile = ReflectionUtil.isAnnotationPresent(component.getClass(), NonVolatile.class);
+      c.nonVolatile = ReflectionUtil.isAnnotationPresent(component.getClass(), SurvivesRestarts.class);
       addComponentDependencies(c);
       // inject dependencies for this component
       c.injectDependencies();
@@ -222,7 +222,8 @@
       Class[] dependencies = m.getParameterTypes();
       Annotation[][] parameterAnnotations = m.getParameterAnnotations();
       Object[] params = new Object[dependencies.length];
-      if (getLog().isTraceEnabled()) getLog().trace("Injecting dependencies for method {0}.", m);
+      if (getLog().isTraceEnabled())
+         getLog().trace("Injecting dependencies for method [{0}] on an instance of [{1}].", m, o.getClass().getName());
       for (int i = 0; i < dependencies.length; i++) {
          params[i] = getOrCreateComponent(dependencies[i], getComponentName(dependencies[i], parameterAnnotations, i));
       }
@@ -407,7 +408,7 @@
    }
 
    /**
-    * Retrieves a component from the {@link Configuration} or {@link RuntimeConfig}.
+    * Retrieves a component from the {@link Configuration}
     *
     * @param componentClass component type
     * @return component, or null if it cannot be found
@@ -426,19 +427,6 @@
             getLog().warn("Unable to invoke getter {0} on Configuration.class!", e, getter);
          }
       }
-
-      // now try the RuntimeConfig - a legacy "registry" of sorts.
-//      if (returnValue == null) {
-//         getter = BeanUtils.getterMethod(RuntimeConfig.class, componentClass);
-//         if (getter != null) {
-//            try {
-//               returnValue = (T) getter.invoke(getConfiguration().getRuntimeConfig());
-//            }
-//            catch (Exception e) {
-//               getLog().warn("Unable to invoke getter {0} on RuntimeConfig.class!", e, getter);
-//            }
-//         }
-//      }
       return returnValue;
    }
 
@@ -485,17 +473,10 @@
    }
 
    /**
-    * Rewires components.  Can only be called if the current state is WIRED or STARTED.
-    * 
-    * Here's an example where rewiring is needed:
-    * 
-    * The reason why rewiring needs to happen is to capture any such config changes.  For example (this is a JBC example):
-    *   1.  Config uses a FileCacheLoader.
-    *   2.  Cache.create() - this will create a CacheLoaderInterceptor with a reference to the FileCacheLoader.
-    *   3.  Add a JDBC CacheLoader to the config
-    *   4.  Call cache.start().  The cache loader manager should recognise this change, create a chaining cache loader.  
-    *       This is a volatile component.  Now the CLI is non-volatile since it doesn't need to be rebuilt.  But it does 
-    *       need to be rewired, since the cache loader now is a ChainingCacheLoader, not a FileCacheLoader.  
+    * Rewires components.  Used to rewire components in the CR if a cache has been stopped (moved to state TERMINATED),
+    * which would (almost) empty the registry of components.  Rewiring will re-inject all dependencies so that the cache
+    * can be started again.
+    * <p/>
     */
    public void rewire() {
       // need to re-inject everything again.
@@ -557,41 +538,24 @@
    //   These methods perform a check for appropriate transition and then delegate to similarly named internal methods.
 
    /**
-    * Creates the components needed by a cache instance and sets the cache status to {@link
-    * org.infinispan.lifecycle.ComponentStatus#INITIALIZING} when it is done.
-    */
-   private void init() {
-      if (state.needToDestroyFailedCache())
-         destroy();
-
-      try {
-         internalCreate();
-      }
-      catch (Throwable t) {
-         handleLifecycleTransitionFailure(t);
-      }
-   }
-
-   /**
     * This starts the components in the cache, connecting to channels, starting service threads, etc.  If the cache is
-    * not in the {@link org.infinispan.lifecycle.ComponentStatus#INITIALIZING} state, {@link #init()} will be invoked
-    * first.
+    * not in the {@link org.infinispan.lifecycle.ComponentStatus#INITIALIZING} state, it will be initialized first.
     */
    public void start() {
-      boolean createdInStart = false;
+
       if (!state.startAllowed()) {
          if (state.needToDestroyFailedCache())
             destroy(); // this will take us back to TERMINATED
 
          if (state.needToInitializeBeforeStart()) {
-            init();
-            createdInStart = true;
+            state = ComponentStatus.INITIALIZING;
+            rewire();
          } else
             return;
       }
 
       try {
-         internalStart(createdInStart);
+         internalStart();
       }
       catch (Throwable t) {
          handleLifecycleTransitionFailure(t);
@@ -671,23 +635,7 @@
          throw new CacheException(t);
    }
 
-   /**
-    * The actual create implementation.
-    */
-   private void internalCreate() {
-      state = ComponentStatus.INITIALIZING;
-      resetNonVolatile();
-      rewire();
-   }
-
-   private void internalStart(boolean createdInStart) throws CacheException, IllegalArgumentException {
-      if (!createdInStart) {
-         // re-wire all dependencies in case stuff has changed since the cache was created
-         // remove any components whose construction may have depended upon a configuration that may have changed.
-         resetNonVolatile();
-         rewire();
-      }
-
+   private void internalStart() throws CacheException, IllegalArgumentException {
       // start all internal components
       // first cache all start, stop and destroy methods.
       populateLifecycleMethods();
@@ -902,7 +850,7 @@
       HashSet<Component> defensiveCopy = new HashSet<Component>(componentLookup.values());
       return Collections.unmodifiableSet(defensiveCopy);
    }
-   
+
    @Override
    public AbstractComponentRegistry clone() throws CloneNotSupportedException {
       AbstractComponentRegistry dolly = (AbstractComponentRegistry) super.clone();

Modified: trunk/core/src/main/java/org/infinispan/factories/BootstrapFactory.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/factories/BootstrapFactory.java	2009-10-11 23:37:51 UTC (rev 936)
+++ trunk/core/src/main/java/org/infinispan/factories/BootstrapFactory.java	2009-10-11 23:41:01 UTC (rev 937)
@@ -26,7 +26,7 @@
 import org.infinispan.CacheException;
 import org.infinispan.config.Configuration;
 import org.infinispan.factories.annotations.DefaultFactoryFor;
-import org.infinispan.factories.annotations.NonVolatile;
+import org.infinispan.factories.annotations.SurvivesRestarts;
 
 /**
  * Factory for setting up bootstrap components
@@ -35,7 +35,7 @@
  * @since 4.0
  */
 @DefaultFactoryFor(classes = {Cache.class, AdvancedCache.class, Configuration.class, ComponentRegistry.class})
- at NonVolatile
+ at SurvivesRestarts
 public class BootstrapFactory extends AbstractNamedCacheComponentFactory {
    AdvancedCache advancedCache;
 

Modified: trunk/core/src/main/java/org/infinispan/factories/GlobalComponentRegistry.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/factories/GlobalComponentRegistry.java	2009-10-11 23:37:51 UTC (rev 936)
+++ trunk/core/src/main/java/org/infinispan/factories/GlobalComponentRegistry.java	2009-10-11 23:41:01 UTC (rev 937)
@@ -4,7 +4,7 @@
 import org.infinispan.config.GlobalConfiguration;
 import static org.infinispan.config.GlobalConfiguration.ShutdownHookBehavior.DEFAULT;
 import static org.infinispan.config.GlobalConfiguration.ShutdownHookBehavior.REGISTER;
-import org.infinispan.factories.annotations.NonVolatile;
+import org.infinispan.factories.annotations.SurvivesRestarts;
 import org.infinispan.factories.scopes.Scope;
 import org.infinispan.factories.scopes.Scopes;
 import org.infinispan.jmx.CacheManagerJmxRegistration;
@@ -24,7 +24,7 @@
  * @since 4.0
  */
 @Scope(Scopes.GLOBAL)
- at NonVolatile
+ at SurvivesRestarts
 public class GlobalComponentRegistry extends AbstractComponentRegistry {
 
    private Log log = LogFactory.getLog(GlobalComponentRegistry.class);

Deleted: trunk/core/src/main/java/org/infinispan/factories/annotations/NonVolatile.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/factories/annotations/NonVolatile.java	2009-10-11 23:37:51 UTC (rev 936)
+++ trunk/core/src/main/java/org/infinispan/factories/annotations/NonVolatile.java	2009-10-11 23:41:01 UTC (rev 937)
@@ -1,50 +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.infinispan.factories.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * This annotation is used for components that will be registered in the {@link org.infinispan.factories.ComponentRegistry},
- * that are resilient to changes in configuration.  Examples are the {@link org.infinispan.factories.ComponentRegistry}
- * implementation used, which does not change regardless of the configuration.  Components such as the {@link
- * org.infinispan.util.concurrent.locks.LockManager}, though, should <b>never</b> be marked as <tt>@NonVolatile</tt>
- * since based on the configuration, different lock manager implementations may be selected.  LockManager is, hence,
- * <b>not</b> resilient to changes in the configuration.
- * 
- * To sum up: A component is marked as NonVolatile when the component is not dependent on configuration changes that may 
- * happen between create() and start(). This is legacy since from JBoss Cache because in Infinispan there's only start but 
- * no create. 
- *
- * @author Manik Surtani (<a href="mailto:manik at jboss.org">manik at jboss.org</a>)
- * @since 4.0
- */
-// ensure this annotation is available at runtime.
- at Retention(RetentionPolicy.RUNTIME)
-
-// only applies to classes.
- at Target(ElementType.TYPE)
-public @interface NonVolatile {
-}
\ No newline at end of file

Copied: trunk/core/src/main/java/org/infinispan/factories/annotations/SurvivesRestarts.java (from rev 933, trunk/core/src/main/java/org/infinispan/factories/annotations/NonVolatile.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/factories/annotations/SurvivesRestarts.java	                        (rev 0)
+++ trunk/core/src/main/java/org/infinispan/factories/annotations/SurvivesRestarts.java	2009-10-11 23:41:01 UTC (rev 937)
@@ -0,0 +1,47 @@
+/*
+ * 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.infinispan.factories.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * This annotation is used for components that will be registered in the {@link org.infinispan.factories.ComponentRegistry},
+ * that are meant to be retained in the component registry even after the component registry is stopped.  Components
+ * annotated as such would not have to be recreated and rewired between stopping and starting a component registry.
+ * <br />
+ * As a rule of thumb though, use of this annotation on components should be avoided, since resilient components are
+ * retained even after a component registry is stopped and consume resources.  Only components necessary for and critical
+ * to bootstrapping and restarting the component registry should be annotated as such.
+ *
+ * @author Manik Surtani (<a href="mailto:manik at jboss.org">manik at jboss.org</a>)
+ * @since 4.0
+ */
+// ensure this annotation is available at runtime.
+ at Retention(RetentionPolicy.RUNTIME)
+
+// only applies to classes.
+ at Target(ElementType.TYPE)
+public @interface SurvivesRestarts {
+}
\ No newline at end of file


Property changes on: trunk/core/src/main/java/org/infinispan/factories/annotations/SurvivesRestarts.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: trunk/core/src/main/java/org/infinispan/jmx/CacheJmxRegistration.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/jmx/CacheJmxRegistration.java	2009-10-11 23:37:51 UTC (rev 936)
+++ trunk/core/src/main/java/org/infinispan/jmx/CacheJmxRegistration.java	2009-10-11 23:41:01 UTC (rev 937)
@@ -31,7 +31,7 @@
 import org.infinispan.factories.GlobalComponentRegistry;
 import org.infinispan.factories.AbstractComponentRegistry.Component;
 import org.infinispan.factories.annotations.Inject;
-import org.infinispan.factories.annotations.NonVolatile;
+import org.infinispan.factories.annotations.SurvivesRestarts;
 import org.infinispan.factories.annotations.Start;
 import org.infinispan.factories.annotations.Stop;
 import org.infinispan.util.logging.Log;
@@ -55,7 +55,7 @@
  * @see java.lang.management.ManagementFactory#getPlatformMBeanServer()
  * @since 4.0
  */
- at NonVolatile
+ at SurvivesRestarts
 public class CacheJmxRegistration extends AbstractJmxRegistration {
    private static final Log log = LogFactory.getLog(CacheJmxRegistration.class);
 
@@ -98,7 +98,8 @@
          unregisterMBeans(nonCacheComponents);
          log.trace("MBeans were successfully unregistered from the mbean server.");
       }
-      cache = null;
+
+      // make sure we don't set cache to null, in case it needs to be restarted via JMX.
    }
    
    public void unregisterCacheMBean() {

Modified: trunk/core/src/main/java/org/infinispan/jmx/CacheManagerJmxRegistration.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/jmx/CacheManagerJmxRegistration.java	2009-10-11 23:37:51 UTC (rev 936)
+++ trunk/core/src/main/java/org/infinispan/jmx/CacheManagerJmxRegistration.java	2009-10-11 23:41:01 UTC (rev 937)
@@ -4,7 +4,7 @@
 import org.infinispan.factories.AbstractComponentRegistry;
 import org.infinispan.factories.GlobalComponentRegistry;
 import org.infinispan.factories.annotations.Inject;
-import org.infinispan.factories.annotations.NonVolatile;
+import org.infinispan.factories.annotations.SurvivesRestarts;
 import org.infinispan.util.logging.Log;
 import org.infinispan.util.logging.LogFactory;
 
@@ -19,7 +19,7 @@
  * @author Galder Zamarreño
  * @since 4.0
  */
- at NonVolatile
+ at SurvivesRestarts
 public class CacheManagerJmxRegistration extends AbstractJmxRegistration {
    private static final Log log = LogFactory.getLog(CacheManagerJmxRegistration.class);
    public static final String GLOBAL_JMX_GROUP = "[global]";

Modified: trunk/core/src/main/java/org/infinispan/lifecycle/ComponentStatus.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/lifecycle/ComponentStatus.java	2009-10-11 23:37:51 UTC (rev 936)
+++ trunk/core/src/main/java/org/infinispan/lifecycle/ComponentStatus.java	2009-10-11 23:41:01 UTC (rev 937)
@@ -66,7 +66,6 @@
    public boolean startAllowed() {
       switch (this) {
          case INSTANTIATED:
-         case TERMINATED:
             return true;
          default:
             return false;
@@ -75,7 +74,7 @@
 
    public boolean needToInitializeBeforeStart() {
       switch (this) {
-         case INSTANTIATED:
+         case TERMINATED:
             return true;
          default:
             return false;

Modified: trunk/core/src/main/java/org/infinispan/manager/CacheManager.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/manager/CacheManager.java	2009-10-11 23:37:51 UTC (rev 936)
+++ trunk/core/src/main/java/org/infinispan/manager/CacheManager.java	2009-10-11 23:41:01 UTC (rev 937)
@@ -3,7 +3,7 @@
 import org.infinispan.Cache;
 import org.infinispan.config.Configuration;
 import org.infinispan.config.GlobalConfiguration;
-import org.infinispan.factories.annotations.NonVolatile;
+import org.infinispan.factories.annotations.SurvivesRestarts;
 import org.infinispan.factories.scopes.Scope;
 import org.infinispan.factories.scopes.Scopes;
 import org.infinispan.lifecycle.ComponentStatus;
@@ -54,7 +54,7 @@
  * @since 4.0
  */
 @Scope(Scopes.GLOBAL)
- at NonVolatile
+ at SurvivesRestarts
 public interface CacheManager extends Lifecycle, Listenable {
    /**
     * Defines a named cache's configuration using the following algorithm:

Modified: trunk/core/src/main/java/org/infinispan/manager/DefaultCacheManager.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/manager/DefaultCacheManager.java	2009-10-11 23:37:51 UTC (rev 936)
+++ trunk/core/src/main/java/org/infinispan/manager/DefaultCacheManager.java	2009-10-11 23:41:01 UTC (rev 937)
@@ -31,7 +31,7 @@
 import org.infinispan.config.parsing.XmlConfigurationParser;
 import org.infinispan.factories.GlobalComponentRegistry;
 import org.infinispan.factories.InternalCacheFactory;
-import org.infinispan.factories.annotations.NonVolatile;
+import org.infinispan.factories.annotations.SurvivesRestarts;
 import org.infinispan.factories.scopes.Scope;
 import org.infinispan.factories.scopes.Scopes;
 import org.infinispan.jmx.CacheJmxRegistration;
@@ -95,7 +95,7 @@
  * @since 4.0
  */
 @Scope(Scopes.GLOBAL)
- at NonVolatile
+ at 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 static final String DEFAULT_CACHE_NAME = "org.infinispan.manager.DefaultCacheManager.DEFAULT_CACHE_NAME";

Modified: trunk/core/src/main/java/org/infinispan/marshall/VersionAwareMarshaller.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/VersionAwareMarshaller.java	2009-10-11 23:37:51 UTC (rev 936)
+++ trunk/core/src/main/java/org/infinispan/marshall/VersionAwareMarshaller.java	2009-10-11 23:41:01 UTC (rev 937)
@@ -23,7 +23,6 @@
 
 import org.infinispan.commands.RemoteCommandFactory;
 import org.infinispan.factories.annotations.Inject;
-import org.infinispan.factories.annotations.NonVolatile;
 import org.infinispan.factories.annotations.Start;
 import org.infinispan.factories.annotations.Stop;
 import org.infinispan.io.ByteBuffer;
@@ -48,7 +47,6 @@
  * @author Galder Zamarreño
  * @since 4.0
  */
- at NonVolatile
 public class VersionAwareMarshaller extends AbstractMarshaller {
    private static final Log log = LogFactory.getLog(VersionAwareMarshaller.class);
    private boolean trace = log.isTraceEnabled();

Modified: trunk/core/src/main/java/org/infinispan/notifications/cachelistener/CacheNotifier.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/notifications/cachelistener/CacheNotifier.java	2009-10-11 23:37:51 UTC (rev 936)
+++ trunk/core/src/main/java/org/infinispan/notifications/cachelistener/CacheNotifier.java	2009-10-11 23:41:01 UTC (rev 937)
@@ -22,7 +22,6 @@
 package org.infinispan.notifications.cachelistener;
 
 import org.infinispan.context.InvocationContext;
-import org.infinispan.factories.annotations.NonVolatile;
 import org.infinispan.factories.scopes.Scope;
 import org.infinispan.factories.scopes.Scopes;
 import org.infinispan.notifications.Listenable;
@@ -34,7 +33,6 @@
  * @author Mircea.Markus at jboss.com
  * @since 4.0
  */
- at NonVolatile
 @Scope(Scopes.NAMED_CACHE)
 public interface CacheNotifier extends Listenable {
    /**

Modified: trunk/core/src/main/java/org/infinispan/notifications/cachemanagerlistener/CacheManagerNotifier.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/notifications/cachemanagerlistener/CacheManagerNotifier.java	2009-10-11 23:37:51 UTC (rev 936)
+++ trunk/core/src/main/java/org/infinispan/notifications/cachemanagerlistener/CacheManagerNotifier.java	2009-10-11 23:41:01 UTC (rev 937)
@@ -1,6 +1,5 @@
 package org.infinispan.notifications.cachemanagerlistener;
 
-import org.infinispan.factories.annotations.NonVolatile;
 import org.infinispan.factories.scopes.Scope;
 import org.infinispan.factories.scopes.Scopes;
 import org.infinispan.notifications.Listenable;
@@ -14,7 +13,6 @@
  * @author Manik Surtani
  * @since 4.0
  */
- at NonVolatile
 @Scope(Scopes.GLOBAL)
 public interface CacheManagerNotifier extends Listenable {
    /**

Modified: trunk/core/src/main/java/org/infinispan/remoting/InboundInvocationHandlerImpl.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/remoting/InboundInvocationHandlerImpl.java	2009-10-11 23:37:51 UTC (rev 936)
+++ trunk/core/src/main/java/org/infinispan/remoting/InboundInvocationHandlerImpl.java	2009-10-11 23:41:01 UTC (rev 937)
@@ -6,7 +6,6 @@
 import org.infinispan.factories.ComponentRegistry;
 import org.infinispan.factories.GlobalComponentRegistry;
 import org.infinispan.factories.annotations.Inject;
-import org.infinispan.factories.annotations.NonVolatile;
 import org.infinispan.factories.scopes.Scope;
 import org.infinispan.factories.scopes.Scopes;
 import org.infinispan.remoting.responses.ExceptionResponse;
@@ -27,7 +26,6 @@
  * @author Manik Surtani
  * @since 4.0
  */
- at NonVolatile
 @Scope(Scopes.GLOBAL)
 public class InboundInvocationHandlerImpl implements InboundInvocationHandler {
    GlobalComponentRegistry gcr;

Modified: trunk/core/src/main/java/org/infinispan/remoting/transport/Transport.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/remoting/transport/Transport.java	2009-10-11 23:37:51 UTC (rev 936)
+++ trunk/core/src/main/java/org/infinispan/remoting/transport/Transport.java	2009-10-11 23:41:01 UTC (rev 937)
@@ -5,7 +5,6 @@
 import org.infinispan.factories.KnownComponentNames;
 import org.infinispan.factories.annotations.ComponentName;
 import org.infinispan.factories.annotations.Inject;
-import org.infinispan.factories.annotations.NonVolatile;
 import org.infinispan.factories.annotations.Start;
 import org.infinispan.factories.annotations.Stop;
 import org.infinispan.factories.scopes.Scope;
@@ -31,7 +30,6 @@
  * @since 4.0
  */
 @Scope(Scopes.GLOBAL)
- at NonVolatile
 public interface Transport extends Lifecycle {
    // TODO discovery should be abstracted away into a separate set of interfaces such that it is not tightly coupled to the transport
 



More information about the infinispan-commits mailing list