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

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Thu Nov 12 11:55:01 EST 2009


Author: manik.surtani at jboss.com
Date: 2009-11-12 11:55:01 -0500 (Thu, 12 Nov 2009)
New Revision: 1153

Modified:
   trunk/cachestore/jdbc/src/test/java/org/infinispan/config/parsing/JdbcConfigurationParserTest.java
   trunk/core/src/main/java/org/infinispan/config/CacheLoaderManagerConfig.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/loaders/AbstractCacheLoaderConfig.java
   trunk/core/src/main/java/org/infinispan/loaders/AbstractCacheStoreConfig.java
   trunk/core/src/main/java/org/infinispan/loaders/decorators/AsyncStore.java
   trunk/core/src/main/java/org/infinispan/loaders/decorators/AsyncStoreConfig.java
   trunk/core/src/main/java/org/infinispan/loaders/decorators/SingletonStoreConfig.java
   trunk/core/src/main/java/org/infinispan/util/TypedProperties.java
   trunk/core/src/test/java/org/infinispan/config/parsing/XmlFileParsingTest.java
Log:
Better cfg docs and defaults

Modified: trunk/cachestore/jdbc/src/test/java/org/infinispan/config/parsing/JdbcConfigurationParserTest.java
===================================================================
--- trunk/cachestore/jdbc/src/test/java/org/infinispan/config/parsing/JdbcConfigurationParserTest.java	2009-11-12 16:54:21 UTC (rev 1152)
+++ trunk/cachestore/jdbc/src/test/java/org/infinispan/config/parsing/JdbcConfigurationParserTest.java	2009-11-12 16:55:01 UTC (rev 1153)
@@ -32,7 +32,7 @@
       CacheStoreConfig iclc = (CacheStoreConfig) clc.getFirstCacheLoaderConfig();
       assert iclc.getCacheLoaderClassName().equals(JdbcStringBasedCacheStore.class.getName());
       assert iclc.getAsyncStoreConfig().isEnabled();
-      assert iclc.getAsyncStoreConfig().getMapLockTimeout() == 10000;
+      assert iclc.getAsyncStoreConfig().getFlushLockTimeout() == 10000;
       assert iclc.getAsyncStoreConfig().getThreadPoolSize() == 10;
       assert iclc.isFetchPersistentState();
       assert iclc.isIgnoreModifications();

Modified: trunk/core/src/main/java/org/infinispan/config/CacheLoaderManagerConfig.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/config/CacheLoaderManagerConfig.java	2009-11-12 16:54:21 UTC (rev 1152)
+++ trunk/core/src/main/java/org/infinispan/config/CacheLoaderManagerConfig.java	2009-11-12 16:55:01 UTC (rev 1153)
@@ -57,11 +57,11 @@
    private static final long serialVersionUID = 2210349340378984424L;
 
    /**
-    * @configRef desc="If true, data is only written to the cache store when it is evicted from memory, 
+    * @configRef desc="If true, data is only written to the cache store when it is evicted from memory,
     *            a phenomenon known as 'passivation'. Next time the data is requested, it will be 'activated' which
     *            means that data will be brought back to memory and removed from the persistent store.  This gives you
     *            the ability to 'overflow' to disk, similar to swapping in an operating system.
-    *            <p />
+    *            <br /><br />
     *            If false, the cache store contains a copy of the contents in memory, so writes to cache 
     *            result in cache store writes.  This essentially gives you a 'write-through' configuration."
     * */
@@ -81,7 +81,7 @@
     *            (e.g., multiple nodes in a cluster using a JDBC-based CacheStore pointing to the same, shared
     *            database.)  Setting this to true avoids multiple cache instances writing the same modification multiple
     *            times. If enabled, only the node where the modification originated will write to the cache store.
-    *            <p />
+    *            <br /><br />
     *            If disabled, each individual cache reacts to a potential remote update by storing the data to the cache
     *            store. Note that this could be useful if each individual node has its own cache store - perhaps local
     *            on-disk.

Modified: trunk/core/src/main/java/org/infinispan/config/Configuration.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/config/Configuration.java	2009-11-12 16:54:21 UTC (rev 1152)
+++ trunk/core/src/main/java/org/infinispan/config/Configuration.java	2009-11-12 16:55:01 UTC (rev 1153)
@@ -840,7 +840,7 @@
       protected Long lockAcquisitionTimeout = 10000L;
 
       /** @configRef desc="Cache isolation level. Infinispan only supports READ_COMMITTED
-       *             or REPEATABLE_READ isolation levels.  See <a href="http://en.wikipedia.org/wiki/Isolation_level">http://en.wikipedia.org/wiki/Isolation_level</a>
+       *             or REPEATABLE_READ isolation levels.  See <a href='http://en.wikipedia.org/wiki/Isolation_level'>http://en.wikipedia.org/wiki/Isolation_level</a>
        *             for a discussion on isolation levels." */
       protected IsolationLevel isolationLevel = IsolationLevel.READ_COMMITTED;
 
@@ -941,7 +941,8 @@
       /** 
        * @configRef name="mode",desc="Cache mode. For distribution, set mode to either 'd', 'dist' or 'distribution'.
        *            For replication, use either 'r', 'repl' or 'replication'. Finally, for invalidation, 
-       *            'i', 'inv' or 'invalidation'.*/
+       *            'i', 'inv' or 'invalidation'.",defaultValue="D"
+       */
       @XmlAttribute(name="mode")
       protected String stringMode;
 
