[infinispan-commits] Infinispan SVN: r745 - in trunk: core/src/main/java/org/infinispan/loaders and 1 other directories.
infinispan-commits at lists.jboss.org
infinispan-commits at lists.jboss.org
Thu Aug 27 08:41:35 EDT 2009
Author: vblagojevic at jboss.com
Date: 2009-08-27 08:41:34 -0400 (Thu, 27 Aug 2009)
New Revision: 745
Modified:
trunk/core/src/main/java/org/infinispan/config/Configuration.java
trunk/core/src/main/java/org/infinispan/config/CustomInterceptorConfig.java
trunk/core/src/main/java/org/infinispan/config/GlobalConfiguration.java
trunk/core/src/main/java/org/infinispan/loaders/AbstractCacheLoaderConfig.java
trunk/tools/src/main/java/org/infinispan/tools/doclet/config/ConfigHtmlGenerator.java
Log:
adding content to configuration reference
Modified: trunk/core/src/main/java/org/infinispan/config/Configuration.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/config/Configuration.java 2009-08-27 11:41:58 UTC (rev 744)
+++ trunk/core/src/main/java/org/infinispan/config/Configuration.java 2009-08-27 12:41:34 UTC (rev 745)
@@ -58,7 +58,7 @@
*
*
* @configRef default|Configures the default cache and acts as a template for other named caches defined.
- * @configRef namedCache
+ * @configRef namedCache| Configures a named cache that builds up on template provided by default cache.
*
* @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
* @author Vladimir Blagojevic
@@ -571,15 +571,22 @@
if (loaders != null ? !loaders.equals(that.loaders) : that.loaders != null)
return false;
if (clustering.mode != that.clustering.mode) return false;
- if (clustering.hash.consistentHashClass != null ? !clustering.hash.consistentHashClass.equals(that.clustering.hash.consistentHashClass) : that.clustering.hash.consistentHashClass != null)
+ if (clustering.hash.consistentHashClass != null ?
+ !clustering.hash.consistentHashClass.equals(that.clustering.hash.consistentHashClass) :
+ that.clustering.hash.consistentHashClass != null)
return false;
- if (customInterceptors.customInterceptors != null ? !customInterceptors.customInterceptors.equals(that.customInterceptors.customInterceptors) : that.customInterceptors.customInterceptors != null)
+ if (customInterceptors.customInterceptors != null ?
+ !customInterceptors.customInterceptors.equals(that.customInterceptors.customInterceptors) :
+ that.customInterceptors.customInterceptors != null)
return false;
if (eviction.strategy != that.eviction.strategy) return false;
- if (globalConfiguration != null ? !globalConfiguration.equals(that.globalConfiguration) : that.globalConfiguration != null)
+ if (globalConfiguration != null ? !globalConfiguration.equals(that.globalConfiguration) :
+ that.globalConfiguration != null)
return false;
if (locking.isolationLevel != that.locking.isolationLevel) return false;
- if (transaction.transactionManagerLookupClass != null ? !transaction.transactionManagerLookupClass.equals(that.transaction.transactionManagerLookupClass) : that.transaction.transactionManagerLookupClass != null)
+ if (transaction.transactionManagerLookupClass != null ?
+ !transaction.transactionManagerLookupClass.equals(that.transaction.transactionManagerLookupClass) :
+ that.transaction.transactionManagerLookupClass != null)
return false;
if (clustering.async.asyncMarshalling != that.clustering.async.asyncMarshalling) return false;
@@ -600,13 +607,15 @@
result = 31 * result + (clustering.mode != null ? clustering.mode.hashCode() : 0);
result = 31 * result + (int) (clustering.stateRetrieval.timeout ^ (clustering.stateRetrieval.timeout >>> 32));
result = 31 * result + (locking.isolationLevel != null ? locking.isolationLevel.hashCode() : 0);
- result = 31 * result + (transaction.transactionManagerLookupClass != null ? transaction.transactionManagerLookupClass.hashCode() : 0);
+ result = 31 * result + (transaction.transactionManagerLookupClass != null ?
+ transaction.transactionManagerLookupClass.hashCode() : 0);
result = 31 * result + (loaders != null ? loaders.hashCode() : 0);
result = 31 * result + (transaction.syncCommitPhase ? 1 : 0);
result = 31 * result + (transaction.syncRollbackPhase ? 1 : 0);
result = 31 * result + (transaction.useEagerLocking ? 1 : 0);
result = 31 * result + (lazyDeserialization.enabled ? 1 : 0);
- result = 31 * result + (customInterceptors.customInterceptors != null ? customInterceptors.customInterceptors.hashCode() : 0);
+ result = 31 * result + (customInterceptors.customInterceptors != null ?
+ customInterceptors.customInterceptors.hashCode() : 0);
result = 31 * result + (locking.writeSkewCheck ? 1 : 0);
result = 31 * result + locking.concurrencyLevel;
result = 31 * result + (invocationBatching.enabled ? 1 : 0);
@@ -749,15 +758,22 @@
/** The serialVersionUID */
private static final long serialVersionUID = 8142143187082119506L;
+ /** @configRef |Maximum time to attempt particular lock acquisition*/
@Dynamic
protected Long lockAcquisitionTimeout = 10000L;
+ /** @configRef |Isolation level*/
protected IsolationLevel isolationLevel = IsolationLevel.READ_COMMITTED;
+ /** @configRef |If true, write skews are tested and exceptions
+ * are thrown if detected (only for IsolationLevel#REPEATABLE_READ)*/
protected Boolean writeSkewCheck = false;
+ /** @configRef |Toggle to enable/disable shared locks across all
+ * elements that need to be locked*/
protected Boolean useLockStriping = true;
+ /** @configRef |Concurrency level for number of stripes to create in lock striping*/
protected Integer concurrencyLevel = 500;
@@ -886,7 +902,8 @@
/**
*
- * @configRef async:clustering;|Specifies that network communications are asynchronous. Characteristics of this can be tuned here.
+ * @configRef async:clustering:|Specifies that network communications are asynchronous.
+ * Characteristics of this can be tuned here.
*/
@XmlAccessorType(XmlAccessType.PROPERTY)
private static class AsyncType extends AbstractNamedCacheConfigurationBean {
@@ -897,12 +914,16 @@
/** The serialVersionUID */
private static final long serialVersionUID = -7726319188826197399L;
+ /** @configRef |Toggle to enable/disable queue*/
protected Boolean useReplQueue=false;
+ /** @configRef |Maximum allowed number of requests in a queue*/
protected Integer replQueueMaxElements=1000;
+ /** @configRef |Interval to take requests of the queue*/
protected Long replQueueInterval=5000L;
+ /** @configRef |Toggle to enable/disable asynchronous marshalling*/
protected Boolean asyncMarshalling=true;
@@ -950,8 +971,10 @@
/** The serialVersionUID */
private static final long serialVersionUID = 5757161438110848530L;
+ /** @configRef |Maximum lifespan of a cache entry*/
protected Long lifespan=-1L;
+ /** @configRef |Maximum time between two subsequent accesses to a particular cache entry */
protected Long maxIdle=-1L;
@XmlAttribute
@@ -977,10 +1000,13 @@
/** The serialVersionUID */
private static final long serialVersionUID = -1248563712058858791L;
+ /** @configRef |Interval between subsequent eviction runs*/
protected Long wakeUpInterval=5000L;
+ /** @configRef |Eviction strategy */
protected EvictionStrategy strategy=EvictionStrategy.NONE;
+ /** @configRef |Maximum number of entries in a cache instance */
protected Integer maxEntries=-1;
@XmlAttribute
@@ -1013,9 +1039,11 @@
/** The serialVersionUID */
private static final long serialVersionUID = 3709234918426217096L;
+ /** @configRef |If true, a new cache node with initiate a state transfer upon join*/
@Dynamic
protected Boolean fetchInMemoryState = false;
+ /** @configRef |Timeout for state transfer*/
@Dynamic
protected Long timeout=10000L;
@@ -1034,7 +1062,8 @@
/**
*
- * @configRef sync|Specifies that network communications are synchronous. Characteristics of this can be tuned here.
+ * @configRef sync|Specifies that network communications are synchronous.
+ * Characteristics of this can be tuned here.
*
*/
@XmlAccessorType(XmlAccessType.PROPERTY)
@@ -1042,6 +1071,7 @@
/** The serialVersionUID */
private static final long serialVersionUID = 8419216253674289524L;
+ /** @configRef |Timeout for synchronous requests*/
@Dynamic
protected Long replTimeout=15000L;
@@ -1054,7 +1084,8 @@
/**
*
- * @configRef hash|Allows fine-tuning of rehashing characteristics. Only used with the 'distributed' cache mode, and otherwise ignored.
+ * @configRef hash|Allows fine-tuning of rehashing characteristics.
+ * Only used with the 'distributed' cache mode, and otherwise ignored.
*/
@XmlAccessorType(XmlAccessType.PROPERTY)
private static class HashType extends AbstractNamedCacheConfigurationBean {
@@ -1069,13 +1100,13 @@
protected String consistentHashClass = DefaultConsistentHash.class.getName();
- /** @configDoc number of owners doco here */
+ /** @configRef |Number of neighbour nodes in rehash task*/
protected Integer numOwners=2;
- /** @configDoc rehashWait doco here */
+ /** @configRef |Maximum rehash time */
protected Long rehashWait=60000L;
- /** @configDoc rehashRpcTimeout doco here */
+ /** @configRef |Rehashing timeout */
protected Long rehashRpcTimeout=60 * 1000 * 10L;
@XmlAttribute(name="class")
@@ -1105,7 +1136,8 @@
/**
*
- * @configRef l1|Enables and defines details of the L1 cache. Only used with the 'distributed' cache mode, and otherwise ignored.
+ * @configRef l1|Enables and defines details of the L1 cache.
+ * Only used with the 'distributed' cache mode, and otherwise ignored.
*/
@XmlAccessorType(XmlAccessType.PROPERTY)
private static class L1Type extends AbstractNamedCacheConfigurationBean {
@@ -1113,10 +1145,13 @@
/** The serialVersionUID */
private static final long serialVersionUID = -4703587764861110638L;
+ /** @configRef |Toggle to enable/disable L1 cache */
protected Boolean enabled=true;
+ /** @configRef |Maximum lifespan of an entry in L1 cache*/
protected Long lifespan=600000L;
+ /** @configRef |Toggle to enable/disable populating L1 cache after rehash */
protected Boolean onRehash=true;
@XmlAttribute
@@ -1139,7 +1174,7 @@
}
/**
*
- * @configRef jmxStatistics|Defines how JMX components are bound to an MBean server
+ * @configRef jmxStatistics|Defines how JMX components are bound to an MBean server.
* @configRef lazyDeserialization|Defines lazy deserialization characteristics of the cache.
* @configRef invocationBatching|Defines whether invocation batching is allowed in this cache instance.
*
@@ -1150,8 +1185,10 @@
/** The serialVersionUID */
private static final long serialVersionUID = 2296863404153834686L;
- Boolean enabled = false;
+ /** @configRef |Toggle switch */
+ protected Boolean enabled = false;
+
@XmlAttribute
public void setEnabled(Boolean enabled) {
testImmutability("enabled");
@@ -1169,8 +1206,10 @@
/** The serialVersionUID */
private static final long serialVersionUID = -7178286048602531152L;
+ /** @configRef |Toggle to enable/disable deadlock detection*/
protected Boolean enabled=false;
+ /** @configRef |todo*/
protected Long spinDuration=100L;
@XmlAttribute
@@ -1195,6 +1234,8 @@
/** The serialVersionUID */
private static final long serialVersionUID = -9200921443651234163L;
+
+ /** @configRef |See http://www.jboss.org/community/wiki/infinispantechnicalfaqs */
protected Boolean unreliableReturnValues=false;
@XmlAttribute
@@ -1206,7 +1247,7 @@
/**
*
- * @configRef customInterceptors|Configures custom interceptors to be added to the cache
+ * @configRef customInterceptors|Configures custom interceptors to be added to the cache.
*/
@XmlAccessorType(XmlAccessType.FIELD)
private static class CustomInterceptorsType extends AbstractNamedCacheConfigurationBean {
Modified: trunk/core/src/main/java/org/infinispan/config/CustomInterceptorConfig.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/config/CustomInterceptorConfig.java 2009-08-27 11:41:58 UTC (rev 744)
+++ trunk/core/src/main/java/org/infinispan/config/CustomInterceptorConfig.java 2009-08-27 12:41:34 UTC (rev 745)
@@ -75,6 +75,9 @@
@XmlAttribute
protected Position position;
+ /**
+ * @configRef class|Fully qualified intereceptor class name
+ * */
@XmlAttribute(name="class")
protected String className;
Modified: trunk/core/src/main/java/org/infinispan/config/GlobalConfiguration.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/config/GlobalConfiguration.java 2009-08-27 11:41:58 UTC (rev 744)
+++ trunk/core/src/main/java/org/infinispan/config/GlobalConfiguration.java 2009-08-27 12:41:34 UTC (rev 745)
@@ -32,7 +32,7 @@
* 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 global|Defines global configuration shared among all cache instances
+ * @configRef global|Defines global configuration shared among all cache instances.
*
* @author Manik Surtani
* @author Vladimir Blagojevic
@@ -430,20 +430,21 @@
/**
*
- * @configRef asyncListenerExecutor
- * @configRef asyncTransportExecutor
- * @configRef evictionScheduledExecutor
- * @configRef replicationQueueScheduledExecutor
+ * @configRef asyncListenerExecutor|Executor for listeners.
+ * @configRef asyncTransportExecutor|Transport executor.
+ * @configRef evictionScheduledExecutor|Eviction executor.
+ * @configRef replicationQueueScheduledExecutor|Executor for replication.
*/
@XmlAccessorType(XmlAccessType.PROPERTY)
private static class FactoryClassWithPropertiesType extends AbstractConfigurationBeanWithGCR {
+ /** @configRef |Executor fully qualified class name */
@XmlAttribute
protected String factory;
/**
- * @configPropertyRef maxThreads
- * @configPropertyRef threadNamePrefix
+ * @configPropertyRef maxThreads|Number of threads for this executor
+ * @configPropertyRef threadNamePrefix|Name prefix for threads created in this executor
* */
@XmlElement(name="properties")
protected TypedProperties properties = EMPTY_PROPERTIES;
@@ -478,15 +479,18 @@
/**
*
- * @configRef transport
+ * @configRef transport|Determines Infinispan transport type and accompanying properties.
*/
@XmlAccessorType(XmlAccessType.PROPERTY)
private static class TransportType extends AbstractConfigurationBeanWithGCR {
+ /** @configRef |todo */
protected String clusterName = "Infinispan-Cluster";
+ /** @configRef |todo */
protected Long distributedSyncTimeout = 60000L; // default
+ /** @configRef | Fully qualified name of a class that implements network transport*/
protected String transportClass = null; // this defaults to a non-clustered cache.
protected TypedProperties properties = EMPTY_PROPERTIES;
@@ -536,13 +540,15 @@
/**
*
- * @configRef serialization
+ * @configRef serialization|Serialization and marshalling settings
*/
@XmlAccessorType(XmlAccessType.PROPERTY)
private static class SerializationType extends AbstractConfigurationBeanWithGCR {
+ /** @configRef |Fully qualified name of a class that marshalls objects between cache nodes*/
protected String marshallerClass = VersionAwareMarshaller.class.getName(); // the default
+ /** @configRef | Marshalling serialization version */
protected String version = Version.getMajorVersion();
public SerializationType() {
@@ -564,17 +570,21 @@
/**
*
- * @configRef globalJmxStatistics
+ * @configRef globalJmxStatistics|Determines global JMX settings for all cache instances
*/
@XmlAccessorType(XmlAccessType.PROPERTY)
private static class GlobalJmxStatisticsType extends AbstractConfigurationBeanWithGCR {
+ /** @configRef |Toggle to enable/disable exposing Infinispan objects to JMX */
protected Boolean enabled = false;
+ /** @configRef |JMX domain name where all relevant JMX exposed objects will be bound */
protected String jmxDomain = "infinispan";
+ /** @configRef |Fully qualified name of class that will attempt to find JMX MBean server */
protected String mBeanServerLookup = PlatformMBeanServerLookup.class.getName();
+ /** @configRef |todo */
protected Boolean allowDuplicateDomains = false;
@XmlAttribute
@@ -604,11 +614,13 @@
/**
*
- * @configRef shutdown
+ * @configRef shutdown|Determines shutdown hook settings.
+ * By default a shutdown hook is registered even if no MBean server (apart from the JDK default) is detected.
*/
@XmlAccessorType(XmlAccessType.PROPERTY)
private static class ShutdownType extends AbstractConfigurationBeanWithGCR {
+ /** @configRef |Behavior of the JVM shutdown hook registered by the cache */
protected ShutdownHookBehavior hookBehavior = ShutdownHookBehavior.DEFAULT;
@XmlAttribute
Modified: trunk/core/src/main/java/org/infinispan/loaders/AbstractCacheLoaderConfig.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/loaders/AbstractCacheLoaderConfig.java 2009-08-27 11:41:58 UTC (rev 744)
+++ trunk/core/src/main/java/org/infinispan/loaders/AbstractCacheLoaderConfig.java 2009-08-27 12:41:34 UTC (rev 745)
@@ -23,7 +23,10 @@
*/
@XmlAccessorType(XmlAccessType.FIELD)
public class AbstractCacheLoaderConfig extends PluggableConfigurationComponent implements CacheLoaderConfig {
-
+
+ /**
+ * @configRef class|Fully qualified name of a cacheloader class
+ * */
@XmlAttribute(name="class")
protected String cacheLoaderClassName;
Modified: trunk/tools/src/main/java/org/infinispan/tools/doclet/config/ConfigHtmlGenerator.java
===================================================================
--- trunk/tools/src/main/java/org/infinispan/tools/doclet/config/ConfigHtmlGenerator.java 2009-08-27 11:41:58 UTC (rev 744)
+++ trunk/tools/src/main/java/org/infinispan/tools/doclet/config/ConfigHtmlGenerator.java 2009-08-27 12:41:34 UTC (rev 745)
@@ -89,16 +89,17 @@
associateBeansWithTreeNodes(configBeans, root);
- sb.append("<div class=\"" + "source" + "\"><pre>");
- // print xml tree into StringBuilder
- tw.preOrderTraverse(root);
- sb.append("</pre></div>");
-
TreeNode node = tw.findNode(root, "namedCache", "infinispan");
node.detach();
PruneTreeWalker ptw = new PruneTreeWalker("property");
ptw.postOrderTraverse(root);
+
+ sb.append("<div class=\"" + "source" + "\"><pre>");
+ // print xml tree into StringBuilder
+ tw.preOrderTraverse(root);
+ sb.append("</pre></div>");
+
for (TreeNode n : root) {
if (n.getName().equals("properties"))
@@ -133,16 +134,25 @@
List<Tag> list = Arrays.asList(classDoc.tags(CONFIG_REF));
for (Tag tag : list) {
String text = tag.text().trim();
+
+ //strip of documentation part
+ if(text.contains("|")){
+ text = text.substring(0, text.indexOf("|"));
+ text.trim();
+ }
+ //special parent/child anchor
if(text.contains(":")){
String strings []= text.split(":");
String parent = strings[1].trim();
String thisNode = strings[0].trim();
- if(thisNode.startsWith(n.getName()) && parent.startsWith(n.getParent().getName())){
+ if(n.getName().equalsIgnoreCase(thisNode) && n.getParent().getName().equalsIgnoreCase(parent)){
n.setBeanClass(clazz);
+ //System.out.println("Associated " + n.getName() + " with " + clazz);
}
}
- if (text.startsWith(n.getName()) && n.getBeanClass() == null) {
+ else if (n.getName().equalsIgnoreCase(text) && n.getBeanClass() == null) {
n.setBeanClass(clazz);
+ //System.out.println("Associated " + n.getName() + " with " + clazz);
}
}
}
@@ -158,14 +168,17 @@
sb.append("<tr class=\"a\"><th>Property</th><th>Description</th></tr>\n");
Tag[] tags = fieldDoc.tags(CONFIG_PROPERTY_REF);
for (Tag t : tags) {
- String[] strings = t.text().trim().split(" ");
+ String text = t.text().trim();
sb.append("<tr class=\"b\">");
- sb.append("<td>").append(strings[0]).append("</td>\n");
- if (strings.length > 1)
- sb.append("<td>").append(strings[1]).append("</td>\n");
- else
+ if(text.contains("|")){
+ String name = text.substring(0,text.indexOf("|"));
+ String doc = text.substring(text.indexOf("|")+1);
+ sb.append("<td>").append(name).append("</td>\n");
+ sb.append("<td>").append(doc).append("</td>\n");
+ } else {
+ sb.append("<td>").append(text).append("</td>\n");
sb.append("<td>").append("todo").append("</td>\n");
-
+ }
sb.append("</tr>\n");
}
sb.append("</table></div>");
@@ -188,6 +201,7 @@
}
}
} catch (Exception e) {
+ System.out.println("Did noc construct object " + bean);
}
Set<XSAttributeDecl> attributes = n.getAttributes();
@@ -206,20 +220,19 @@
// otherwise reflect that field and read default value
else {
- boolean valueSet = false;
+ Field field = null;
+ Object value = null;
try {
- Field field = findFieldRecursively(bean, a.getName());
- Object value = fieldValue(field, object);
+ field = findFieldRecursively(bean, a.getName());
+ value = fieldValue(field, object);
if (value != null) {
- valueSet = true;
sb.append("<td>").append(value.toString()).append("</td>\n");
+ } else {
+ sb.append("<td>").append("null").append("</td>\n");
}
- } catch (Exception e) {
- } finally {
- if (!valueSet) {
- sb.append("<td>").append("N/A").append("</td>\n");
- }
- }
+ } catch (Exception e) {
+ sb.append("<td>").append("N/A").append("</td>\n");
+ }
}
boolean docSet = false;
@@ -252,7 +265,7 @@
sb.append("\n<p>");
Class<?> beanClass = n.getBeanClass();
//System.out.println("Generating " + n + " bean is " + beanClass);
- ClassDoc classDoc = rootDoc.classNamed(n.getBeanClass().getName());
+ ClassDoc classDoc = rootDoc.classNamed(beanClass.getName());
Tag[] tags = classDoc.tags(CONFIG_REF);
for (Tag tag : tags) {
String text = tag.text().trim();
@@ -297,7 +310,7 @@
ClassDoc classDoc = rootDoc.classNamed(c.getName());
for (FieldDoc fd : classDoc.fields()) {
for (Tag t : fd.tags(CONFIG_REF)) {
- if (t.text().equals(fieldName)) {
+ if (t.text().startsWith(fieldName)) {
return findFieldRecursively(c, fd.name());
}
}
More information about the infinispan-commits
mailing list