[infinispan-commits] Infinispan SVN: r2602 - trunk/core/src/main/java/org/infinispan/config.
infinispan-commits at lists.jboss.org
infinispan-commits at lists.jboss.org
Mon Oct 25 12:11:20 EDT 2010
Author: vblagojevic at jboss.com
Date: 2010-10-25 12:11:20 -0400 (Mon, 25 Oct 2010)
New Revision: 2602
Modified:
trunk/core/src/main/java/org/infinispan/config/GlobalConfiguration.java
trunk/core/src/main/java/org/infinispan/config/InfinispanConfiguration.java
Log:
[ISPN-626] - Config doc and Javadocs not in sync
Modified: trunk/core/src/main/java/org/infinispan/config/GlobalConfiguration.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/config/GlobalConfiguration.java 2010-10-25 16:08:54 UTC (rev 2601)
+++ trunk/core/src/main/java/org/infinispan/config/GlobalConfiguration.java 2010-10-25 16:11:20 UTC (rev 2602)
@@ -28,29 +28,23 @@
/**
* Configuration component that encapsulates the global configuration.
* <p/>
+ *
* A default instance of this bean takes default values for each attribute. Please see the individual setters for
* details of what these defaults are.
* <p/>
*
* @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
*
* @see <a href="../../../config.html#ce_infinispan_global">Configuration reference</a>
*
*/
-
-// 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.
-
@SurvivesRestarts
@Scope(Scopes.GLOBAL)
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(propOrder = {})
+ at ConfigurationDoc(name="global",desc="Defines global settings shared among all cache instances created by a single CacheManager.")
public class GlobalConfiguration extends AbstractConfigurationBean {
/**
@@ -98,14 +92,21 @@
return globalJmxStatistics.enabled;
}
+ /**
+ * Toggle to enable/disable global statistics being exported via JMX
+ *
+ * @param exposeGlobalJmxStatistics
+ */
public void setExposeGlobalJmxStatistics(boolean exposeGlobalJmxStatistics) {
testImmutability("exposeGlobalManagementStatistics");
globalJmxStatistics.setEnabled(exposeGlobalJmxStatistics);
}
/**
- * If JMX statistics are enabled then all 'published' JMX objects will appear under this name. This is optional, if
- * not specified an object name will be created for you by default.
+ * If JMX statistics are enabled then all 'published' JMX objects will appear under this name.
+ * This is optional, if not specified an object name will be created for you by default.
+ *
+ * @param jmxObjectName
*/
public void setJmxDomain(String jmxObjectName) {
globalJmxStatistics.setJmxDomain(jmxObjectName);
@@ -122,6 +123,11 @@
return globalJmxStatistics.mBeanServerLookup;
}
+ /**
+ * Fully qualified name of class that will attempt to locate a JMX MBean server to bind to
+ *
+ * @param mBeanServerLookup
+ */
public void setMBeanServerLookup(String mBeanServerLookup) {
globalJmxStatistics.setMBeanServerLookup(mBeanServerLookup);
}
@@ -130,6 +136,13 @@
return globalJmxStatistics.allowDuplicateDomains;
}
+ /**
+ * 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.
+ *
+ * @param allowDuplicateDomains
+ */
public void setAllowDuplicateDomains(boolean allowDuplicateDomains) {
globalJmxStatistics.setAllowDuplicateDomains(allowDuplicateDomains);
}
@@ -143,6 +156,7 @@
* with a NamedCacheNotFoundException. Otherwise, operations will succeed but it will be
* logged on the caller that the RPC did not succeed on certain nodes due to the named cache
* not being available.
+ *
* @param strictPeerToPeer flag controlling this behavior
*/
public void setStrictPeerToPeer(boolean strictPeerToPeer) {
@@ -222,6 +236,12 @@
return serialization.marshallerClass;
}
+ /**
+ * Fully qualified name of the marshaller to use. It must implement
+ * org.infinispan.marshall.StreamingMarshaller
+ *
+ * @param marshallerClass
+ */
public void setMarshallerClass(String marshallerClass) {
serialization.setMarshallerClass(marshallerClass);
}
@@ -230,6 +250,13 @@
return transport.nodeName;
}
+ /**
+ * 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)
+ *
+ * @param nodeName
+ */
public void setTransportNodeName(String nodeName) {
transport.setNodeName(nodeName);
}
@@ -239,6 +266,12 @@
}
+ /**
+ * Fully qualified name of a class that represents a network transport. Must implement
+ * org.infinispan.remoting.transport.Transport
+ *
+ * @param transportClass
+ */
public void setTransportClass(String transportClass) {
transport.setTransportClass(transportClass);
}
@@ -259,6 +292,11 @@
return transport.clusterName;
}
+ /**
+ * Defines the name of the cluster. Nodes only connect to clusters sharing the same name.
+ *
+ * @param clusterName
+ */
public void setClusterName(String clusterName) {
transport.setClusterName(clusterName);
}
@@ -267,6 +305,15 @@
return shutdown.hookBehavior;
}
+ /**
+ * 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.
+ *
+ * @param shutdownHookBehavior
+ */
public void setShutdownHookBehavior(ShutdownHookBehavior shutdownHookBehavior) {
shutdown.setHookBehavior(shutdownHookBehavior);
}
@@ -339,11 +386,27 @@
return serialization.version;
}
+ /**
+ * 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.
+ *
+ * @param marshallVersion
+ */
public void setMarshallVersion(short marshallVersion) {
testImmutability("marshallVersion");
serialization.version = Version.decodeVersionForSerialization(marshallVersion);
}
+ /**
+ * 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.
+ *
+ * @param marshallVersion
+ */
public void setMarshallVersion(String marshallVersion) {
serialization.setVersion(marshallVersion);
}
@@ -481,12 +544,13 @@
* The serialVersionUID
*/
private static final long serialVersionUID = 7625606997888180254L;
-
- /**
- * @configPropertyRef name="maxThreads",desc="Maximum number of threads for this executor. Default values can be found <a href="http://community.jboss.org/docs/DOC-15540">here</a>"
- * @configPropertyRef name="threadNamePrefix",desc="Thread name prefix for threads created by this executor. Default values can be found <a href="http://community.jboss.org/docs/DOC-15540">here</a>"
- */
+
@XmlElement(name = "properties")
+ @ConfigurationDocs( {
+ @ConfigurationDoc(name = "maxThreads",
+ desc = "Maximum number of threads for this executor. Default values can be found <a href="http://community.jboss.org/docs/DOC-15540">here</a>"),
+ @ConfigurationDoc(name = "threadNamePrefix",
+ desc = "Thread name prefix for threads created by this executor. Default values can be found <a href="http://community.jboss.org/docs/DOC-15540">here</a>") })
protected TypedProperties properties = EMPTY_PROPERTIES;
public void accept(ConfigurationBeanVisitor v) {
@@ -507,24 +571,22 @@
}
/**
- * @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()."
*
* @see <a href="../../../config.html#ce_global_asyncListenerExecutor">Configuration reference</a>
*
*/
@XmlAccessorType(XmlAccessType.PROPERTY)
+ @ConfigurationDocs( {
+ @ConfigurationDoc(name = "asyncListenerExecutor",
+ desc = "Configuration for the executor service used to emit notifications to asynchronous listeners"),
+ @ConfigurationDoc(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().") })
public static class ExecutorFactoryType extends FactoryClassWithPropertiesType {
private static final long serialVersionUID = 6895901500645539386L;
-
- /**
- * @configRef desc="Fully qualified class name of the ExecutorFactory to use. Must
- * implement org.infinispan.executors.ExecutorFactory"
- */
+
@XmlAttribute
+ @ConfigurationDoc(name="factory", desc="Fully qualified class name of the ExecutorFactory to use. Must implement org.infinispan.executors.ExecutorFactory")
protected String factory = DefaultSharedExecutorFactory.class.getName();
public ExecutorFactoryType(String factory) {
@@ -546,25 +608,23 @@
}
/**
- * @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."
*
+ *
* @see <a href="../../../config.html#ce_global_evictionScheduledExecutor">Configuration reference</a>
*
*/
@XmlAccessorType(XmlAccessType.PROPERTY)
+ @ConfigurationDocs( {
+ @ConfigurationDoc(name = "evictionScheduledExecutor",
+ desc = "Configuration for the scheduled executor service used to periodically run eviction cleanup tasks."),
+ @ConfigurationDoc(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.") })
public static class ScheduledExecutorFactoryType extends FactoryClassWithPropertiesType {
private static final long serialVersionUID = 7806391452092647488L;
- /**
- * @configRef desc="Fully qualified class name of the ScheduledExecutorFactory to use. Must
- * implement org.infinispan.executors.ScheduledExecutorFactory"
- */
@XmlAttribute
+ @ConfigurationDoc(name="factory",desc="Fully qualified class name of the ScheduledExecutorFactory to use. Must implement org.infinispan.executors.ScheduledExecutorFactory")
protected String factory = DefaultSharedScheduledExecutorFactory.class.getName();
public ScheduledExecutorFactoryType(String factory) {
@@ -586,50 +646,36 @@
}
/**
- * @configRef name="transport",desc="This element configures the transport used for network communications across the
- * cluster."
+ * This element configures the transport used for network communications across the cluster.
*
* @see <a href="../../../config.html#ce_global_transport">Configuration reference</a>
*/
@XmlAccessorType(XmlAccessType.PROPERTY)
+ @ConfigurationDoc(name="transport")
public static class TransportType extends AbstractConfigurationBeanWithGCR {
/**
* 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."
- */
+
+ @ConfigurationDocRef(bean=GlobalConfiguration.class,targetElement="setClusterName")
protected String clusterName = "Infinispan-Cluster";
-
- /**
- * @configRef desc = "If set to true, RPC operations will fail if the named cache does not exist on remote nodes
- * with a NamedCacheNotFoundException. Otherwise, operations will succeed but it will be
- * logged on the caller that the RPC did not succeed on certain nodes due to the named cache
- * not being available."
- */
+
+ @ConfigurationDocRef(bean=GlobalConfiguration.class,targetElement="setStrictPeerToPeer")
protected Boolean strictPeerToPeer = true;
-
- /**
- * @configRef desc="Cluster-wide synchronization timeout for locks. Used to coordinate changes in cluster
- * membership."
- */
+
+ @ConfigurationDoc(name="distributedSyncTimeout",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"
- */
+
+ @ConfigurationDocRef(bean=GlobalConfiguration.class,targetElement="setTransportClass")
protected String transportClass = null; // The default constructor sets default to JGroupsTransport
- /**
- * @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)"
- */
+
+ @ConfigurationDocRef(bean=GlobalConfiguration.class,targetElement="setTransportNodeName")
protected String nodeName = null;
+ @XmlElement(name = "properties")
protected TypedProperties properties = EMPTY_PROPERTIES;
public TransportType() {
@@ -669,14 +715,13 @@
testImmutability("nodeName");
this.nodeName = nodeName;
}
-
- @XmlElement
+
public void setProperties(TypedProperties properties) {
testImmutability("properties");
this.properties = properties;
}
- @XmlElement
+ @XmlAttribute
public void setStrictPeerToPeer(Boolean strictPeerToPeer) {
testImmutability("strictPeerToPeer");
this.strictPeerToPeer = strictPeerToPeer;
@@ -691,11 +736,12 @@
}
/**
- * @configRef name="serialization",desc="Serialization and marshalling settings."
+ * Serialization and marshalling settings.
*
* @see <a href="../../../config.html#ce_global_serialization">Configuration reference</a>
*/
@XmlAccessorType(XmlAccessType.PROPERTY)
+ @ConfigurationDoc(name="serialization")
public static class SerializationType extends AbstractConfigurationBeanWithGCR {
/**
@@ -703,17 +749,10 @@
*/
private static final long serialVersionUID = -925947118621507282L;
- /**
- * @configRef desc="Fully qualified name of the marshaller to use. It must implement
- * org.infinispan.marshall.StreamingMarshaller."
- */
+ @ConfigurationDocRef(bean=GlobalConfiguration.class,targetElement="setMarshallerClass")
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."
- */
+
+ @ConfigurationDocRef(bean=GlobalConfiguration.class,targetElement="setMarshallVersion")
protected String version = Version.getMajorVersion();
public SerializationType() {
@@ -738,12 +777,13 @@
}
/**
- * @configRef name="globalJmxStatistics",desc="This element specifies whether global statistics are gathered and
- * reported via JMX for all caches under this cache manager."
+ * This element specifies whether global statistics are gathered and reported via JMX for all
+ * caches under this cache manager.
*
* @see <a href="../../../config.html#ce_global_globalJmxStatistics">Configuration reference</a>
*/
@XmlAccessorType(XmlAccessType.PROPERTY)
+ @ConfigurationDoc(name="globalJmxStatistics")
public static class GlobalJmxStatisticsType extends AbstractConfigurationBeanWithGCR {
/**
@@ -751,26 +791,16 @@
*/
private static final long serialVersionUID = 6639689526822921024L;
- /**
- * @configRef desc="Toggle to enable/disable global statistics being exported via JMX."
- */
+ @ConfigurationDocRef(bean=GlobalConfiguration.class,targetElement="setExposeGlobalJmxStatistics")
protected Boolean enabled = false;
-
- /**
- * @configRef desc="JMX domain name where all relevant JMX exposed objects will be bound"
- */
+
+ @ConfigurationDocRef(bean=GlobalConfiguration.class,targetElement="setJmxDomain")
protected String jmxDomain = "infinispan";
- /**
- * @configRef desc="Fully qualified name of class that will attempt to locate a JMX MBean server to bind to"
- */
+ @ConfigurationDocRef(bean=GlobalConfiguration.class,targetElement="setMBeanServerLookup")
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."
- */
+ @ConfigurationDocRef(bean=GlobalConfiguration.class,targetElement="setAllowDuplicateDomains")
protected Boolean allowDuplicateDomains = false;
@XmlAttribute
@@ -803,12 +833,12 @@
}
/**
- * @configRef name="shutdown",desc=" This element specifies behavior when the JVM running the cache instance shuts
- * down."
+ * This element specifies behavior when the JVM running the cache instance shuts down.
*
* @see <a href="../../../config.html#ce_global_shutdown">Configuration reference</a>
*/
@XmlAccessorType(XmlAccessType.PROPERTY)
+ @ConfigurationDoc(name="shutdown")
public static class ShutdownType extends AbstractConfigurationBeanWithGCR {
/**
@@ -816,12 +846,7 @@
*/
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.
- */
+ @ConfigurationDocRef(bean=GlobalConfiguration.class,targetElement="setShutdownHookBehavior")
protected ShutdownHookBehavior hookBehavior = ShutdownHookBehavior.DEFAULT;
@XmlAttribute
Modified: trunk/core/src/main/java/org/infinispan/config/InfinispanConfiguration.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/config/InfinispanConfiguration.java 2010-10-25 16:08:54 UTC (rev 2601)
+++ trunk/core/src/main/java/org/infinispan/config/InfinispanConfiguration.java 2010-10-25 16:11:20 UTC (rev 2602)
@@ -59,20 +59,16 @@
import java.util.Map;
/**
- * InfinispanConfiguration encapsulates root component of Infinispan XML configuration
- * <p/>
- * <p/>
- * Note that class InfinispanConfiguration 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.
- *
+ * InfinispanConfiguration encapsulates root component of Infinispan XML configuration. Can be empty
+ * for sensible defaults throughout, however that would only give you the most basic of local,
+ * non-clustered caches.
+ *
* @author Vladimir Blagojevic
- * @configRef name="infinispan",desc="The root element of an Infinispan configuration. This element can be empty for sensible defaults throughout, however that would only give you the most basic of local, non-clustered caches."
* @since 4.0
*/
@XmlRootElement(name = "infinispan")
@XmlAccessorType(XmlAccessType.FIELD)
+ at ConfigurationDoc(name="infinispan")
public class InfinispanConfiguration implements XmlConfigurationParser, JAXBUnmarshallable {
private static final Log log = LogFactory.getLog(InfinispanConfiguration.class);
More information about the infinispan-commits
mailing list