@@ -1062,7 +1063,7 @@
     * @configRef name="async",parentName="clustering",desc="If this element is present, all communications are 
     *            asynchronous, in that whenever a thread sends a message sent over the wire, it does not wait 
     *            for an acknowledgement before returning. This element is mutually exclusive with the <sync /> 
-    *            element.<p />Characteristics of this can be tuned here."
+    *            element.<br /><br />Characteristics of this can be tuned here."
     */
    @XmlAccessorType(XmlAccessType.PROPERTY)
    public static class AsyncType extends AbstractNamedCacheConfigurationBean {
@@ -1167,13 +1168,13 @@
       private static final long serialVersionUID = 5757161438110848530L;
 
       /** @configRef desc="Maximum lifespan of a cache entry, after which the entry is expired cluster-wide.  -1 means the entries never expire.
-       *                   <p />Note that this can be overriden on a per-entry bassi by using the Cache API."
+       *                   <br /><br />Note that this can be overriden on a per-entry bassi by using the Cache API."
        */
       protected Long lifespan=-1L;
 
       /** @configRef desc="Maximum idle time a cache entry will be maintained in the cache. If the idle time 
        *             is exceeded, the entry will be expired cluster-wide.  -1 means the entries never expire.
-       *             <p />Note that this can be overriden on a per-entry bassi by using the Cache API."
+       *             <br /><br />Note that this can be overriden on a per-entry bassi by using the Cache API."
        */
       protected Long maxIdle=-1L;
 
@@ -1373,7 +1374,7 @@
    /**
     * @configRef name="sync",desc="If this element is present, all communications are synchronous, in that whenever a 
     *            thread sends a message sent over the wire, it blocks until it receives an acknowledgement from the 
-    *            recipient. This element is mutually exclusive with the <async />  element.  <p />Characteristics of this can be tuned here."
+    *            recipient. This element is mutually exclusive with the <async />  element.  <br /><br />Characteristics of this can be tuned here."
     *
     */
    @XmlAccessorType(XmlAccessType.PROPERTY)

Modified: trunk/core/src/main/java/org/infinispan/config/GlobalConfiguration.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/config/GlobalConfiguration.java	2009-11-12 16:54:21 UTC (rev 1152)
+++ trunk/core/src/main/java/org/infinispan/config/GlobalConfiguration.java	2009-11-12 16:55:01 UTC (rev 1153)
@@ -25,26 +25,28 @@
 
 /**
  * Configuration component that encapsulates the global configuration.
- * 
- * <p>
- * Note that class GlobalConfiguration contains JAXB annotations. These annotations determine how XML
- * configuration files are read into instances of configuration class hierarchy as well as they
- * provide meta data for configuration file XML schema generation. Please modify these annotations
- * and Java element types they annotate with utmost understanding and care.
- * 
- * @configRef name="global",desc="Defines global settings shared among all cache instances created by a single CacheManager."
+ * <p/>
+ * <p/>
+ * Note that class GlobalConfiguration contains JAXB annotations. These annotations determine how XML configuration
+ * files are read into instances of configuration class hierarchy as well as they provide meta data for configuration
+ * file XML schema generation. Please modify these annotations and Java element types they annotate with utmost
+ * understanding and care.
  *
  * @author Manik Surtani
  * @author Vladimir Blagojevic
+ * @configRef name="global",desc="Defines global settings shared among all cache instances created by a single
+ * CacheManager."
  * @since 4.0
  */
 @SurvivesRestarts
 @Scope(Scopes.GLOBAL)
 @XmlAccessorType(XmlAccessType.FIELD)
- at XmlType(propOrder={})
+ at XmlType(propOrder = {})
 public class GlobalConfiguration extends AbstractConfigurationBean {
 
-   /** The serialVersionUID */
+   /**
+    * The serialVersionUID
+    */
    private static final long serialVersionUID = 8910865501990177720L;
 
    public GlobalConfiguration() {
@@ -57,16 +59,16 @@
    public static final short DEFAULT_MARSHALL_VERSION = Version.getVersionShort();
 
    @XmlElement
-   private FactoryClassWithPropertiesType asyncListenerExecutor = new FactoryClassWithPropertiesType(DefaultExecutorFactory.class.getName());
+   private ExecutorFactoryType asyncListenerExecutor = new ExecutorFactoryType();
 
    @XmlElement
-   private FactoryClassWithPropertiesType asyncTransportExecutor= new FactoryClassWithPropertiesType(DefaultExecutorFactory.class.getName());
+   private ExecutorFactoryType asyncTransportExecutor = new ExecutorFactoryType();
 
    @XmlElement
-   private FactoryClassWithPropertiesType evictionScheduledExecutor= new FactoryClassWithPropertiesType(DefaultScheduledExecutorFactory.class.getName());
+   private ScheduledExecutorFactoryType evictionScheduledExecutor = new ScheduledExecutorFactoryType();
 
    @XmlElement
-   private FactoryClassWithPropertiesType replicationQueueScheduledExecutor= new FactoryClassWithPropertiesType(DefaultScheduledExecutorFactory.class.getName());
+   private ScheduledExecutorFactoryType replicationQueueScheduledExecutor = new ScheduledExecutorFactoryType();
 
    @XmlElement
    private GlobalJmxStatisticsType globalJmxStatistics = new GlobalJmxStatisticsType();
@@ -146,7 +148,7 @@
 
    @Inject
    private void injectDependencies(GlobalComponentRegistry gcr) {
-      this.gcr = gcr;     
+      this.gcr = gcr;
       gcr.registerComponent(asyncListenerExecutor, "asyncListenerExecutor");
       gcr.registerComponent(asyncTransportExecutor, "asyncTransportExecutor");
       gcr.registerComponent(evictionScheduledExecutor, "evictionScheduledExecutor");
@@ -202,11 +204,11 @@
    public void setMarshallerClass(String marshallerClass) {
       serialization.setMarshallerClass(marshallerClass);
    }
-   
+
    public String getTransportNodeName() {
       return transport.nodeName;
    }
-   
+
    public void setTransportNodeName(String nodeName) {
       transport.setNodeName(nodeName);
    }
@@ -227,7 +229,7 @@
    public void setTransportProperties(Properties transportProperties) {
       transport.setProperties(toTypedProperties(transportProperties));
    }
-   
+
    public void setTransportProperties(String transportPropertiesString) {
       transport.setProperties(toTypedProperties(transportPropertiesString));
    }
@@ -270,8 +272,8 @@
    public Properties getAsyncListenerExecutorProperties() {
       return asyncListenerExecutor.properties;
    }
-   
 
+
    public void setAsyncListenerExecutorProperties(Properties asyncListenerExecutorProperties) {
       asyncListenerExecutor.setProperties(toTypedProperties(asyncListenerExecutorProperties));
    }
@@ -295,7 +297,7 @@
    public Properties getEvictionScheduledExecutorProperties() {
       return evictionScheduledExecutor.properties;
    }
-  
+
    public void setEvictionScheduledExecutorProperties(Properties evictionScheduledExecutorProperties) {
       evictionScheduledExecutor.setProperties(toTypedProperties(evictionScheduledExecutorProperties));
    }
@@ -307,7 +309,7 @@
    public Properties getReplicationQueueScheduledExecutorProperties() {
       return replicationQueueScheduledExecutor.properties;
    }
-     
+
    public void setReplicationQueueScheduledExecutorProperties(Properties replicationQueueScheduledExecutorProperties) {
       this.replicationQueueScheduledExecutor.setProperties(toTypedProperties(replicationQueueScheduledExecutorProperties));
    }
@@ -328,7 +330,7 @@
       testImmutability("marshallVersion");
       serialization.version = Version.decodeVersionForSerialization(marshallVersion);
    }
-   
+
    public void setMarshallVersion(String marshallVersion) {
       serialization.setVersion(marshallVersion);
    }
@@ -336,24 +338,24 @@
    public long getDistributedSyncTimeout() {
       return transport.distributedSyncTimeout;
    }
-   
+
    public void setDistributedSyncTimeout(long distributedSyncTimeout) {
       transport.distributedSyncTimeout = distributedSyncTimeout;
    }
-   
-    public void accept(ConfigurationBeanVisitor v) {        
-        asyncListenerExecutor.accept(v);
-        asyncTransportExecutor.accept(v);
-        evictionScheduledExecutor.accept(v);
-        globalJmxStatistics.accept(v);
-        replicationQueueScheduledExecutor.accept(v);
-        serialization.accept(v);
-        shutdown.accept(v);
-        transport.accept(v);   
-        v.visitGlobalConfiguration(this);
-    }
 
- at Override
+   public void accept(ConfigurationBeanVisitor v) {
+      asyncListenerExecutor.accept(v);
+      asyncTransportExecutor.accept(v);
+      evictionScheduledExecutor.accept(v);
+      globalJmxStatistics.accept(v);
+      replicationQueueScheduledExecutor.accept(v);
+      serialization.accept(v);
+      shutdown.accept(v);
+      transport.accept(v);
+      v.visitGlobalConfiguration(this);
+   }
+
+   @Override
    public boolean equals(Object o) {
       if (this == o) return true;
       if (o == null || getClass() != o.getClass()) return false;
@@ -369,21 +371,21 @@
          return false;
       if (asyncTransportExecutor.properties != null ? !asyncTransportExecutor.properties.equals(that.asyncTransportExecutor.properties) : that.asyncTransportExecutor.properties != null)
          return false;
-      if (transport.clusterName != null ? !transport.clusterName.equals(that.transport.clusterName) : that.transport.clusterName != null) 
+      if (transport.clusterName != null ? !transport.clusterName.equals(that.transport.clusterName) : that.transport.clusterName != null)
          return false;
       if (defaultConfiguration != null ? !defaultConfiguration.equals(that.defaultConfiguration) : that.defaultConfiguration != null)
          return false;
       if (evictionScheduledExecutor.factory != null ? !evictionScheduledExecutor.factory.equals(that.evictionScheduledExecutor.factory) : that.evictionScheduledExecutor.factory != null)
          return false;
-      if (evictionScheduledExecutor.properties != null ? !evictionScheduledExecutor.properties.equals(that.evictionScheduledExecutor.properties) : that.evictionScheduledExecutor.properties  != null)
+      if (evictionScheduledExecutor.properties != null ? !evictionScheduledExecutor.properties.equals(that.evictionScheduledExecutor.properties) : that.evictionScheduledExecutor.properties != null)
          return false;
-      if (serialization.marshallerClass != null ? !serialization.marshallerClass .equals(that.serialization.marshallerClass ) : that.serialization.marshallerClass  != null)
+      if (serialization.marshallerClass != null ? !serialization.marshallerClass.equals(that.serialization.marshallerClass) : that.serialization.marshallerClass != null)
          return false;
-      if (replicationQueueScheduledExecutor.factory != null ? !replicationQueueScheduledExecutor.factory .equals(that.replicationQueueScheduledExecutor.factory ) : that.replicationQueueScheduledExecutor.factory  != null)
+      if (replicationQueueScheduledExecutor.factory != null ? !replicationQueueScheduledExecutor.factory.equals(that.replicationQueueScheduledExecutor.factory) : that.replicationQueueScheduledExecutor.factory != null)
          return false;
       if (replicationQueueScheduledExecutor.properties != null ? !replicationQueueScheduledExecutor.properties.equals(that.replicationQueueScheduledExecutor.properties) : that.replicationQueueScheduledExecutor.properties != null)
          return false;
-      if (shutdown.hookBehavior != null ? !shutdown.hookBehavior.equals(that.shutdown.hookBehavior) : that.shutdown.hookBehavior != null) 
+      if (shutdown.hookBehavior != null ? !shutdown.hookBehavior.equals(that.shutdown.hookBehavior) : that.shutdown.hookBehavior != null)
          return false;
       if (transport.transportClass != null ? !transport.transportClass.equals(that.transport.transportClass) : that.transport.transportClass != null)
          return false;
@@ -400,14 +402,14 @@
       result = 31 * result + (asyncTransportExecutor.factory != null ? asyncTransportExecutor.factory.hashCode() : 0);
       result = 31 * result + (asyncTransportExecutor.properties != null ? asyncTransportExecutor.properties.hashCode() : 0);
       result = 31 * result + (evictionScheduledExecutor.factory != null ? evictionScheduledExecutor.factory.hashCode() : 0);
-      result = 31 * result + ( evictionScheduledExecutor.properties  != null ? evictionScheduledExecutor.properties.hashCode() : 0);
-      result = 31 * result + (replicationQueueScheduledExecutor.factory  != null ? replicationQueueScheduledExecutor.factory.hashCode() : 0);
+      result = 31 * result + (evictionScheduledExecutor.properties != null ? evictionScheduledExecutor.properties.hashCode() : 0);
+      result = 31 * result + (replicationQueueScheduledExecutor.factory != null ? replicationQueueScheduledExecutor.factory.hashCode() : 0);
       result = 31 * result + (replicationQueueScheduledExecutor.properties != null ? replicationQueueScheduledExecutor.properties.hashCode() : 0);
-      result = 31 * result + (serialization.marshallerClass  != null ? serialization.marshallerClass .hashCode() : 0);
+      result = 31 * result + (serialization.marshallerClass != null ? serialization.marshallerClass.hashCode() : 0);
       result = 31 * result + (transport.transportClass != null ? transport.transportClass.hashCode() : 0);
-      result = 31 * result + (transport.properties  != null ? transport.properties .hashCode() : 0);
+      result = 31 * result + (transport.properties != null ? transport.properties.hashCode() : 0);
       result = 31 * result + (defaultConfiguration != null ? defaultConfiguration.hashCode() : 0);
-      result = 31 * result + (transport.clusterName  != null ? transport.clusterName .hashCode() : 0);
+      result = 31 * result + (transport.clusterName != null ? transport.clusterName.hashCode() : 0);
       result = 31 * result + (shutdown.hookBehavior.hashCode());
       result = 31 * result + ((int) serialization.version.hashCode());
       result = (int) (31 * result + transport.distributedSyncTimeout);
@@ -421,8 +423,10 @@
          if (asyncListenerExecutor != null) dolly.asyncListenerExecutor = asyncListenerExecutor.clone();
          if (asyncTransportExecutor != null) dolly.asyncTransportExecutor = asyncTransportExecutor.clone();
          if (evictionScheduledExecutor != null) dolly.evictionScheduledExecutor = evictionScheduledExecutor.clone();
-         if (replicationQueueScheduledExecutor != null) dolly.replicationQueueScheduledExecutor = replicationQueueScheduledExecutor.clone();
-         if (globalJmxStatistics != null) dolly.globalJmxStatistics = (GlobalJmxStatisticsType) globalJmxStatistics.clone();
+         if (replicationQueueScheduledExecutor != null)
+            dolly.replicationQueueScheduledExecutor = replicationQueueScheduledExecutor.clone();
+         if (globalJmxStatistics != null)
+            dolly.globalJmxStatistics = (GlobalJmxStatisticsType) globalJmxStatistics.clone();
          if (transport != null) dolly.transport = transport.clone();
          if (serialization != null) dolly.serialization = (SerializationType) serialization.clone();
          if (shutdown != null) dolly.shutdown = (ShutdownType) shutdown.clone();
@@ -461,48 +465,24 @@
       return gc;
    }
 
-   /**
-    * @configRef name="asyncListenerExecutor",desc="Configuration for the executor service used to emit notifications to asynchronous listeners."
-    * @configRef name="asyncTransportExecutor",desc="Configuration for the executor service used for asynchronous work on the Transport, including asynchronous marshalling and Cache 'async operations' such as Cache.putAsync()."
-    * @configRef name="evictionScheduledExecutor",desc="Configuration for the scheduled executor service used to periodically run eviction cleanup tasks."
-    * @configRef name="replicationQueueScheduledExecutor",desc="Configuration for the scheduled executor service used to periodically flush replication queues, used if asynchronous clustering is enabled along with useReplQueue being set to true."
-    */
-   @XmlAccessorType(XmlAccessType.PROPERTY)
-   public static class FactoryClassWithPropertiesType extends AbstractConfigurationBeanWithGCR {
+   public abstract static class FactoryClassWithPropertiesType extends AbstractConfigurationBeanWithGCR {
 
-      /** The serialVersionUID */
+      /**
+       * The serialVersionUID
+       */
       private static final long serialVersionUID = 7625606997888180254L;
 
-      /** @configRef desc="Fully qualified class name of the ExecutorFactory (or ScheduledExecutorFactory) to use.  Must implement org.infinispan.executors.ExecutorFactory (or ScheduledExecutorFactory), and defaults to org.infinispan.executors.DefaultExecutorFactory (or DefaultScheduledExecutorFactory)" */
-      @XmlAttribute
-      protected String factory;
-
-      /** 
+      /**
        * @configPropertyRef name="maxThreads",desc="Maximum number of threads for this executor."
        * @configPropertyRef name="threadNamePrefix",desc="Thread name prefix for threads created by this executor."
-       * */
-      @XmlElement(name="properties")
+       */
+      @XmlElement(name = "properties")
       protected TypedProperties properties = EMPTY_PROPERTIES;
 
-      public FactoryClassWithPropertiesType(String factory) {
-         super();
-         this.factory = factory;
-      }   
-
       public void accept(ConfigurationBeanVisitor v) {
          v.visitFactoryClassWithPropertiesType(this);
       }
 
-      public FactoryClassWithPropertiesType() {
-         super();
-         this.factory = "";
-      }
-
-      public void setFactory(String factory) {
-         testImmutability("factory");
-         this.factory = factory;
-      }
-
       public void setProperties(TypedProperties properties) {
          testImmutability("properties");
          this.properties = properties;
@@ -517,26 +497,104 @@
    }
 
    /**
-    * @configRef name="transport",desc="This element configures the transport used for network communications across the cluster." 
+    * @configRef name="asyncListenerExecutor",desc="Configuration for the executor service used to emit notifications to
+    * asynchronous listeners."
+    * @configRef name="asyncTransportExecutor",desc="Configuration for the executor service used for asynchronous work
+    * on the Transport, including asynchronous marshalling and Cache 'async operations' such as Cache.putAsync()."
     */
    @XmlAccessorType(XmlAccessType.PROPERTY)
+   public static class ExecutorFactoryType extends FactoryClassWithPropertiesType {
+      /**
+       * @configRef desc="Fully qualified class name of the ExecutorFactory to use.  Must
+       * implement org.infinispan.executors.ExecutorFactory"
+       */
+      @XmlAttribute
+      protected String factory = DefaultExecutorFactory.class.getName();
+
+      public ExecutorFactoryType(String factory) {
+         this.factory = factory;
+      }
+
+      public ExecutorFactoryType() {
+      }
+
+      public void setFactory(String factory) {
+         testImmutability("factory");
+         this.factory = factory;
+      }
+
+      @Override
+      public ExecutorFactoryType clone() throws CloneNotSupportedException {
+         return (ExecutorFactoryType) super.clone();
+      }
+   }
+
+   /**
+    * @configRef name="evictionScheduledExecutor",desc="Configuration for the scheduled executor service used to
+    * periodically run eviction cleanup tasks."
+    * @configRef name="replicationQueueScheduledExecutor",desc="Configuration for the scheduled executor service used to
+    * periodically flush replication queues, used if asynchronous clustering is enabled along with useReplQueue being
+    * set to true."
+    */
+   @XmlAccessorType(XmlAccessType.PROPERTY)
+   public static class ScheduledExecutorFactoryType extends FactoryClassWithPropertiesType {
+      /**
+       * @configRef desc="Fully qualified class name of the ScheduledExecutorFactory to use.  Must
+       * implement org.infinispan.executors.ScheduledExecutorFactory"
+       */
+      @XmlAttribute
+      protected String factory = DefaultScheduledExecutorFactory.class.getName();
+
+      public ScheduledExecutorFactoryType(String factory) {
+         this.factory = factory;
+      }
+
+      public ScheduledExecutorFactoryType() {
+      }
+
+      public void setFactory(String factory) {
+         testImmutability("factory");
+         this.factory = factory;
+      }
+
+      @Override
+      public ScheduledExecutorFactoryType clone() throws CloneNotSupportedException {
+         return (ScheduledExecutorFactoryType) super.clone();
+      }
+   }
+
+   /**
+    * @configRef name="transport",desc="This element configures the transport used for network communications across the
+    * cluster."
+    */
+   @XmlAccessorType(XmlAccessType.PROPERTY)
    public static class TransportType extends AbstractConfigurationBeanWithGCR {
 
-      /** The serialVersionUID */
+      /**
+       * The serialVersionUID
+       */
       private static final long serialVersionUID = -4739815717370060368L;
 
-      /** @configRef desc="This defines the name of the cluster.  Nodes only connect to clusters sharing the same name." */
+      /**
+       * @configRef desc="This defines the name of the cluster.  Nodes only connect to clusters sharing the same name."
+       */
       protected String clusterName = "Infinispan-Cluster";
 
-      /** @configRef desc="Cluster-wide synchronization timeout for locks.  Used to coordinate changes in cluster membership." */
+      /**
+       * @configRef desc="Cluster-wide synchronization timeout for locks.  Used to coordinate changes in cluster
+       * membership."
+       */
       protected Long distributedSyncTimeout = 60000L; // default
 
-      /** @configRef desc="Fully qualified name of a class that represents a network transport.  Must
-       *             implement org.infinispan.remoting.transport.Transport"*/
+      /**
+       * @configRef desc="Fully qualified name of a class that represents a network transport.  Must implement
+       * org.infinispan.remoting.transport.Transport"
+       */
       protected String transportClass = null; // this defaults to a non-clustered cache.
 
       /**
-       * @configRef desc="Name of the current node.  This is a friendly name to make logs, etc. make more sense.  Defaults to a combination of host name and a random number (to differentiate multiple nodes on the same host)"
+       * @configRef desc="Name of the current node.  This is a friendly name to make logs, etc. make more sense.
+       * Defaults to a combination of host name and a random number (to differentiate multiple nodes on the same host)"
        */
       protected String nodeName = null;
 
@@ -580,7 +638,7 @@
          this.nodeName = nodeName;
       }
 
-    @XmlElement
+      @XmlElement
       public void setProperties(TypedProperties properties) {
          testImmutability("properties");
          this.properties = properties;
@@ -596,20 +654,26 @@
 
    /**
     * @configRef name="serialization",desc="Serialization and marshalling settings."
-    */   
+    */
    @XmlAccessorType(XmlAccessType.PROPERTY)
    public static class SerializationType extends AbstractConfigurationBeanWithGCR {
 
-      /** The serialVersionUID */
+      /**
+       * The serialVersionUID
+       */
       private static final long serialVersionUID = -925947118621507282L;
 
-      /** @configRef desc="Fully qualified name of the marshaller to use. It must
-       *             implement org.infinispan.marshall.Marshaller."*/
+      /**
+       * @configRef desc="Fully qualified name of the marshaller to use. It must implement
+       * org.infinispan.marshall.Marshaller."
+       */
       protected String marshallerClass = VersionAwareMarshaller.class.getName(); // the default
 
-      /** @configRef desc="Largest allowable version to use when marshalling internal state.  Set this to the lowest version
-       *                   cache instance in your cluster to ensure compatibility of communications.  However, setting this
-       *                   too low will mean you lose out on the benefit of improvements in newer versions of the marshaller."*/
+      /**
+       * @configRef desc="Largest allowable version to use when marshalling internal state.  Set this to the lowest
+       * version cache instance in your cluster to ensure compatibility of communications.  However, setting this too
+       * low will mean you lose out on the benefit of improvements in newer versions of the marshaller."
+       */
       protected String version = Version.getMajorVersion();
 
       public SerializationType() {
@@ -634,27 +698,37 @@
    }
 
    /**
-    * @configRef name="globalJmxStatistics",desc="This element specifies whether global statistics are gathered and 
-    *            reported via JMX for all caches under this cache manager."
+    * @configRef name="globalJmxStatistics",desc="This element specifies whether global statistics are gathered and
+    * reported via JMX for all caches under this cache manager."
     */
    @XmlAccessorType(XmlAccessType.PROPERTY)
    public static class GlobalJmxStatisticsType extends AbstractConfigurationBeanWithGCR {
 
-      /** The serialVersionUID */
+      /**
+       * The serialVersionUID
+       */
       private static final long serialVersionUID = 6639689526822921024L;
 
-      /** @configRef desc="Toggle to enable/disable global statistics being exported via JMX." */
+      /**
+       * @configRef desc="Toggle to enable/disable global statistics being exported via JMX."
+       */
       protected Boolean enabled = false;
 
-      /** @configRef desc="JMX domain name where all relevant JMX exposed objects will be bound" */
+      /**
+       * @configRef desc="JMX domain name where all relevant JMX exposed objects will be bound"
+       */
       protected String jmxDomain = "infinispan";
 
-      /** @configRef desc="Fully qualified name of class that will attempt to locate a JMX MBean server to bind to" */
+      /**
+       * @configRef desc="Fully qualified name of class that will attempt to locate a JMX MBean server to bind to"
+       */
       protected String mBeanServerLookup = PlatformMBeanServerLookup.class.getName();
 
-      /** @configRef desc="If true, multiple cache manager instances could be configured under the same configured 
-       *            JMX domain. Each cache manager will in practice use a different JMX domain that has been 
-       *            calculated based on the configured one by adding an incrementing index to it." */
+      /**
+       * @configRef desc="If true, multiple cache manager instances could be configured under the same configured JMX
+       * domain. Each cache manager will in practice use a different JMX domain that has been calculated based on the
+       * configured one by adding an incrementing index to it."
+       */
       protected Boolean allowDuplicateDomains = false;
 
       @XmlAttribute
@@ -687,19 +761,23 @@
    }
 
    /**
-    * 
-    * @configRef name="shutdown",desc=" This element specifies behavior when the JVM running the cache instance shuts down."
-    */   
+    * @configRef name="shutdown",desc=" This element specifies behavior when the JVM running the cache instance shuts
+    * down."
+    */
    @XmlAccessorType(XmlAccessType.PROPERTY)
    public static class ShutdownType extends AbstractConfigurationBeanWithGCR {
 
-      /** The serialVersionUID */
+      /**
+       * The serialVersionUID
+       */
       private static final long serialVersionUID = 3427920991221031456L;
 
-      /** @configRef desc="Behavior of the JVM shutdown hook registered by the cache. The options available are: 
-       *         DEFAULT - A shutdown hook is registered even if no MBean server (apart from the JDK default) is detected.
-       *         REGISTER - Forces the cache to register a shutdown hook even if an MBean server is detected.
-       *         DONT_REGISTER - Forces the cache NOT to register a shutdown hook, even if no MBean server is detected.*/
+      /**
+       * @configRef desc="Behavior of the JVM shutdown hook registered by the cache. The options available are: DEFAULT
+       * - A shutdown hook is registered even if no MBean server (apart from the JDK default) is detected. REGISTER -
+       * Forces the cache to register a shutdown hook even if an MBean server is detected. DONT_REGISTER - Forces the
+       * cache NOT to register a shutdown hook, even if no MBean server is detected.
+       */
       protected ShutdownHookBehavior hookBehavior = ShutdownHookBehavior.DEFAULT;
 
       @XmlAttribute
@@ -714,9 +792,11 @@
    }
 }
 
-abstract class AbstractConfigurationBeanWithGCR extends AbstractConfigurationBean{
+abstract class AbstractConfigurationBeanWithGCR extends AbstractConfigurationBean {
 
-   /** The serialVersionUID */
+   /**
+    * The serialVersionUID
+    */
    private static final long serialVersionUID = -5124687543159561028L;
 
    GlobalComponentRegistry gcr = null;
@@ -734,16 +814,16 @@
 }
 
 class PropertiesType {
-    
+
    @XmlElement(name = "property")
    Property properties[];
 }
 
 class Property {
-   
+
    @XmlAttribute
    String name;
-   
+
    @XmlAttribute
    String value;
 }

Modified: trunk/core/src/main/java/org/infinispan/loaders/AbstractCacheLoaderConfig.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/loaders/AbstractCacheLoaderConfig.java	2009-11-12 16:54:21 UTC (rev 1152)
+++ trunk/core/src/main/java/org/infinispan/loaders/AbstractCacheLoaderConfig.java	2009-11-12 16:55:01 UTC (rev 1153)
@@ -1,13 +1,13 @@
 package org.infinispan.loaders;
 
+import org.infinispan.CacheException;
+import org.infinispan.config.ConfigurationBeanVisitor;
+import org.infinispan.config.PluggableConfigurationComponent;
+
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAttribute;
 
-import org.infinispan.CacheException;
-import org.infinispan.config.ConfigurationBeanVisitor;
-import org.infinispan.config.PluggableConfigurationComponent;
-
 /**
  * Abstract base class for CacheLoaderConfigs.
  * 

Modified: trunk/core/src/main/java/org/infinispan/loaders/AbstractCacheStoreConfig.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/loaders/AbstractCacheStoreConfig.java	2009-11-12 16:54:21 UTC (rev 1152)
+++ trunk/core/src/main/java/org/infinispan/loaders/AbstractCacheStoreConfig.java	2009-11-12 16:55:01 UTC (rev 1153)
@@ -40,15 +40,15 @@
    private static final long serialVersionUID = 4607371052771122893L;
 
    /** @configRef desc="If true, any operation that modifies the cache (put, remove, clear, store...etc) won't be 
-    *             applied to the cache store." */
+    *             applied to the cache store.  This means that the cache store could become out of sync with the cache." */
    protected Boolean ignoreModifications = false;
 
    /** @configRef desc="If true, fetch persistent state when joining a cluster. If multiple cache stores are chained, 
-    *             only one of them can have this propertye enabled. Persistent state transfer with a shared cache 
+    *             only one of them can have this property enabled. Persistent state transfer with a shared cache
     *             store does not make sense, as the same persistent store that provides the data will just end up 
     *             receiving it. Therefore, if a shared cache store is used, the cache will not allow a persistent 
     *             state transfer even if a cache store has this property set to true. Finally, setting it to true only 
-    *             makes sense if for clustered environments." */
+    *             makes sense if in a clustered environment, and only 'replication' and 'invalidation' cluster modes are supported." */
    protected Boolean fetchPersistentState = false;
 
    /** @configRef desc="If true, purges this cache store when it starts up." */

Modified: trunk/core/src/main/java/org/infinispan/loaders/decorators/AsyncStore.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/loaders/decorators/AsyncStore.java	2009-11-12 16:54:21 UTC (rev 1152)
+++ trunk/core/src/main/java/org/infinispan/loaders/decorators/AsyncStore.java	2009-11-12 16:55:01 UTC (rev 1153)
@@ -203,7 +203,7 @@
 
    private void acquireLock(Lock lock) {
       try {
-         if (!lock.tryLock(asyncStoreConfig.getMapLockTimeout(), TimeUnit.MILLISECONDS))
+         if (!lock.tryLock(asyncStoreConfig.getFlushLockTimeout(), TimeUnit.MILLISECONDS))
             throw new CacheException("Unable to acquire lock on update map");
       } catch (InterruptedException ie) {
          // restore interrupted status

Modified: trunk/core/src/main/java/org/infinispan/loaders/decorators/AsyncStoreConfig.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/loaders/decorators/AsyncStoreConfig.java	2009-11-12 16:54:21 UTC (rev 1152)
+++ trunk/core/src/main/java/org/infinispan/loaders/decorators/AsyncStoreConfig.java	2009-11-12 16:55:01 UTC (rev 1153)
@@ -1,13 +1,13 @@
 package org.infinispan.loaders.decorators;
 
+import org.infinispan.config.AbstractNamedCacheConfigurationBean;
+import org.infinispan.config.ConfigurationBeanVisitor;
+import org.infinispan.config.Dynamic;
+
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAttribute;
 
-import org.infinispan.config.AbstractNamedCacheConfigurationBean;
-import org.infinispan.config.ConfigurationBeanVisitor;
-import org.infinispan.config.Dynamic;
-
 /**
  * Configuration for the async cache loader
  * 
@@ -17,7 +17,8 @@
  * provide meta data for configuration file XML schema generation. Please modify these annotations
  * and Java element types they annotate with utmost understanding and care.
  *
- * @configRef name="async",parentName="loader",desc="Configuration for the async cache loader."
+ * @configRef name="async",parentName="loader",desc="Configuration for the async cache loader.  If enabled, this provides
+ *                   you with asynchronous writes to the cache store, giving you 'write-behind' caching."
  *
  * @author Manik Surtani
  * @author Vladimir Blagojevic
@@ -35,9 +36,9 @@
    /** @configRef desc="Size of the thread pool whose threads are responsible for applying the modifications." */
    protected Integer threadPoolSize = 1;
 
-   /** @configRef desc="Lock timeout for access to map containing latest state." */
+   /** @configRef desc="Timeout to acquire the lock which guards the state to be flushed to the cache store periodically." */
    @Dynamic
-   protected Long mapLockTimeout = 5000L;
+   protected Long flushLockTimeout = 5000L;
 
    @XmlAttribute
    public Boolean isEnabled() {
@@ -60,13 +61,13 @@
    }
 
    @XmlAttribute
-   public Long getMapLockTimeout() {
-      return mapLockTimeout;
+   public Long getFlushLockTimeout() {
+      return flushLockTimeout;
    }
 
-   public void setMapLockTimeout(Long stateLockTimeout) {
-      testImmutability("mapLockTimeout");
-      this.mapLockTimeout = stateLockTimeout;
+   public void setFlushLockTimeout(Long stateLockTimeout) {
+      testImmutability("flushLockTimeout");
+      this.flushLockTimeout = stateLockTimeout;
    }   
 
    @Override

Modified: trunk/core/src/main/java/org/infinispan/loaders/decorators/SingletonStoreConfig.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/loaders/decorators/SingletonStoreConfig.java	2009-11-12 16:54:21 UTC (rev 1152)
+++ trunk/core/src/main/java/org/infinispan/loaders/decorators/SingletonStoreConfig.java	2009-11-12 16:55:01 UTC (rev 1153)
@@ -1,12 +1,12 @@
 package org.infinispan.loaders.decorators;
 
+import org.infinispan.config.AbstractNamedCacheConfigurationBean;
+import org.infinispan.config.ConfigurationBeanVisitor;
+
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAttribute;
 
-import org.infinispan.config.AbstractNamedCacheConfigurationBean;
-import org.infinispan.config.ConfigurationBeanVisitor;
-
 /**
  * Configuration for a singleton store
  * 
@@ -17,7 +17,7 @@
  * and Java element types they annotate with utmost understanding and care.
  *
  * @configRef name="singletonStore",desc="SingletonStore is a delegating cache store used for situations when only one 
- * instance should interact with the underlying store. The coordinator of the cluster will be responsible for 
+ * instance in a cluster should interact with the underlying store. The coordinator of the cluster will be responsible for
  * the underlying CacheStore. SingletonStore is a simply facade to a real CacheStore implementation. It always 
  * delegates reads to the real CacheStore."
  *

Modified: trunk/core/src/main/java/org/infinispan/util/TypedProperties.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/util/TypedProperties.java	2009-11-12 16:54:21 UTC (rev 1152)
+++ trunk/core/src/main/java/org/infinispan/util/TypedProperties.java	2009-11-12 16:55:01 UTC (rev 1153)
@@ -4,17 +4,16 @@
 import org.infinispan.util.logging.Log;
 import org.infinispan.util.logging.LogFactory;
 
-import java.util.Properties;
-
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.util.Properties;
 
 /**
  * Type-aware properties.  Extends the JDK {@link Properties} class to provide accessors that convert values to certain
  * types, using default values if a conversion is not possible.
  * 
  *
- * @configRef name="properties"
+ * @configRef name="Properties to add to the enclosing component."
  *
  * @author Manik Surtani
  * @since 4.0

Modified: trunk/core/src/test/java/org/infinispan/config/parsing/XmlFileParsingTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/config/parsing/XmlFileParsingTest.java	2009-11-12 16:54:21 UTC (rev 1152)
+++ trunk/core/src/test/java/org/infinispan/config/parsing/XmlFileParsingTest.java	2009-11-12 16:55:01 UTC (rev 1153)
@@ -164,7 +164,7 @@
       assert csConf.getSingletonStoreConfig().getPushStateTimeout() == 20000;
       assert csConf.getSingletonStoreConfig().isPushStateWhenCoordinator() == true;
       assert csConf.getAsyncStoreConfig().getThreadPoolSize() == 5;
-      assert csConf.getAsyncStoreConfig().getMapLockTimeout() == 15000;
+      assert csConf.getAsyncStoreConfig().getFlushLockTimeout() == 15000;
       assert csConf.getAsyncStoreConfig().isEnabled();
 
       c = namedCaches.get("withouthJmxEnabled");
@@ -294,7 +294,7 @@
       assert csConf.getSingletonStoreConfig().getPushStateTimeout() == 254L;
       assert csConf.getSingletonStoreConfig().isPushStateWhenCoordinator() == true;
       assert csConf.getAsyncStoreConfig().getThreadPoolSize() == 7;
-      assert csConf.getAsyncStoreConfig().getMapLockTimeout() == 15000;
+      assert csConf.getAsyncStoreConfig().getFlushLockTimeout() == 15000;
       assert csConf.getAsyncStoreConfig().isEnabled();
    }
 }
\ No newline at end of file



More information about the infinispan-commits mailing list