exo-jcr SVN: r1948 - jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-02-24 05:56:15 -0500 (Wed, 24 Feb 2010)
New Revision: 1948
Modified:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/configuration.xml
Log:
EXOJCR-543: It was not possible anymore to create a variable thanks to another variables.
UnitTests have been added and bug has been fixed
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/configuration.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/configuration.xml 2010-02-23 22:56:03 UTC (rev 1947)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/configuration.xml 2010-02-24 10:56:15 UTC (rev 1948)
@@ -737,6 +737,13 @@
</init-params>
</component>
</configuration></programlisting></para>
+
+ <para>In the properties file corresponding to the external settings,
+ you can reuse variables previously defined to create a new variable.
+ In this case the prefix "<emphasis>portal.container.</emphasis>" is
+ not needed, see an example below:<programlisting>my-var1=value 1
+my-var2=value 2
+complex-value=${my-var1}-${my-var2}</programlisting> </para>
</section>
</section>
</section>
@@ -790,6 +797,13 @@
</value-param>
</init-params>
</component></programlisting>
+
+ <para>In the properties file corresponding to the external properties,
+ you can reuse variables previously defined to create a new variable. In
+ this case the prefix "<emphasis>portal.container.</emphasis>" is not
+ needed, see an example below:<programlisting>my-var1=value 1
+my-var2=value 2
+complex-value=${my-var1}-${my-var2}</programlisting></para>
</section>
<section>
@@ -972,4 +986,103 @@
</section>
</section>
</section>
+
+ <section>
+ <title>Component request life cycle</title>
+
+ <section>
+ <title>Component request life cycle contract</title>
+
+ <para>The component request life cycle is an interface that defines a
+ contract for a component for being involved into a
+ request:<programlisting>public interface ComponentRequestLifecycle
+{
+ /**
+ * Start a request.
+ * @param container the related container
+ */
+ void startRequest(ExoContainer container);
+
+ /**
+ * Ends a request.
+ * @param container the related container
+ */
+ void endRequest(ExoContainer container);
+}</programlisting></para>
+
+ <para>The container passed is the container to which the component is
+ related. This contract is often used to setup a thread local based
+ context that will be demarcated by a request.</para>
+
+ <para>For instance in the GateIn portal context, a component request
+ life cycle is triggered for user requests. Another example is the
+ initial data import in GateIn that demarcates using callbacks made to
+ that interface.</para>
+ </section>
+
+ <section>
+ <title>Request life cycle</title>
+
+ <para>The <envar>RequestLifeCycle</envar> class has several statics
+ methods that are used to schedule the component request life cycle of
+ components. Its main responsability is to perform scheduling while
+ respecting the constraint to execute the request life cycle of a
+ component only once even if it can be scheduled several times.</para>
+
+ <section>
+ <title>Scheduling a component request life cycle</title>
+
+ <programlisting>RequestLifeCycle.begin(component);
+try
+{
+ // Do something
+}
+finally
+{
+ RequestLifeCycle.end();
+}</programlisting>
+ </section>
+
+ <section>
+ <title>Scheduling a container request life cycle</title>
+
+ <para>Scheduling a container triggers the component request life cyle
+ of all the components that implement the interface
+ <envar>ComponentRequestLifeCycle</envar>. If one of the component has
+ already been scheduled before then that component will not be
+ scheduled again. When the local value is true then the looked
+ components will be those of the container, when it is false then the
+ scheduler will also look at the components in the ancestor
+ containers.<programlisting>RequestLifeCycle.begin(container, local);
+try
+{
+ // Do something
+}
+finally
+{
+ RequestLifeCycle.end();
+}</programlisting></para>
+ </section>
+ </section>
+
+ <section>
+ <title>When request life cycle is triggered</title>
+
+ <section>
+ <title>Portal request life cycle</title>
+
+ <para>Each portal request triggers the life cycle of the associated
+ portal container.</para>
+ </section>
+
+ <section>
+ <title>JMX request Life Cycle</title>
+
+ <para>When a JMX bean is invoked, the request life cycle of the
+ container to which it belongs it scheduled. Indeed JMX is an entry
+ point of the system that may need component to have a request life
+ cycle triggered.</para>
+ </section>
+ </section>
+ </section>
</chapter>
14 years, 2 months
exo-jcr SVN: r1947 - in jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav: command and 1 other directories.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2010-02-23 17:56:03 -0500 (Tue, 23 Feb 2010)
New Revision: 1947
Modified:
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavServiceImpl.java
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/GetCommand.java
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/CollectionResource.java
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/FileResource.java
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/VersionedCollectionResource.java
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/VersionedFileResource.java
Log:
EXOJCR-533 cleanup
Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavServiceImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavServiceImpl.java 2010-02-23 16:23:17 UTC (rev 1946)
+++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavServiceImpl.java 2010-02-23 22:56:03 UTC (rev 1947)
@@ -490,10 +490,6 @@
@HeaderParam(ExtHttpHeaders.IF_MODIFIED_SINCE) String ifModifiedSince, @QueryParam("version") String version,
@Context UriInfo uriInfo)
{
- // TODO EXOJCR-533
- // long startGet = System.currentTimeMillis();
- // try {
-
if (log.isDebugEnabled())
{
log.debug("GET " + repoName + "/" + repoPath);
@@ -562,11 +558,6 @@
log.error(exc.getMessage(), exc);
return Response.serverError().entity(exc.getMessage()).build();
}
-
- // TODO EXOJCR-533
- // } finally {
- // System.out.println(System.currentTimeMillis() + ":Get:" + repoPath + ":" + (System.currentTimeMillis() - startGet));
- // }
}
/**
Property changes on: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/GetCommand.java
===================================================================
--- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/GetCommand.java 2010-02-23 16:23:17 UTC (rev 1946)
+++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/GetCommand.java 2010-02-23 22:56:03 UTC (rev 1947)
@@ -84,10 +84,6 @@
public Response get(Session session, String path, String version, String baseURI, List<Range> ranges,
String ifModifiedSince, HashMap<MediaType, String> cahceControls)
{
- // TODO EXOJCR-533
- // long startGet = System.currentTimeMillis();
- // try {
-
if (version == null)
{
if (path.indexOf("?version=") > 0)
@@ -122,11 +118,7 @@
istream = ((FileResource)resource).getContentAsStream();
}
- // TODO EXOJCR-533 why we need fileResource if we have resource?
- // FileResource fileResource = new FileResource(uri, node, nsContext);
- // HierarchicalProperty lastModifiedProperty = fileResource.getProperty(FileResource.GETLASTMODIFIED);
HierarchicalProperty lastModifiedProperty = resource.getProperty(FileResource.GETLASTMODIFIED);
-
// check before any other reads
if ((ifModifiedSince != null) && (ifModifiedSince.equals(lastModifiedProperty.getValue())))
{
@@ -216,11 +208,6 @@
log.error(exc.getMessage(), exc);
return Response.serverError().entity(exc.getMessage()).build();
}
-
- // TODO EXOJCR-533
- // } finally {
- // System.out.println(System.currentTimeMillis() + ":GetCommand:" + path + ":" + (System.currentTimeMillis() - startGet));
- // }
}
/**
Property changes on: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/GetCommand.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/CollectionResource.java
===================================================================
--- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/CollectionResource.java 2010-02-23 16:23:17 UTC (rev 1946)
+++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/CollectionResource.java 2010-02-23 22:56:03 UTC (rev 1947)
@@ -153,9 +153,6 @@
final WebDavNamespaceContext namespaceContext) throws IllegalResourceTypeException, RepositoryException
{
super(type, identifier, new WebDavNamespaceContext(node.getSession()));
- // TODO EXOJCR-533
- //if (ResourceUtil.isFile(node))
- // throw new IllegalResourceTypeException("Node type is not applicable for COLLECTION resource " + node.getPath());
this.node = node;
}
Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/FileResource.java
===================================================================
--- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/FileResource.java 2010-02-23 16:23:17 UTC (rev 1946)
+++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/FileResource.java 2010-02-23 22:56:03 UTC (rev 1947)
@@ -122,9 +122,6 @@
throws IllegalResourceTypeException, RepositoryException
{
super(type, identifier, namespaceContext);
- // TODO EXOJCR-533
- //if (!ResourceUtil.isFile(node))
- // throw new IllegalResourceTypeException("Node type is not applicable for FILE resource " + node.getPath());
this.node = node;
}
Property changes on: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/FileResource.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/VersionedCollectionResource.java
===================================================================
--- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/VersionedCollectionResource.java 2010-02-23 16:23:17 UTC (rev 1946)
+++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/VersionedCollectionResource.java 2010-02-23 22:56:03 UTC (rev 1947)
@@ -51,10 +51,6 @@
throws IllegalResourceTypeException, RepositoryException
{
super(VERSIONED_COLLECTION, identifier, node, namespaceContext);
- // TODO EXOJCR-533
- // if (!node.isNodeType("mix:versionable"))
- // throw new IllegalResourceTypeException("Node type is not applicable for Versioned FILE resource "
- // + node.getPath());
}
/**
Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/VersionedFileResource.java
===================================================================
--- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/VersionedFileResource.java 2010-02-23 16:23:17 UTC (rev 1946)
+++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/VersionedFileResource.java 2010-02-23 22:56:03 UTC (rev 1947)
@@ -60,10 +60,6 @@
throws IllegalResourceTypeException, RepositoryException
{
super(VERSIONED_FILE, identifier, node, namespaceContext);
- // TODO EXOJCR-533
- // if (!node.isNodeType("mix:versionable"))
- // throw new IllegalResourceTypeException("Node type is not applicable for Versioned FILE resource "
- // + node.getPath());
}
/**
14 years, 2 months
exo-jcr SVN: r1946 - in jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load: query and 1 other directories.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2010-02-23 11:23:17 -0500 (Tue, 23 Feb 2010)
New Revision: 1946
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/AbstractAvgResponseTimeTest.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/AbstractTestAgent.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/query/JcrQueryAvgResponseTimeTest.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/AbstractWebDavTestAgent.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/WebDavAvgResponseTimeTest.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/WebDavTestAgent.java
Log:
EXOJCR-510 : Fixed write 10, and growing read
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/AbstractAvgResponseTimeTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/AbstractAvgResponseTimeTest.java 2010-02-23 14:47:23 UTC (rev 1945)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/AbstractAvgResponseTimeTest.java 2010-02-23 16:23:17 UTC (rev 1946)
@@ -43,6 +43,11 @@
private final int readValue;
/**
+ * Fixed number of write agent
+ */
+ private final int WRITE_AGENT_COUNT = 10;
+
+ /**
* 10%
*/
private final int WARM_UP_RATIO = 10;
@@ -76,17 +81,26 @@
final List<NodeInfo> nodesPath = new LinkedList<NodeInfo>();
- ExecutorService threadPool = Executors.newFixedThreadPool(threadCount);
+ ExecutorService threadPool = Executors.newFixedThreadPool(threadCount + WRITE_AGENT_COUNT);
CountDownLatch startSignal = new CountDownLatch(1);
- AbstractTestAgent[] testAgents = new AbstractTestAgent[threadCount];
+ AbstractTestAgent[] testAgents = new AbstractTestAgent[threadCount + WRITE_AGENT_COUNT];
ResultCollector resultCollector = new ResultCollector();
//pool initialization
- for (int i = 0; i < threadCount; i++)
+ //init write
+ for (int i = 0; i < WRITE_AGENT_COUNT; i++)
{
- testAgents[i] = getAgent(nodesPath, resultCollector, startSignal, readValue, random);
+ testAgents[i] = getAgent(nodesPath, resultCollector, startSignal, readValue, random, false);
//init agent
testAgents[i].prepare();
threadPool.execute(testAgents[i]);
+ }
+ //init read
+ for (int i = WRITE_AGENT_COUNT; i < threadCount + WRITE_AGENT_COUNT; i++)
+ {
+ testAgents[i] = getAgent(nodesPath, resultCollector, startSignal, readValue, random, true);
+ //init agent
+ testAgents[i].prepare();
+ threadPool.execute(testAgents[i]);
}
resultCollector.startIteration();
@@ -97,26 +111,30 @@
//reset result after warm up
resultCollector.reset();
Thread.sleep(iterationTime - warmUpTime);
+ long totalRead = resultCollector.getTotalReadTime();
+ long totalWrite = resultCollector.getTotalWriteTime();
+ long readAndWrite = totalRead + totalWrite;
+ long ratio = (totalRead * 100) / readAndWrite;
+ System.out.println("Ratio =" + ratio);
+ // while (true)
+ // {
+ // long totalRead = resultCollector.getTotalReadTime();
+ // long totalWrite = resultCollector.getTotalWriteTime();
+ // long readAndWrite = totalRead + totalWrite;
+ // long ratio = (totalRead * 100) / readAndWrite;
+ // System.out.println("Ratio =" + ratio);
+ // if (ratio >= readValue)
+ // {
+ // break;
+ // }
+ // //only read allowed
+ // for (int i = 0; i < testAgents.length; i++)
+ // {
+ // testAgents[i].setBlockWrite(true);
+ // }
+ // Thread.sleep(1000);
+ // }
- while (true)
- {
- long totalRead = resultCollector.getTotalReadTime();
- long totalWrite = resultCollector.getTotalWriteTime();
- long readAndWrite = totalRead + totalWrite;
- long ratio = (totalRead * 100) / readAndWrite;
- System.out.println("Ratio =" + ratio);
- if (ratio >= readValue)
- {
- break;
- }
- //only read allowed
- for (int i = 0; i < testAgents.length; i++)
- {
- testAgents[i].setBlockWrite(true);
- }
- Thread.sleep(1000);
- }
-
threadPool.shutdown();
for (int i = 0; i < testAgents.length; i++)
{
@@ -166,6 +184,6 @@
* @return
*/
protected abstract AbstractTestAgent getAgent(List<NodeInfo> nodesPath, ResultCollector resultCollector,
- CountDownLatch startSignal, int readValue, Random random);
+ CountDownLatch startSignal, int readValue, Random random, boolean isReadThread);
}
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/AbstractTestAgent.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/AbstractTestAgent.java 2010-02-23 14:47:23 UTC (rev 1945)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/AbstractTestAgent.java 2010-02-23 16:23:17 UTC (rev 1946)
@@ -46,17 +46,20 @@
private boolean blockWrite;
+ private final boolean isReadThread;
+
/**
*
*/
public AbstractTestAgent(List<NodeInfo> nodesPath, ResultCollector resultCollector, CountDownLatch startSignal,
- int readValue, Random random)
+ int readValue, Random random, boolean isReadThread)
{
this.nodesPath = nodesPath;
this.resultCollector = resultCollector;
this.random = random;
this.startSignal = startSignal;
this.readValue = readValue;
+ this.isReadThread = isReadThread;
}
/**
@@ -82,31 +85,47 @@
while (!shouldStop)
{
- long totalRead = resultCollector.getTotalReadTime();
- long totalWrite = resultCollector.getTotalWriteTime();
- long readAndWrite = totalRead + totalWrite;
- if (blockWrite)
+ if (isReadThread)
{
- doRead(nodesPath, resultCollector);
- }
- else
- {
- long ratio = 0;
- if (readAndWrite > 0)
+ if (nodesPath.size() > 1)
{
- ratio = (totalRead * 100) / readAndWrite;
+ doRead(nodesPath, resultCollector);
}
- //prevent to match write
- if (nodesPath.size() < 2 || (System.currentTimeMillis() - LAST_WRITE_START > 500 && (ratio > readValue)))
- {
- LAST_WRITE_START = System.currentTimeMillis();
- doWrite(nodesPath, resultCollector);
- }
else
{
- doRead(nodesPath, resultCollector);
+ Thread.sleep(100);
}
}
+ else if (!blockWrite)
+ {
+ doWrite(nodesPath, resultCollector);
+ }
+ //
+ // long totalRead = resultCollector.getTotalReadTime();
+ // long totalWrite = resultCollector.getTotalWriteTime();
+ // long readAndWrite = totalRead + totalWrite;
+ // if (blockWrite)
+ // {
+ // doRead(nodesPath, resultCollector);
+ // }
+ // else
+ // {
+ // long ratio = 0;
+ // if (readAndWrite > 0)
+ // {
+ // ratio = (totalRead * 100) / readAndWrite;
+ // }
+ // //prevent to match write
+ // if (System.currentTimeMillis() - LAST_WRITE_START > 500 && (nodesPath.size() < 1 || ratio > readValue))
+ // {
+ // LAST_WRITE_START = System.currentTimeMillis();
+ // doWrite(nodesPath, resultCollector);
+ // }
+ // else
+ // {
+ // doRead(nodesPath, resultCollector);
+ // }
+ // }
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/query/JcrQueryAvgResponseTimeTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/query/JcrQueryAvgResponseTimeTest.java 2010-02-23 14:47:23 UTC (rev 1945)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/query/JcrQueryAvgResponseTimeTest.java 2010-02-23 16:23:17 UTC (rev 1946)
@@ -115,9 +115,9 @@
*/
@Override
protected AbstractTestAgent getAgent(List<NodeInfo> nodesPath, ResultCollector resultCollector,
- CountDownLatch startSignal, int readValue, Random random)
+ CountDownLatch startSignal, int readValue, Random random, boolean isReadThread)
{
- return new QueryTestAgent(repository, nodesPath, resultCollector, startSignal, readValue, random);
+ return new QueryTestAgent(repository, nodesPath, resultCollector, startSignal, readValue, random, isReadThread);
}
}
@@ -137,9 +137,9 @@
* @param random
*/
public QueryTestAgent(RepositoryImpl repository, List<NodeInfo> nodesPath, ResultCollector resultCollector,
- CountDownLatch startSignal, int readValue, Random random)
+ CountDownLatch startSignal, int readValue, Random random, boolean isReadThread)
{
- super(nodesPath, resultCollector, startSignal, readValue, random);
+ super(nodesPath, resultCollector, startSignal, readValue, random, true);
this.threadUUID = UUID.randomUUID();
this.repository = repository;
initRoot();
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/AbstractWebDavTestAgent.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/AbstractWebDavTestAgent.java 2010-02-23 14:47:23 UTC (rev 1945)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/AbstractWebDavTestAgent.java 2010-02-23 16:23:17 UTC (rev 1946)
@@ -52,9 +52,9 @@
* @param random
*/
public AbstractWebDavTestAgent(List<NodeInfo> nodesPath, ResultCollector resultCollector,
- CountDownLatch startSignal, int READ_VALUE, Random random)
+ CountDownLatch startSignal, int READ_VALUE, Random random, boolean isReadThread)
{
- super(nodesPath, resultCollector, startSignal, READ_VALUE, random);
+ super(nodesPath, resultCollector, startSignal, READ_VALUE, random, isReadThread);
}
protected JCRWebdavConnection getNewConnection()
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/WebDavAvgResponseTimeTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/WebDavAvgResponseTimeTest.java 2010-02-23 14:47:23 UTC (rev 1945)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/WebDavAvgResponseTimeTest.java 2010-02-23 16:23:17 UTC (rev 1946)
@@ -46,7 +46,7 @@
/**
* How much thread will be added on the next iteration.
*/
- private static final int ITERATION_GROWING_POLL = 25;
+ private static final int ITERATION_GROWING_POLL = 50;
/**
* Number between 0 and 100 show % how many read operations.
@@ -65,8 +65,6 @@
{
private String iterationRoot;
- private int counter;
-
/**
* @param iterationGrowingPoll
* @param iterationTime
@@ -86,7 +84,7 @@
{
// TODO Auto-generated method stub
super.setUp();
- WebDavTestAgent setUpAgent = new WebDavTestAgent(null, null, null, null, 0, null);
+ WebDavTestAgent setUpAgent = new WebDavTestAgent(null, null, null, null, 0, null, false);
String testRoot = setUpAgent.createDirIfAbsent("", TEST_ROOT, new ResultCollector());
iterationRoot = setUpAgent.createDirIfAbsent(testRoot, UUID.randomUUID().toString(), new ResultCollector());
@@ -107,9 +105,10 @@
*/
@Override
protected AbstractTestAgent getAgent(List<NodeInfo> nodesPath, ResultCollector resultCollector,
- CountDownLatch startSignal, int readValue, Random random)
+ CountDownLatch startSignal, int readValue, Random random, boolean isReadThread)
{
- return new WebDavTestAgent(iterationRoot, nodesPath, resultCollector, startSignal, readValue, random);
+ return new WebDavTestAgent(iterationRoot, nodesPath, resultCollector, startSignal, readValue, random,
+ isReadThread);
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/WebDavTestAgent.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/WebDavTestAgent.java 2010-02-23 14:47:23 UTC (rev 1945)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/WebDavTestAgent.java 2010-02-23 16:23:17 UTC (rev 1946)
@@ -49,9 +49,9 @@
* @param random
*/
public WebDavTestAgent(String testRoot, List<NodeInfo> nodesPath, ResultCollector resultCollector,
- CountDownLatch startSignal, int READ_VALUE, Random random)
+ CountDownLatch startSignal, int READ_VALUE, Random random, boolean isReadThread)
{
- super(nodesPath, resultCollector, startSignal, READ_VALUE, random);
+ super(nodesPath, resultCollector, startSignal, READ_VALUE, random, isReadThread);
this.testRoot = testRoot;
}
14 years, 2 months
exo-jcr SVN: r1945 - jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2010-02-23 09:47:23 -0500 (Tue, 23 Feb 2010)
New Revision: 1945
Modified:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/configuration.xml
Log:
EXOJCR-541 documentation updated
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/configuration.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/configuration.xml 2010-02-23 13:50:44 UTC (rev 1944)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/configuration.xml 2010-02-23 14:47:23 UTC (rev 1945)
@@ -133,11 +133,14 @@
<para>if configuration URL not initialized at all, it will be
found at <emphasis>$AS_HOME/exo-configuration.xml</emphasis>.
If <emphasis>$AS_HOME/exo-configuration.xml</emphasis> doesn't
- exist and the <envar>StandaloneContainer</envar> instance
- obtained with the dedicated configuration
- <envar>ClassLoader</envar> the container will try to retrieve
- the resource <emphasis>conf/exo-configuration.xml</emphasis>
- within the given <envar>ClassLoader</envar>.</para>
+ exist the container will try find it at
+ <emphasis>$AS_HOME/exo-conf/exo-configuration.xml</emphasis>
+ location and if it's still not found and the
+ <envar>StandaloneContainer</envar> instance obtained with the
+ dedicated configuration <envar>ClassLoader</envar> the
+ container will try to retrieve the resource
+ <emphasis>conf/exo-configuration.xml</emphasis> within the
+ given <envar>ClassLoader</envar>.</para>
</listitem>
</itemizedlist>
</listitem>
14 years, 2 months
exo-jcr SVN: r1944 - kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2010-02-23 08:50:44 -0500 (Tue, 23 Feb 2010)
New Revision: 1944
Modified:
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/StandaloneContainer.java
Log:
EXOJCR-541 exo-conf used in StandaloneContainer
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/StandaloneContainer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/StandaloneContainer.java 2010-02-23 10:42:51 UTC (rev 1943)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/StandaloneContainer.java 2010-02-23 13:50:44 UTC (rev 1944)
@@ -313,11 +313,18 @@
// or
if (configurationURL == null)
{
-
+ J2EEServerInfo env = new J2EEServerInfo();
+
// (2) exo-configuration.xml in AS (standalone) home directory
- configurationURL = new URL("file:" + (new J2EEServerInfo()).getServerHome() + "/exo-configuration.xml");
+ configurationURL = new URL("file:" + env.getServerHome() + "/exo-configuration.xml");
- // (3) conf/exo-configuration.xml in war/ear(?)
+ // (3) AS_HOME/conf/exo-conf (JBossAS usecase)
+ if (!fileExists(configurationURL))
+ {
+ configurationURL = new URL("file:" + env.getExoConfigurationDirectory() + "/exo-configuration.xml");
+ }
+
+ // (4) conf/exo-configuration.xml in war/ear(?)
if (!fileExists(configurationURL) && configClassLoader != null)
{
configurationURL = configClassLoader.getResource("conf/exo-configuration.xml");
14 years, 2 months
exo-jcr SVN: r1943 - jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/command/web/fckeditor.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-02-23 05:42:51 -0500 (Tue, 23 Feb 2010)
New Revision: 1943
Modified:
jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/command/web/fckeditor/UploadFileCommand.java
Log:
EXOJCR-505: workaround don't pass file name
Modified: jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/command/web/fckeditor/UploadFileCommand.java
===================================================================
--- jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/command/web/fckeditor/UploadFileCommand.java 2010-02-23 10:30:26 UTC (rev 1942)
+++ jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/command/web/fckeditor/UploadFileCommand.java 2010-02-23 10:42:51 UTC (rev 1943)
@@ -30,6 +30,7 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import javax.jcr.Node;
@@ -110,10 +111,9 @@
fields.put(item.getFieldName(), item);
}
FileItem uplFile = (FileItem)fields.get("NewFile");
-
// On IE, the file name is specified as an absolute path.
- String fileName = org.apache.commons.io.FilenameUtils.getName(uplFile.getName());
+ String fileName = org.apache.commons.io.FilenameUtils.getName(uplFile.getName());
Node file =
JCRCommandHelper
@@ -125,7 +125,7 @@
int retVal = 0;
out.println("<script type=\"text/javascript\">");
- out.println("window.parent.frames['frmUpload'].OnUploadCompleted(" + retVal + ",'" + file.getName() + "');");
+ out.println("window.parent.frames['frmUpload'].OnUploadCompleted(" + retVal + ",'" + "');");
out.println("</script>");
out.flush();
out.close();
14 years, 2 months
exo-jcr SVN: r1942 - in jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules: kernel and 1 other directory.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-02-23 05:30:26 -0500 (Tue, 23 Feb 2010)
New Revision: 1942
Added:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/cache.xml
Modified:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel.xml
Log:
EXOJCR-538: Convert wiki doc about eXo Cache into Docbook
Added: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/cache.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/cache.xml (rev 0)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/cache.xml 2010-02-23 10:30:26 UTC (rev 1942)
@@ -0,0 +1,957 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<chapter>
+ <title>eXo Cache</title>
+
+ <section>
+ <title>Basic concepts</title>
+
+ <para>All applications on the top of eXo JCR that need a cache, can rely
+ on an <envar>org.exoplatform.services.cache.ExoCache</envar> instance that
+ is managed by the
+ <envar>org.exoplatform.services.cache.CacheService</envar>. The main
+ implementation of this service is
+ <envar>org.exoplatform.services.cache.impl.CacheServiceImpl</envar> which
+ depends on the
+ <envar>org.exoplatform.services.cache.ExoCacheConfig</envar> in order to
+ create new <envar>ExoCache</envar> instances. See below an example of
+ <envar>org.exoplatform.services.cache.CacheService</envar>
+ definition:<programlisting> <component>
+ <key>org.exoplatform.services.cache.CacheService</key>
+ <jmx-name>cache:type=CacheService</jmx-name>
+ <type>org.exoplatform.services.cache.impl.CacheServiceImpl</type>
+ <init-params>
+ <object-param>
+ <name>cache.config.default</name>
+ <description>The default cache configuration</description>
+ <object type="org.exoplatform.services.cache.ExoCacheConfig">
+ <field name="name"><string>default</string></field>
+ <field name="maxSize"><int>300</int></field>
+ <field name="liveTime"><long>600</long></field>
+ <field name="distributed"><boolean>false</boolean></field>
+ <field name="implementation"><string>org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache</string></field>
+ </object>
+ </object-param>
+ </init-params>
+ </component></programlisting></para>
+
+ <para><note>
+ <para>The <envar>ExoCacheConfig</envar> which name is
+ <envar>default</envar>, will be the default configuration of all the
+ <envar>ExoCache</envar> instances that don't have dedicated
+ configuration.</para>
+ </note>See below an example of how to define a new
+ <envar>ExoCacheConfig</envar> thanks to a
+ <emphasis>external-component-plugin</emphasis>:<programlisting> <external-component-plugins>
+ <target-component>org.exoplatform.services.cache.CacheService</target-component>
+ <component-plugin>
+ <name>addExoCacheConfig</name>
+ <set-method>addExoCacheConfig</set-method>
+ <type>org.exoplatform.services.cache.ExoCacheConfigPlugin</type>
+ <description>Configures the cache for query service</description>
+ <init-params>
+ <object-param>
+ <name>cache.config.wcm.composer</name>
+ <description>The default cache configuration</description>
+ <object type="org.exoplatform.services.cache.ExoCacheConfig">
+ <field name="name"><string>wcm.composer</string></field>
+ <field name="maxSize"><int>300</int></field>
+ <field name="liveTime"><long>600</long></field>
+ <field name="distributed"><boolean>false</boolean></field>
+ <field name="implementation"><string>org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache</string></field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins></programlisting></para>
+
+ <table>
+ <title>Descriptions of the fields of
+ <envar>ExoCacheConfig</envar></title>
+
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry>name</entry>
+
+ <entry>The name of the cache. This field is mandatory since it
+ will be used to retrieve the <envar>ExoCacheConfig</envar>
+ corresponding to a given cache name.</entry>
+ </row>
+
+ <row>
+ <entry>label</entry>
+
+ <entry>The label of the cache. This field is optional. It is
+ mainly used to indicate the purpose of the cache.</entry>
+ </row>
+
+ <row>
+ <entry>maxSize</entry>
+
+ <entry>The maximum numbers of elements in cache. This field is
+ mandatory.</entry>
+ </row>
+
+ <row>
+ <entry>liveTime</entry>
+
+ <entry>The amount of time (in seconds) an element is not written
+ or read before it is evicted. This field is mandatory.</entry>
+ </row>
+
+ <row>
+ <entry>implementation</entry>
+
+ <entry>The full qualified name of the cache implementation to use.
+ This field is optional. This field is only used for simple cache
+ implementation. The default and main implementation is
+ <envar>org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache</envar>,
+ this implementation only works with local caches with FIFO as
+ eviction policy. For more complex implementation see the next
+ sections.</entry>
+ </row>
+
+ <row>
+ <entry>distributed</entry>
+
+ <entry>Indicates if the cache is distributed. This field is
+ optional. This field is used for backward compatibility.</entry>
+ </row>
+
+ <row>
+ <entry>replicated</entry>
+
+ <entry>Indicates if the cache is replicated. This field is
+ optional. This field is deprecated.</entry>
+ </row>
+
+ <row>
+ <entry>logEnabled</entry>
+
+ <entry>Indicates if the log is enabled. This field is optional.
+ This field is used for backward compatibility.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para> </para>
+ </section>
+
+ <section>
+ <title>eXo Cache extension</title>
+
+ <para>In the previous versions of eXo kernel, it was quite complex to
+ implement your own ExoCache because it was not open enough. Since kernel
+ 2.0.8, it is possible to easily integrate your favorite cache provider in
+ eXo Products.</para>
+
+ <para>You just need to implement your own <envar>ExoCacheFactory</envar>
+ and register it in an eXo container, as described below:<programlisting>package org.exoplatform.services.cache;
+...
+public interface ExoCacheFactory {
+
+ /**
+ * Creates a new instance of {@link org.exoplatform.services.cache.ExoCache}
+ * @param config the cache to create
+ * @return the new instance of {@link org.exoplatform.services.cache.ExoCache}
+ * @exception ExoCacheInitException if an exception happens while initializing the cache
+ */
+ public ExoCache createCache(ExoCacheConfig config) throws ExoCacheInitException;
+}</programlisting></para>
+
+ <para>As you can see, there is only one method to implement which cans be
+ seen as a converter of an <envar>ExoCacheConfig</envar> to get an instance
+ of <envar>ExoCache</envar>. Once, you created your own implementation you
+ can simply register your factory by adding a file
+ <emphasis>conf/portal/configuration.xml</emphasis> with a content of the
+ following type:<programlisting><configuration>
+ <component>
+ <key>org.exoplatform.services.cache.ExoCacheFactory</key>
+ <type>org.exoplatform.tutorial.MyExoCacheFactoryImpl</type>
+ ...
+ </component>
+</configuration></programlisting></para>
+ </section>
+
+ <section>
+ <title>eXo Cache based on JBoss Cache</title>
+
+ <section>
+ <title>Configure the ExoCacheFactory</title>
+
+ <para>When you add, the eXo library in your classpath, the eXo service
+ container will use the default configuration provided in the library
+ itself but of course you can still redefined the configuration if you
+ wish as you can do with any components.</para>
+
+ <para>The default configuration of the factory is:<programlisting><configuration>
+ <component>
+ <key>org.exoplatform.services.cache.ExoCacheFactory</key>
+ <type>org.exoplatform.services.cache.impl.jboss.ExoCacheFactoryImpl</type>
+ <init-params>
+ <value-param>
+ <name>cache.config.template</name>
+ <value>jar:/conf/portal/cache-configuration-template.xml</value>
+ </value-param>
+ </init-params>
+ </component>
+</configuration></programlisting></para>
+
+ <para>As you can see the factory requires one single parameter which is
+ <emphasis>cache.config.template</emphasis>, this parameter allows you to
+ define the location of the default configuration template of your jboss
+ cache. In the default configuration, we ask the eXo container to get the
+ file shipped into the jar at
+ <emphasis>/conf/portal/cache-configuration-template.xml</emphasis>.</para>
+
+ <para>The default configuration template aims to be the skeleton from
+ which we will create any type of jboss cache instance, thus it must be
+ very generic.<note>
+ <para>The default configuration template provided with the jar aims
+ to work with any application servers, but if you intend to use JBoss
+ AS, you should redefine it in your custom configuration to fit
+ better with your AS.</para>
+ </note></para>
+ </section>
+
+ <section>
+ <title>Add specific configuration for a cache</title>
+
+ <para>If for a given reason, you need to use a specific configuration
+ for a cache, you can register one thanks to an "<emphasis>external
+ plugin</emphasis>", see an example below:<programlisting><configuration>
+ ...
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.cache.ExoCacheFactory</target-component>
+ <component-plugin>
+ <name>addConfig</name>
+ <set-method>addConfig</set-method>
+ <type>org.exoplatform.services.cache.impl.jboss.ExoCacheFactoryConfigPlugin</type>
+ <description>add Custom Configurations</description>
+ <init-params>
+ <value-param>
+ <name>myCustomCache</name>
+ <value>jar:/conf/portal/custom-cache-configuration.xml</value>
+ </value-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+ ...
+</configuration></programlisting></para>
+
+ <para>In the example above, I call the method
+ <emphasis>addConfig(ExoCacheFactoryConfigPlugin plugin)</emphasis> on
+ the current implementation of <envar>ExoCacheFactory</envar> which is
+ actually the jboss cache implementation.</para>
+
+ <para>In the <emphasis>init-params</emphasis> block, you can define a
+ set of <emphasis>value-param</emphasis> blocks and for each
+ <emphasis>value-param</emphasis>, we expect the name of cache that needs
+ a specific configuration as name and the location of your custom
+ configuration as <emphasis>value</emphasis>.</para>
+
+ <para>In this example, we indicates to the factory that we would like
+ that the cache <emphasis>myCustomCache</emphasis> use the configuration
+ available at
+ <emphasis>jar:/conf/portal/custom-cache-configuration.xml</emphasis>.</para>
+ </section>
+
+ <section>
+ <title>Add a cache creator</title>
+
+ <section>
+ <title>Understanding a cache creator</title>
+
+ <para>The factory for jboss cache, delegates the cache creation to
+ <envar>ExoCacheCreator</envar> that is defines as
+ below:<programlisting>package org.exoplatform.services.cache.impl.jboss;
+...
+public interface ExoCacheCreator {
+
+ /**
+ * Creates an eXo cache according to the given configuration {@link org.exoplatform.services.cache.ExoCacheConfig}
+ * @param config the configuration of the cache to apply
+ * @param cache the cache to initialize
+ * @exception ExoCacheInitException if an exception happens while initializing the cache
+ */
+ public ExoCache create(ExoCacheConfig config, Cache<Serializable, Object> cache) throws ExoCacheInitException;
+
+ /**
+ * Returns the type of {@link org.exoplatform.services.cache.ExoCacheConfig} expected by the creator
+ * @return the expected type
+ */
+ public Class<? extends ExoCacheConfig> getExpectedConfigType();
+
+ /**
+ * Returns the name of the implementation expected by the creator. This is mainly used to be backward compatible
+ * @return the expected by the creator
+ */
+ public String getExpectedImplementation();
+}</programlisting></para>
+
+ <para>The <envar>ExoCacheCreator</envar> allows you to define any kind
+ of jboss cache instance that you would like to have. It has been
+ designed to give you the ability to have your own type of
+ configuration and to always be backward compatible.</para>
+
+ <para>In an <envar>ExoCacheCreator</envar>, you need to implement 3
+ methods which are:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>create</emphasis> - this method is used to create
+ a new <envar>ExoCache</envar> from the
+ <envar>ExoCacheConfig</envar> and a jboss cache instance.</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>getExpectedConfigType</emphasis> - this method is
+ used to indicate the factory the subtype of
+ <envar>ExoCacheConfig</envar> supported by the creator.</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>getExpectedImplementation</emphasis> - this method
+ is used to indicate the factory the value of field implementation
+ of <envar>ExoCacheConfig</envar> that is supported by the creator.
+ This is used for backward compatibility, in other words you can
+ still configure your cache with a super class
+ <envar>ExoCacheConfig</envar>.</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>Register a cache creator</title>
+
+ <para>You can register any cache creator you want thanks to an
+ <emphasis>"external plugin"</emphasis>, see an example
+ below:<programlisting> <external-component-plugins>
+ <target-component>org.exoplatform.services.cache.ExoCacheFactory</target-component>
+ <component-plugin>
+ <name>addCreator</name>
+ <set-method>addCreator</set-method>
+ <type>org.exoplatform.services.cache.impl.jboss.ExoCacheCreatorPlugin</type>
+ <description>add Exo Cache Creator</description>
+ <init-params>
+ <object-param>
+ <name>LRU</name>
+ <description>The lru cache creator</description>
+ <object type="org.exoplatform.services.cache.impl.jboss.lru.LRUExoCacheCreator">
+ <field name="defaultTimeToLive"><long>1500</long></field>
+ <field name="defaultMaxAge"><long>2000</long></field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins></programlisting></para>
+
+ <para>In the example above, I call the method
+ <emphasis>addCreator(ExoCacheCreatorPlugin plugin)</emphasis> on the
+ current implementation of <envar>ExoCacheFactory</envar> which is
+ actually the jboss cache implementation.</para>
+
+ <para>In the <emphasis>init-params</emphasis> block, you can define a
+ set of <emphasis>object-param</emphasis> blocks and for each
+ <emphasis>object-param</emphasis>, we expect any object definition of
+ type <envar>ExoCacheCreator</envar>.</para>
+
+ <para>In this example, we register the action creator related to the
+ eviction policy <emphasis>LRU</emphasis>.</para>
+ </section>
+
+ <section>
+ <title>The cache creators available</title>
+
+ <para>By default, no cache creator are defined, so you need to define
+ them yourself by adding them in your configuration files.</para>
+
+ <section>
+ <title>LRU Cache Creator - Least Recently Used</title>
+
+ <programlisting>..
+<object-param>
+ <name>LRU</name>
+ <description>The lru cache creator</description>
+ <object type="org.exoplatform.services.cache.impl.jboss.lru.LRUExoCacheCreator">
+ <field name="defaultTimeToLive"><long>${my-value}</long></field>
+ <field name="defaultMaxAge"><long>${my-value}</long></field>
+ </object>
+</object-param>
+...</programlisting>
+
+ <table>
+ <title>Fields description</title>
+
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry>defaultTimeToLive</entry>
+
+ <entry>This is the default value of the field
+ <emphasis>timeToLive</emphasis> described in the section
+ dedicated to this cache type. This value is only use when we
+ defined a cache of this type with the super type
+ <envar>ExoCacheConfig</envar>.</entry>
+ </row>
+
+ <row>
+ <entry>defaultMaxAge</entry>
+
+ <entry>his is the default value of the field
+ <emphasis>maxAge</emphasis> described in the section
+ dedicated to this cache type. This value is only use when we
+ defined a cache of this type with the super type
+ <envar>ExoCacheConfig</envar>.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+
+ <section>
+ <title>FIFO Cache Creator - First In, First Out</title>
+
+ <programlisting>...
+<object-param>
+ <name>FIFO</name>
+ <description>The fifo cache creator</description>
+ <object type="org.exoplatform.services.cache.impl.jboss.fifo.FIFOExoCacheCreator"></object>
+</object-param>
+...</programlisting>
+ </section>
+
+ <section>
+ <title>MRU Cache Creator - Most Recently Used</title>
+
+ <programlisting>...
+<object-param>
+ <name>MRU</name>
+ <description>The mru cache creator</description>
+ <object type="org.exoplatform.services.cache.impl.jboss.mru.MRUExoCacheCreator"></object>
+</object-param>
+...</programlisting>
+ </section>
+
+ <section>
+ <title>LFU Cache Creator - Least Frequently Used</title>
+
+ <programlisting>...
+<object-param>
+ <name>LFU</name>
+ <description>The lfu cache creator</description>
+ <object type="org.exoplatform.services.cache.impl.jboss.lfu.LFUExoCacheCreator">
+ <field name="defaultMinNodes"><int>${my-value}</int></field>
+ </object>
+</object-param>
+...</programlisting>
+
+ <table>
+ <title>Fields description</title>
+
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry>defaultMinNodes</entry>
+
+ <entry>This is the default value of the field
+ <emphasis>minNodes</emphasis> described in the section
+ dedicated to this cache type. This value is only use when we
+ defined a cache of this type with the super type
+ <envar>ExoCacheConfig</envar>.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+ </section>
+ </section>
+
+ <section>
+ <title>Define a cache</title>
+
+ <section>
+ <title>How to define a cache?</title>
+
+ <para>You have 2 ways to define a cache which are: </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>At <envar>CacheService</envar> initialization</para>
+ </listitem>
+
+ <listitem>
+ <para>With an <emphasis>"external plugin"</emphasis></para>
+ </listitem>
+ </itemizedlist>
+
+ <section>
+ <title>At <envar>CacheService</envar> initialization</title>
+
+ <programlisting>...
+ <component>
+ <key>org.exoplatform.services.cache.CacheService</key>
+ <type>org.exoplatform.services.cache.impl.CacheServiceImpl</type>
+ <init-params>
+ ...
+ <object-param>
+ <name>fifocache</name>
+ <description>The default cache configuration</description>
+ <object type="org.exoplatform.services.cache.ExoCacheConfig">
+ <field name="name"><string>fifocache</string></field>
+ <field name="maxSize"><int>${my-value}</int></field>
+ <field name="liveTime"><long>${my-value}</long></field>
+ <field name="distributed"><boolean>false</boolean></field>
+ <field name="implementation"><string>org.exoplatform.services.cache.FIFOExoCache</string></field>
+ </object>
+ </object-param>
+ ...
+ </init-params>
+ </component>
+...</programlisting>
+
+ <para>In this example, we define a new cache called
+ <emphasis>fifocache</emphasis>.</para>
+ </section>
+
+ <section>
+ <title>With an <emphasis>"external plugin"</emphasis></title>
+
+ <programlisting>...
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.cache.CacheService</target-component>
+ <component-plugin>
+ <name>addExoCacheConfig</name>
+ <set-method>addExoCacheConfig</set-method>
+ <type>org.exoplatform.services.cache.ExoCacheConfigPlugin</type>
+ <description>add ExoCache configuration component plugin </description>
+ <init-params>
+ ...
+ <object-param>
+ <name>fifoCache</name>
+ <description>The fifo cache configuration</description>
+ <object type="org.exoplatform.services.cache.ExoCacheConfig">
+ <field name="name"><string>fifocache</string></field>
+ <field name="maxSize"><int>${my-value}</int></field>
+ <field name="liveTime"><long>${my-value}</long></field>
+ <field name="distributed"><boolean>false</boolean></field>
+ <field name="implementation"><string>org.exoplatform.services.cache.FIFOExoCache</string></field>
+ </object>
+ </object-param>
+...
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+...</programlisting>
+
+ <para>In this example, we define a new cache called
+ <emphasis>fifocache</emphasis> which is in fact the same cache as in
+ previous example but defined in a different manner.</para>
+ </section>
+ </section>
+
+ <section>
+ <title>How to define a distributed or a local cache?</title>
+
+ <para>Actually, if you use a custom configuration for your cache as
+ described in a previous section, we will use the cache mode define in
+ your configuration file.</para>
+
+ <para>In case, you decide to use the default configuration template,
+ we use the field <emphasis>distributed</emphasis> of your
+ <envar>ExoCacheConfig</envar> to decide. In other words, if the value
+ of this field is false (the default value), the cache will be a local
+ cache otherwise it will be the cache mode defined in your default
+ configuration template that should be distributed.</para>
+ </section>
+
+ <section>
+ <title>LRU Cache - Least Recently Used</title>
+
+ <itemizedlist>
+ <listitem>
+ <para>New configuration</para>
+
+ <para><programlisting>...
+ <object-param>
+ <name>lru</name>
+ <description>The lru cache configuration</description>
+ <object type="org.exoplatform.services.cache.impl.jboss.lru.LRUExoCacheConfig">
+ <field name="name"><string>lru</string></field>
+ <field name="maxNodes"><int>${my-value}</int></field>
+ <field name="minTimeToLive"><long>${my-value}</long></field>
+ <field name="maxAge"><long>${my-value}</long></field>
+ <field name="timeToLive"><long>${my-value}</long></field>
+ </object>
+ </object-param>
+...</programlisting><table>
+ <title>Fields description</title>
+
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry>maxNodes</entry>
+
+ <entry>This is the maximum number of nodes allowed in
+ this region. 0 denotes immediate expiry, -1 denotes no
+ limit.</entry>
+ </row>
+
+ <row>
+ <entry>minTimeToLive</entry>
+
+ <entry>The minimum amount of time (in milliseconds) a
+ node must be allowed to live after being accessed before
+ it is allowed to be considered for eviction. 0 denotes
+ that this feature is disabled, which is the default
+ value.</entry>
+ </row>
+
+ <row>
+ <entry>maxAge</entry>
+
+ <entry>Lifespan of a node (in milliseconds) regardless
+ of idle time before the node is swept away. 0 denotes
+ immediate expiry, -1 denotes no limit.</entry>
+ </row>
+
+ <row>
+ <entry>timeToLive</entry>
+
+ <entry>The amount of time a node is not written to or
+ read (in milliseconds) before the node is swept away. 0
+ denotes immediate expiry, -1 denotes no limit.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table></para>
+ </listitem>
+
+ <listitem>
+ <para>Old configuration</para>
+
+ <programlisting>...
+ <object-param>
+ <name>lru-with-old-config</name>
+ <description>The lru cache configuration</description>
+ <object type="org.exoplatform.services.cache.ExoCacheConfig">
+ <field name="name"><string>lru-with-old-config</string></field>
+ <field name="maxSize"><int>${my-value}</int></field>
+ <field name="liveTime"><long>${my-value}</long></field>
+ <field name="implementation"><string>LRU</string></field>
+ </object>
+ </object-param>
+...</programlisting>
+
+ <table>
+ <title>Fields description</title>
+
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry>maxSize</entry>
+
+ <entry>This is the maximum number of nodes allowed in this
+ region. 0 denotes immediate expiry, -1 denotes no
+ limit.</entry>
+ </row>
+
+ <row>
+ <entry>liveTime</entry>
+
+ <entry>The minimum amount of time (in seconds) a node must
+ be allowed to live after being accessed before it is
+ allowed to be considered for eviction. 0 denotes that this
+ feature is disabled, which is the default value.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para><note>
+ <para>For the fields <emphasis>maxAge</emphasis> and
+ <emphasis>timeToLive</emphasis> needed by JBoss cache, we will
+ use the default values provided by the creator.</para>
+ </note></para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>FIFO Cache - First In, First Out</title>
+
+ <itemizedlist>
+ <listitem>
+ <para>New configuration<programlisting>...
+ <object-param>
+ <name>fifo</name>
+ <description>The fifo cache configuration</description>
+ <object type="org.exoplatform.services.cache.impl.jboss.fifo.FIFOExoCacheConfig">
+ <field name="name"><string>fifo</string></field>
+ <field name="maxNodes"><int>${my-value}</int></field>
+ <field name="minTimeToLive"><long>${my-value}</long></field>
+ </object>
+ </object-param>
+...</programlisting></para>
+
+ <table>
+ <title>Fields description</title>
+
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry>maxNodes</entry>
+
+ <entry>This is the maximum number of nodes allowed in this
+ region. 0 denotes immediate expiry, -1 denotes no
+ limit.</entry>
+ </row>
+
+ <row>
+ <entry>minTimeToLive</entry>
+
+ <entry>The minimum amount of time (in milliseconds) a node
+ must be allowed to live after being accessed before it is
+ allowed to be considered for eviction. 0 denotes that this
+ feature is disabled, which is the default value.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </listitem>
+
+ <listitem>
+ <para>Old configuration<programlisting>...
+ <object-param>
+ <name>fifo-with-old-config</name>
+ <description>The fifo cache configuration</description>
+ <object type="org.exoplatform.services.cache.ExoCacheConfig">
+ <field name="name"><string>fifo-with-old-config</string></field>
+ <field name="maxSize"><int>${my-value}</int></field>
+ <field name="liveTime"><long>${my-value}</long></field>
+ <field name="implementation"><string>FIFO</string></field>
+ </object>
+ </object-param>
+...</programlisting></para>
+
+ <table>
+ <title>Fields description</title>
+
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry>maxSize</entry>
+
+ <entry>This is the maximum number of nodes allowed in this
+ region. 0 denotes immediate expiry, -1 denotes no
+ limit.</entry>
+ </row>
+
+ <row>
+ <entry>liveTime</entry>
+
+ <entry>The minimum amount of time (in seconds) a node must
+ be allowed to live after being accessed before it is
+ allowed to be considered for eviction. 0 denotes that this
+ feature is disabled, which is the default value.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>MRU Cache - Most Recently Used</title>
+
+ <itemizedlist>
+ <listitem>
+ <para>New configuration<programlisting>...
+ <object-param>
+ <name>mru</name>
+ <description>The mru cache configuration</description>
+ <object type="org.exoplatform.services.cache.impl.jboss.mru.MRUExoCacheConfig">
+ <field name="name"><string>mru</string></field>
+ <field name="maxNodes"><int>${my-value}</int></field>
+ <field name="minTimeToLive"><long>${my-value}</long></field>
+ </object>
+ </object-param>
+...</programlisting></para>
+
+ <table>
+ <title>Fields description</title>
+
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry>maxNodes</entry>
+
+ <entry>This is the maximum number of nodes allowed in this
+ region. 0 denotes immediate expiry, -1 denotes no
+ limit.</entry>
+ </row>
+
+ <row>
+ <entry>minTimeToLive</entry>
+
+ <entry>The minimum amount of time (in milliseconds) a node
+ must be allowed to live after being accessed before it is
+ allowed to be considered for eviction. 0 denotes that this
+ feature is disabled, which is the default value.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </listitem>
+
+ <listitem>
+ <para>Old configuration<programlisting>...
+ <object-param>
+ <name>mru-with-old-config</name>
+ <description>The mru cache configuration</description>
+ <object type="org.exoplatform.services.cache.ExoCacheConfig">
+ <field name="name"><string>mru-with-old-config</string></field>
+ <field name="maxSize"><int>${my-value}</int></field>
+ <field name="liveTime"><long>${my-value}</long></field>
+ <field name="implementation"><string>MRU</string></field>
+ </object>
+ </object-param>
+...</programlisting></para>
+
+ <table>
+ <title>Fields description</title>
+
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry>maxSize</entry>
+
+ <entry>This is the maximum number of nodes allowed in this
+ region. 0 denotes immediate expiry, -1 denotes no
+ limit.</entry>
+ </row>
+
+ <row>
+ <entry>liveTime</entry>
+
+ <entry>The minimum amount of time (in seconds) a node must
+ be allowed to live after being accessed before it is
+ allowed to be considered for eviction. 0 denotes that this
+ feature is disabled, which is the default value.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>LFU Cache - Least Frequently Used</title>
+
+ <itemizedlist>
+ <listitem>
+ <para>New configuration<programlisting>...
+ <object-param>
+ <name>lfu</name>
+ <description>The lfu cache configuration</description>
+ <object type="org.exoplatform.services.cache.impl.jboss.lfu.LFUExoCacheConfig">
+ <field name="name"><string>lfu</string></field>
+ <field name="maxNodes"><int>${my-value}</int></field>
+ <field name="minNodes"><int>${my-value}</int></field>
+ <field name="minTimeToLive"><long>${my-value}</long></field>
+ </object>
+ </object-param>
+...</programlisting></para>
+
+ <table>
+ <title>Fields description</title>
+
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry>maxNodes</entry>
+
+ <entry>This is the maximum number of nodes allowed in this
+ region. 0 denotes immediate expiry, -1 denotes no
+ limit.</entry>
+ </row>
+
+ <row>
+ <entry>minNodes</entry>
+
+ <entry>This is the minimum number of nodes allowed in this
+ region. This value determines what the eviction queue
+ should prune down to per pass. e.g. If minNodes is 10 and
+ the cache grows to 100 nodes, the cache is pruned down to
+ the 10 most frequently used nodes when the eviction timer
+ makes a pass through the eviction algorithm.</entry>
+ </row>
+
+ <row>
+ <entry>minTimeToLive</entry>
+
+ <entry>The minimum amount of time (in milliseconds) a node
+ must be allowed to live after being accessed before it is
+ allowed to be considered for eviction. 0 denotes that this
+ feature is disabled, which is the default value.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </listitem>
+
+ <listitem>
+ <para>Old configuration<programlisting>...
+ <object-param>
+ <name>lfu-with-old-config</name>
+ <description>The lfu cache configuration</description>
+ <object type="org.exoplatform.services.cache.ExoCacheConfig">
+ <field name="name"><string>lfu-with-old-config</string></field>
+ <field name="maxSize"><int>${my-value}</int></field>
+ <field name="liveTime"><long>${my-value}</long></field>
+ <field name="implementation"><string>LFU</string></field>
+ </object>
+ </object-param>
+...</programlisting></para>
+
+ <table>
+ <title>Fields description</title>
+
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry>maxSize</entry>
+
+ <entry>This is the maximum number of nodes allowed in this
+ region. 0 denotes immediate expiry, -1 denotes no
+ limit.</entry>
+ </row>
+
+ <row>
+ <entry>liveTime</entry>
+
+ <entry>The minimum amount of time (in milliseconds) a node
+ must be allowed to live after being accessed before it is
+ allowed to be considered for eviction. 0 denotes that this
+ feature is disabled, which is the default value.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para><note>
+ <para>For the fields <emphasis>minNodes</emphasis> and
+ <emphasis>timeToLive</emphasis> needed by JBoss cache, we will
+ use the default values provided by the creator.</para>
+ </note></para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
+ </section>
+</chapter>
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel.xml 2010-02-23 08:30:45 UTC (rev 1941)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel.xml 2010-02-23 10:30:26 UTC (rev 1942)
@@ -12,6 +12,9 @@
<xi:include href="kernel/configuration.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="kernel/cache.xml"
+ xmlns:xi="http://www.w3.org/2001/XInclude" />
+
<xi:include href="kernel/transaction-service.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
14 years, 2 months
exo-jcr SVN: r1941 - in jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load: query and 1 other directories.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2010-02-23 03:30:45 -0500 (Tue, 23 Feb 2010)
New Revision: 1941
Added:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/ResultCollector.java
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/AbstractAvgResponseTimeTest.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/AbstractTestAgent.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/query/JcrQueryAvgResponseTimeTest.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/AbstractWebDavTestAgent.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/WebDavAvgResponseTimeTest.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/WebDavTestAgent.java
Log:
EXOJCR-510 : Counting work time
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/AbstractAvgResponseTimeTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/AbstractAvgResponseTimeTest.java 2010-02-22 20:08:35 UTC (rev 1940)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/AbstractAvgResponseTimeTest.java 2010-02-23 08:30:45 UTC (rev 1941)
@@ -18,8 +18,6 @@
*/
package org.exoplatform.services.jcr.cluster.load;
-import java.text.DecimalFormat;
-import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
@@ -44,7 +42,10 @@
private final int readValue;
- private final DecimalFormat df = new DecimalFormat("#####.##");
+ /**
+ * 10%
+ */
+ private final int WARM_UP_RATIO = 10;
/**
* @param iterationGrowingPoll
@@ -62,7 +63,7 @@
public void testResponce() throws Exception
{
- final List<NodeInfo> nodesPath = new LinkedList<NodeInfo>();
+
//start from 1 thread
int threadCount = initialSize;
@@ -73,39 +74,70 @@
//test init
setUp();
- final List<WorkerResult> responceResults = new LinkedList<WorkerResult>();
+ final List<NodeInfo> nodesPath = new LinkedList<NodeInfo>();
ExecutorService threadPool = Executors.newFixedThreadPool(threadCount);
CountDownLatch startSignal = new CountDownLatch(1);
AbstractTestAgent[] testAgents = new AbstractTestAgent[threadCount];
-
+ ResultCollector resultCollector = new ResultCollector();
//pool initialization
for (int i = 0; i < threadCount; i++)
{
- testAgents[i] = getAgent(nodesPath, responceResults, startSignal, readValue, random);
+ testAgents[i] = getAgent(nodesPath, resultCollector, startSignal, readValue, random);
//init agent
testAgents[i].prepare();
threadPool.execute(testAgents[i]);
}
- responceResults.clear();
+ resultCollector.startIteration();
startSignal.countDown();//let all threads proceed
- Thread.sleep(iterationTime);
+ long warmUpTime = (iterationTime * WARM_UP_RATIO) / 100;
+ Thread.sleep(warmUpTime);
+ //reset result after warm up
+ resultCollector.reset();
+ Thread.sleep(iterationTime - warmUpTime);
+ while (true)
+ {
+ long totalRead = resultCollector.getTotalReadTime();
+ long totalWrite = resultCollector.getTotalWriteTime();
+ long readAndWrite = totalRead + totalWrite;
+ long ratio = (totalRead * 100) / readAndWrite;
+ System.out.println("Ratio =" + ratio);
+ if (ratio >= readValue)
+ {
+ break;
+ }
+ //only read allowed
+ for (int i = 0; i < testAgents.length; i++)
+ {
+ testAgents[i].setBlockWrite(true);
+ }
+ Thread.sleep(1000);
+ }
+
threadPool.shutdown();
for (int i = 0; i < testAgents.length; i++)
{
testAgents[i].setShouldStop(true);
}
+
//wait 10 minutes
threadPool.awaitTermination(60 * 10, TimeUnit.SECONDS);
- dumpResults(responceResults, threadCount, iterationTime);
+ resultCollector.finishIteration();
+ pritResult(threadCount, resultCollector);
threadCount += iterationGrowingPoll;
tearDown();
}
}
+ private void pritResult(int threadCount, ResultCollector resultCollector)
+ {
+ System.out.println("Threads " + threadCount + " Time read " + resultCollector.getTotalReadTime() + " Time write "
+ + resultCollector.getTotalWriteTime() + " " + resultCollector.getStatistic());
+ }
+
/**
* Made some actions before iteration run
* @throws Exception
@@ -133,199 +165,7 @@
* @param random
* @return
*/
- protected abstract AbstractTestAgent getAgent(List<NodeInfo> nodesPath, List<WorkerResult> responceResults,
+ protected abstract AbstractTestAgent getAgent(List<NodeInfo> nodesPath, ResultCollector resultCollector,
CountDownLatch startSignal, int readValue, Random random);
- private void dumpResults(List<WorkerResult> responceResults, int threadCount, int iterationTime)
- {
-
- List<Double> readResult = new ArrayList<Double>();
- List<Double> writeResult = new ArrayList<Double>();
-
- for (WorkerResult workerResult : responceResults)
- {
- if (workerResult == null)
- {
- continue;
- }
- if (workerResult.isRead())
- {
- // read++;
- // sum_read += workerResult.getResponceTime();
- readResult.add(new Double(workerResult.getResponceTime()));
- }
- else
- {
- writeResult.add(new Double(workerResult.getResponceTime()));
- }
- }
- ResultInfo readResultInfo = new ResultInfo(readResult);
- readResultInfo.calculate();
-
- ResultInfo writeResultInfo = new ResultInfo(writeResult);
- writeResultInfo.calculate();
-
- StringBuffer result = new StringBuffer();
- result.append("ThreadCount= ").append(threadCount);
- result.append(" TPS = ").append(
- Math.round(((readResultInfo.getResultCount() + writeResultInfo.getResultCount()) * 1000) / iterationTime));
- result.append(" Total read= ").append(df.format(readResultInfo.getResultCount()));
- result.append(" Max= ").append(df.format(readResultInfo.getMaxValue()));
- result.append(" Min= ").append(df.format(readResultInfo.getMinValue()));
- result.append(" Avg= ").append(df.format(readResultInfo.getAvgValue()));
- result.append(" StdDev= ").append(df.format(readResultInfo.getStdDevValue()));
- result.append(" Total write= ").append(writeResultInfo.getResultCount());
- result.append(" Max= ").append(df.format(writeResultInfo.getMaxValue()));
- result.append(" Min= ").append(df.format(writeResultInfo.getMinValue()));
- result.append(" Avg= ").append(df.format(writeResultInfo.getAvgValue()));
- result.append(" StdDev= ").append(df.format(writeResultInfo.getStdDevValue()));
-
- System.out.println(result.toString());
- // long sum_read = 0;
- // long sum_write = 0;
- // long read = 0;
- // long write = 0;
- // for (WorkerResult workerResult : responceResults)
- // {
- // if (workerResult == null)
- // {
- // continue;
- // }
- // if (workerResult.isRead())
- // {
- // read++;
- // sum_read += workerResult.getResponceTime();
- // }
- // else
- // {
- // write++;
- // sum_write += workerResult.getResponceTime();
- // }
- // }
- // if ((read + write) > 0)
- // {
- // StringBuffer result = new StringBuffer();
- // result.append("ThreadCount= ").append(threadCount);
- // result.append(" TPS = ").append(Math.round(((read + write) * 1000) / iterationTime));
- // if (read > 0)
- // {
- // result.append(" Total read = ").append(read);
- //
- // result.append(" Avg read response = ").append((sum_read / read));
- // }
- // if (write > 0)
- // {
- // result.append(" Total write = ").append(write);
- //
- // result.append(" Avg write response = ").append((sum_write / write));
- // }
- //
- // System.out.println(result.toString());
- // }
- responceResults.clear();
- }
-
- public class ResultInfo
- {
- private double maxValue;
-
- private double minValue;
-
- private double avgValue;
-
- private double stdDevValue;
-
- private List<Double> data;
-
- /**
- * @param data
- */
- public ResultInfo(List<Double> data)
- {
- super();
- this.data = data;
- }
-
- private void calculate()
- {
- final int n = data.size();
- if (n < 2)
- {
- this.stdDevValue = Double.NaN;
- this.avgValue = data.get(0);
- this.maxValue = data.get(0);
- this.minValue = data.get(0);
- }
- else
- {
- this.avgValue = data.get(0);
- this.maxValue = data.get(0);
- this.minValue = data.get(0);
- double sum = 0;
- for (int i = 1; i < data.size(); i++)
- {
- Double currValue = data.get(i);
- if (currValue > maxValue)
- {
- maxValue = currValue;
- }
- if (currValue < minValue)
- {
- minValue = currValue;
- }
- double newavg = avgValue + (currValue - avgValue) / (i + 1);
- sum += (currValue - avgValue) * (currValue - newavg);
- this.avgValue = newavg;
- }
- // Change to ( n - 1 ) to n if you have complete data instead of a sample.
- this.stdDevValue = Math.sqrt(sum / (n - 1));
- }
- }
-
- /**
- * @return the stdDevValue
- */
- public double getStdDevValue()
- {
- return stdDevValue;
- }
-
- /**
- * @return the maxValue
- */
- public double getMaxValue()
- {
- return maxValue;
- }
-
- /**
- * @return the minValue
- */
- public double getMinValue()
- {
- return minValue;
- }
-
- /**
- * @return the avgValue
- */
- public double getAvgValue()
- {
- return avgValue;
- }
-
- /**
- * @return the data
- */
- public List<Double> getData()
- {
- return data;
- }
-
- public long getResultCount()
- {
- return data.size();
- }
-
- }
}
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/AbstractTestAgent.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/AbstractTestAgent.java 2010-02-22 20:08:35 UTC (rev 1940)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/AbstractTestAgent.java 2010-02-23 08:30:45 UTC (rev 1941)
@@ -38,18 +38,22 @@
private final List<NodeInfo> nodesPath;
- private final List<WorkerResult> responceResults;
+ private final ResultCollector resultCollector;
private boolean shouldStop = false;
+ private static volatile long LAST_WRITE_START;
+
+ private boolean blockWrite;
+
/**
*
*/
- public AbstractTestAgent(List<NodeInfo> nodesPath, List<WorkerResult> responceResults, CountDownLatch startSignal,
+ public AbstractTestAgent(List<NodeInfo> nodesPath, ResultCollector resultCollector, CountDownLatch startSignal,
int readValue, Random random)
{
this.nodesPath = nodesPath;
- this.responceResults = responceResults;
+ this.resultCollector = resultCollector;
this.random = random;
this.startSignal = startSignal;
this.readValue = readValue;
@@ -59,23 +63,15 @@
* Do read
* @return
*/
- public abstract void doRead(List<NodeInfo> nodesPath, List<WorkerResult> responseResults);
+ public abstract void doRead(List<NodeInfo> nodesPath, ResultCollector resultCollector);
/**
* Do write
* @return
*/
- public abstract void doWrite(List<NodeInfo> nodesPath, List<WorkerResult> responseResults);
+ public abstract void doWrite(List<NodeInfo> nodesPath, ResultCollector resultCollector);
/**
- * Prepare agent
- */
- protected void prepare()
- {
-
- }
-
- /**
* @see java.lang.Runnable#run()
*/
public void run()
@@ -86,15 +82,32 @@
while (!shouldStop)
{
- if (nodesPath.size() < 10 || random.nextInt(100) > readValue)
+ long totalRead = resultCollector.getTotalReadTime();
+ long totalWrite = resultCollector.getTotalWriteTime();
+ long readAndWrite = totalRead + totalWrite;
+ if (blockWrite)
{
-
- doWrite(nodesPath, responceResults);
+ doRead(nodesPath, resultCollector);
}
else
{
- doRead(nodesPath, responceResults);
+ long ratio = 0;
+ if (readAndWrite > 0)
+ {
+ ratio = (totalRead * 100) / readAndWrite;
+ }
+ //prevent to match write
+ if (nodesPath.size() < 2 || (System.currentTimeMillis() - LAST_WRITE_START > 500 && (ratio > readValue)))
+ {
+ LAST_WRITE_START = System.currentTimeMillis();
+ doWrite(nodesPath, resultCollector);
+ }
+ else
+ {
+ doRead(nodesPath, resultCollector);
+ }
}
+
}
}
catch (InterruptedException e)
@@ -104,6 +117,14 @@
}
/**
+ * @return the blockWrite
+ */
+ protected boolean isBlockWrite()
+ {
+ return blockWrite;
+ }
+
+ /**
* @return the shouldStop
*/
protected boolean isShouldStop()
@@ -112,6 +133,22 @@
}
/**
+ * Prepare agent
+ */
+ protected void prepare()
+ {
+
+ }
+
+ /**
+ * @param blockWrite the blockWrite to set
+ */
+ protected void setBlockWrite(boolean blockWrite)
+ {
+ this.blockWrite = blockWrite;
+ }
+
+ /**
* @param shouldStop the shouldStop to set
*/
protected void setShouldStop(boolean shouldStop)
Added: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/ResultCollector.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/ResultCollector.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/ResultCollector.java 2010-02-23 08:30:45 UTC (rev 1941)
@@ -0,0 +1,281 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * 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.exoplatform.services.jcr.cluster.load;
+
+import java.text.DecimalFormat;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicLong;
+
+/**
+ * @author <a href="mailto:Sergey.Kabashnyuk@exoplatform.org">Sergey Kabashnyuk</a>
+ * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ksm $
+ *
+ */
+public class ResultCollector
+{
+ private ResultInfo readResultInfo;
+
+ private ResultInfo writeResultInfo;
+
+ private final DecimalFormat df = new DecimalFormat("#####.##");
+
+ private long iterationStartTime;
+
+ private long iterationTime;
+
+ /**
+ *
+ */
+ public ResultCollector()
+ {
+ super();
+ readResultInfo = new ResultInfo();
+ writeResultInfo = new ResultInfo();
+ }
+
+ /**
+ *
+ * @return return total write time
+ */
+ public long getTotalWriteTime()
+ {
+ return writeResultInfo.getSum();
+ }
+
+ /**
+ * Reset result
+ */
+ public synchronized void reset()
+ {
+ this.readResultInfo = new ResultInfo();
+ this.writeResultInfo = new ResultInfo();
+ this.iterationStartTime = System.currentTimeMillis();
+ }
+
+ /**
+ *
+ * @return total read time.
+ */
+ public long getTotalReadTime()
+ {
+ return readResultInfo.getSum();
+ }
+
+ /**
+ * Total write time
+ * @return
+ */
+ public long getReadCount()
+ {
+ return readResultInfo.getResultCount();
+ }
+
+ /**
+ * Total read times
+ * @return
+ */
+ public long getWriteCount()
+ {
+ return writeResultInfo.getResultCount();
+ }
+
+ public void addResult(boolean isRead, long time)
+ {
+ if (isRead)
+ {
+ readResultInfo.addResult(time);
+ }
+ else
+ {
+ writeResultInfo.addResult(time);
+ }
+ }
+
+ /**
+ * Strt iteration
+ */
+ public void startIteration()
+ {
+ this.iterationStartTime = System.currentTimeMillis();
+ }
+
+ /**
+ * Strt iteration
+ */
+ public void finishIteration()
+ {
+ this.iterationTime = System.currentTimeMillis() - iterationStartTime;
+ }
+
+ public String getStatistic()
+ {
+ readResultInfo.calculateStatistic();
+ writeResultInfo.calculateStatistic();
+
+ StringBuffer result = new StringBuffer();
+ result.append(" TPS total= ").append(
+ Math.round(((readResultInfo.getResultCount() + writeResultInfo.getResultCount()) * 1000) / iterationTime));
+ result.append(" TPS read= ").append(Math.round(((readResultInfo.getResultCount()) * 1000) / iterationTime));
+ result.append(" TPS write= ").append(Math.round(((writeResultInfo.getResultCount()) * 1000) / iterationTime));
+
+ result.append(" Total read= ").append(df.format(readResultInfo.getResultCount()));
+ result.append(" Max= ").append(df.format(readResultInfo.getMaxValue()));
+ result.append(" Min= ").append(df.format(readResultInfo.getMinValue()));
+ result.append(" Avg= ").append(df.format(readResultInfo.getAvgValue()));
+ result.append(" StdDev= ").append(df.format(readResultInfo.getStdDevValue()));
+ result.append(" Total write= ").append(writeResultInfo.getResultCount());
+ result.append(" Max= ").append(df.format(writeResultInfo.getMaxValue()));
+ result.append(" Min= ").append(df.format(writeResultInfo.getMinValue()));
+ result.append(" Avg= ").append(df.format(writeResultInfo.getAvgValue()));
+ result.append(" StdDev= ").append(df.format(writeResultInfo.getStdDevValue()));
+
+ return result.toString();
+ }
+
+ class ResultInfo
+ {
+ private double maxValue;
+
+ private double minValue;
+
+ private double avgValue;
+
+ private double stdDevValue;
+
+ private List<Double> data;
+
+ private AtomicLong sumValue;
+
+ /**
+ * @param data
+ */
+ public ResultInfo()
+ {
+
+ this.data = new LinkedList<Double>();
+ this.sumValue = new AtomicLong(0);
+ }
+
+ public void addResult(long resultTime)
+ {
+ this.data.add(new Double(resultTime));
+ this.sumValue.addAndGet(resultTime);
+ }
+
+ /**
+ *
+ * @return sum of values
+ */
+ public long getSum()
+ {
+ return sumValue.get();
+ }
+
+ public void calculateStatistic()
+ {
+ final int n = data.size();
+ if (n > 0)
+ {
+ if (n < 2)
+ {
+ this.stdDevValue = Double.NaN;
+ this.avgValue = data.get(0);
+ this.maxValue = data.get(0);
+ this.minValue = data.get(0);
+ }
+ else
+ {
+ this.avgValue = data.get(0);
+ this.maxValue = data.get(0);
+ this.minValue = data.get(0);
+ double sum = 0;
+ for (int i = 1; i < data.size(); i++)
+ {
+ Double currValue = data.get(i);
+ if (currValue == null)
+ {
+ currValue = new Double(0);
+ }
+ if (currValue > maxValue)
+ {
+ maxValue = currValue;
+ }
+ if (currValue < minValue)
+ {
+ minValue = currValue;
+ }
+ double newavg = avgValue + (currValue - avgValue) / (i + 1);
+ sum += (currValue - avgValue) * (currValue - newavg);
+ this.avgValue = newavg;
+ }
+ // Change to ( n - 1 ) to n if you have complete data instead of a sample.
+ this.stdDevValue = Math.sqrt(sum / (n - 1));
+ }
+ }
+ }
+
+ /**
+ * @return the stdDevValue
+ */
+ public double getStdDevValue()
+ {
+ return stdDevValue;
+ }
+
+ /**
+ * @return the maxValue
+ */
+ public double getMaxValue()
+ {
+ return maxValue;
+ }
+
+ /**
+ * @return the minValue
+ */
+ public double getMinValue()
+ {
+ return minValue;
+ }
+
+ /**
+ * @return the avgValue
+ */
+ public double getAvgValue()
+ {
+ return avgValue;
+ }
+
+ /**
+ * @return the data
+ */
+ public List<Double> getData()
+ {
+ return data;
+ }
+
+ public long getResultCount()
+ {
+ return data.size();
+ }
+
+ }
+
+}
\ No newline at end of file
Property changes on: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/ResultCollector.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/query/JcrQueryAvgResponseTimeTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/query/JcrQueryAvgResponseTimeTest.java 2010-02-22 20:08:35 UTC (rev 1940)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/query/JcrQueryAvgResponseTimeTest.java 2010-02-23 08:30:45 UTC (rev 1941)
@@ -22,7 +22,7 @@
import org.exoplatform.services.jcr.cluster.load.AbstractAvgResponseTimeTest;
import org.exoplatform.services.jcr.cluster.load.AbstractTestAgent;
import org.exoplatform.services.jcr.cluster.load.NodeInfo;
-import org.exoplatform.services.jcr.cluster.load.WorkerResult;
+import org.exoplatform.services.jcr.cluster.load.ResultCollector;
import org.exoplatform.services.jcr.core.CredentialsImpl;
import org.exoplatform.services.jcr.impl.core.RepositoryImpl;
import org.jboss.cache.CacheException;
@@ -114,10 +114,10 @@
* @see org.exoplatform.services.jcr.cluster.load.AbstractAvgResponseTimeTest#getAgent(java.util.List, java.util.List, java.util.concurrent.CountDownLatch, int, java.util.Random)
*/
@Override
- protected AbstractTestAgent getAgent(List<NodeInfo> nodesPath, List<WorkerResult> responceResults,
+ protected AbstractTestAgent getAgent(List<NodeInfo> nodesPath, ResultCollector resultCollector,
CountDownLatch startSignal, int readValue, Random random)
{
- return new QueryTestAgent(repository, nodesPath, responceResults, startSignal, readValue, random);
+ return new QueryTestAgent(repository, nodesPath, resultCollector, startSignal, readValue, random);
}
}
@@ -136,10 +136,10 @@
* @param READ_VALUE
* @param random
*/
- public QueryTestAgent(RepositoryImpl repository, List<NodeInfo> nodesPath, List<WorkerResult> responceResults,
+ public QueryTestAgent(RepositoryImpl repository, List<NodeInfo> nodesPath, ResultCollector resultCollector,
CountDownLatch startSignal, int readValue, Random random)
{
- super(nodesPath, responceResults, startSignal, readValue, random);
+ super(nodesPath, resultCollector, startSignal, readValue, random);
this.threadUUID = UUID.randomUUID();
this.repository = repository;
initRoot();
@@ -216,7 +216,7 @@
* @see org.exoplatform.services.jcr.cluster.load.AbstractTestAgent#doRead(java.util.List)
*/
@Override
- public void doRead(List<NodeInfo> nodesPath, List<WorkerResult> responseResults)
+ public void doRead(List<NodeInfo> nodesPath, ResultCollector resultCollector)
{
Session sessionLocal = null;
try
@@ -236,7 +236,7 @@
long start = System.currentTimeMillis();
QueryResult res = q.execute();
long sqlsize = res.getNodes().getSize();
- responseResults.add(new WorkerResult(true, System.currentTimeMillis() - start));
+ resultCollector.addResult(true, System.currentTimeMillis() - start);
//log.info(word + " found:" + sqlsize + " time=" + (System.currentTimeMillis() - start));
}
@@ -258,7 +258,7 @@
* @see org.exoplatform.services.jcr.cluster.load.AbstractTestAgent#doWrite(java.util.List)
*/
@Override
- public void doWrite(List<NodeInfo> nodesPath, List<WorkerResult> responseResults)
+ public void doWrite(List<NodeInfo> nodesPath, ResultCollector resultCollector)
{
// get any word
int i = random.nextInt(words.length);
@@ -273,7 +273,7 @@
Node threadNode = getOrCreateNode(getOrCreateNode(TEST_ROOT, sessionLocal.getRootNode()), threadUUID);
addCountent(threadNode, UUID.randomUUID(), word);
sessionLocal.save();
- responseResults.add(new WorkerResult(false, System.currentTimeMillis() - start));
+ resultCollector.addResult(false, System.currentTimeMillis() - start);
//log.info(word + " time : " + (System.currentTimeMillis() - start));
}
catch (Exception e1)
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/AbstractWebDavTestAgent.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/AbstractWebDavTestAgent.java 2010-02-22 20:08:35 UTC (rev 1940)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/AbstractWebDavTestAgent.java 2010-02-23 08:30:45 UTC (rev 1941)
@@ -21,7 +21,7 @@
import org.exoplatform.services.jcr.cluster.JCRWebdavConnection;
import org.exoplatform.services.jcr.cluster.load.AbstractTestAgent;
import org.exoplatform.services.jcr.cluster.load.NodeInfo;
-import org.exoplatform.services.jcr.cluster.load.WorkerResult;
+import org.exoplatform.services.jcr.cluster.load.ResultCollector;
import java.util.List;
import java.util.Random;
@@ -51,10 +51,10 @@
* @param READ_VALUE
* @param random
*/
- public AbstractWebDavTestAgent(List<NodeInfo> nodesPath, List<WorkerResult> responceResults,
+ public AbstractWebDavTestAgent(List<NodeInfo> nodesPath, ResultCollector resultCollector,
CountDownLatch startSignal, int READ_VALUE, Random random)
{
- super(nodesPath, responceResults, startSignal, READ_VALUE, random);
+ super(nodesPath, resultCollector, startSignal, READ_VALUE, random);
}
protected JCRWebdavConnection getNewConnection()
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/WebDavAvgResponseTimeTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/WebDavAvgResponseTimeTest.java 2010-02-22 20:08:35 UTC (rev 1940)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/WebDavAvgResponseTimeTest.java 2010-02-23 08:30:45 UTC (rev 1941)
@@ -23,9 +23,8 @@
import org.exoplatform.services.jcr.cluster.load.AbstractAvgResponseTimeTest;
import org.exoplatform.services.jcr.cluster.load.AbstractTestAgent;
import org.exoplatform.services.jcr.cluster.load.NodeInfo;
-import org.exoplatform.services.jcr.cluster.load.WorkerResult;
+import org.exoplatform.services.jcr.cluster.load.ResultCollector;
-import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.UUID;
@@ -47,7 +46,7 @@
/**
* How much thread will be added on the next iteration.
*/
- private static final int ITERATION_GROWING_POLL = 10;
+ private static final int ITERATION_GROWING_POLL = 25;
/**
* Number between 0 and 100 show % how many read operations.
@@ -58,7 +57,7 @@
public void testWebDav() throws Exception
{
- WebDavTest test = new WebDavTest(ITERATION_GROWING_POLL, ITERATION_TIME, 10, READ_VALUE);
+ WebDavTest test = new WebDavTest(ITERATION_GROWING_POLL, ITERATION_TIME, 50, READ_VALUE);
test.testResponce();
}
@@ -89,9 +88,8 @@
super.setUp();
WebDavTestAgent setUpAgent = new WebDavTestAgent(null, null, null, null, 0, null);
- String testRoot = setUpAgent.createDirIfAbsent("", TEST_ROOT, new ArrayList<WorkerResult>());
- iterationRoot =
- setUpAgent.createDirIfAbsent(testRoot, UUID.randomUUID().toString(), new ArrayList<WorkerResult>());
+ String testRoot = setUpAgent.createDirIfAbsent("", TEST_ROOT, new ResultCollector());
+ iterationRoot = setUpAgent.createDirIfAbsent(testRoot, UUID.randomUUID().toString(), new ResultCollector());
}
/**
@@ -108,10 +106,10 @@
* @see org.exoplatform.services.jcr.cluster.load.AbstractAvgResponseTimeTest#getAgent(java.util.List, java.util.List, java.util.concurrent.CountDownLatch, int, java.util.Random)
*/
@Override
- protected AbstractTestAgent getAgent(List<NodeInfo> nodesPath, List<WorkerResult> responceResults,
+ protected AbstractTestAgent getAgent(List<NodeInfo> nodesPath, ResultCollector resultCollector,
CountDownLatch startSignal, int readValue, Random random)
{
- return new WebDavTestAgent(iterationRoot, nodesPath, responceResults, startSignal, readValue, random);
+ return new WebDavTestAgent(iterationRoot, nodesPath, resultCollector, startSignal, readValue, random);
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/WebDavTestAgent.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/WebDavTestAgent.java 2010-02-22 20:08:35 UTC (rev 1940)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/webdav/WebDavTestAgent.java 2010-02-23 08:30:45 UTC (rev 1941)
@@ -22,9 +22,8 @@
import org.exoplatform.common.http.client.HTTPResponse;
import org.exoplatform.services.jcr.cluster.JCRWebdavConnection;
import org.exoplatform.services.jcr.cluster.load.NodeInfo;
-import org.exoplatform.services.jcr.cluster.load.WorkerResult;
+import org.exoplatform.services.jcr.cluster.load.ResultCollector;
-import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.UUID;
@@ -40,6 +39,8 @@
private String testRoot;
+ private boolean readFresh = true;
+
/**
* @param nodesPath
* @param responceResults
@@ -47,10 +48,10 @@
* @param READ_VALUE
* @param random
*/
- public WebDavTestAgent(String testRoot, List<NodeInfo> nodesPath, List<WorkerResult> responceResults,
+ public WebDavTestAgent(String testRoot, List<NodeInfo> nodesPath, ResultCollector resultCollector,
CountDownLatch startSignal, int READ_VALUE, Random random)
{
- super(nodesPath, responceResults, startSignal, READ_VALUE, random);
+ super(nodesPath, resultCollector, startSignal, READ_VALUE, random);
this.testRoot = testRoot;
}
@@ -58,9 +59,8 @@
* @see org.exoplatform.services.jcr.cluster.load.AbstractTestAgent#doRead(java.util.List)
*/
@Override
- public void doRead(List<NodeInfo> nodesPath, List<WorkerResult> responseResults)
+ public void doRead(List<NodeInfo> nodesPath, ResultCollector resultCollector)
{
- //List<WorkerResult> result = new ArrayList<WorkerResult>();
if (nodesPath.size() > 0)
{
@@ -68,10 +68,12 @@
while (readNodePath == null)
{
NodeInfo nodeInfo = nodesPath.get(random.nextInt(nodesPath.size()));
- // if ((System.currentTimeMillis() - nodeInfo.created) > 30000)
- // {
+ if (!readFresh && (System.currentTimeMillis() - nodeInfo.getCreated()) < 30000)
+ {
+ return;
+ }
+
readNodePath = nodeInfo.getPath();
- // }
}
long start = System.currentTimeMillis();
@@ -82,7 +84,7 @@
HTTPResponse response = conn.getNode(readNodePath);
if (response.getStatusCode() == HTTPStatus.OK)
{
- responseResults.add(new WorkerResult(true, System.currentTimeMillis() - start));
+ resultCollector.addResult(true, System.currentTimeMillis() - start);
}
else
{
@@ -113,28 +115,28 @@
@Override
protected void prepare()
{
- testRoot = createDirIfAbsent(testRoot, UUID.randomUUID().toString(), new ArrayList<WorkerResult>());
+ testRoot = createDirIfAbsent(testRoot, UUID.randomUUID().toString(), new ResultCollector());
}
/**
* @see org.exoplatform.services.jcr.cluster.load.AbstractTestAgent#doWrite(java.util.List)
*/
@Override
- public void doWrite(List<NodeInfo> nodesPath, List<WorkerResult> responseResults)
+ public void doWrite(List<NodeInfo> nodesPath, ResultCollector resultCollector)
{
JCRWebdavConnection connection = null;
try
{
connection = getNewConnection();
- String putFile =
- createDirIfAbsent(testRoot, UUID.randomUUID().toString(), new ArrayList<WorkerResult>()) + "/file";
+ String putFile = testRoot + "/" + UUID.randomUUID().toString();
+
long start = System.currentTimeMillis();
- HTTPResponse response = connection.addNode(putFile, ("__the_data_in_nt+file__").getBytes());
+ HTTPResponse response = connection.addNode(putFile, ("__the_data_in_nt+file__").getBytes(), "text/plain");
if (response.getStatusCode() == HTTPStatus.CREATED)
{
- responseResults.add(new WorkerResult(false, System.currentTimeMillis() - start));
+ resultCollector.addResult(false, System.currentTimeMillis() - start);
nodesPath.add(new NodeInfo(putFile, System.currentTimeMillis()));
}
else
@@ -165,7 +167,7 @@
* @param data
* @return
*/
- public String createDirIfAbsent(String root, String name, List<WorkerResult> result)
+ public String createDirIfAbsent(String root, String name, ResultCollector resultCollector)
{
String path = root.length() == 0 ? name : root + "/" + name;
JCRWebdavConnection connection = null;
@@ -176,7 +178,8 @@
long start = System.currentTimeMillis();
HTTPResponse nodeResponce = connection.getNode(path);
//add information about read
- result.add(new WorkerResult(true, System.currentTimeMillis() - start));
+
+ resultCollector.addResult(true, System.currentTimeMillis() - start);
if (nodeResponce.getStatusCode() != HTTPStatus.OK)
{
start = System.currentTimeMillis();
@@ -185,7 +188,7 @@
if (addResponce.getStatusCode() == HTTPStatus.CREATED)
{
- result.add(new WorkerResult(false, System.currentTimeMillis() - start));
+ resultCollector.addResult(false, System.currentTimeMillis() - start);
}
else
{
@@ -216,14 +219,14 @@
* @param data
* @return
*/
- public String createDirIfAbsent(String root, UUID uuid, List<WorkerResult> result)
+ public String createDirIfAbsent(String root, UUID uuid, ResultCollector resultCollector)
{
String uuidPath = uuid.toString();
- String l1 = createDirIfAbsent(root, uuidPath.substring(0, 8), result);
+ String l1 = createDirIfAbsent(root, uuidPath.substring(0, 8), resultCollector);
// String l2 = createDirIfAbsent(l1, uuidPath.substring(9, 13), result);
// String l3 = createDirIfAbsent(l2, uuidPath.substring(14, 18), result);
// String l4 = createDirIfAbsent(l3, uuidPath.substring(19, 23), result);
- return createDirIfAbsent(l1, uuidPath.substring(9), result);
+ return createDirIfAbsent(l1, uuidPath.substring(9), resultCollector);
}
}
14 years, 2 months
exo-jcr SVN: r1940 - in kernel/trunk/exo.kernel.container/src: test/java/org/exoplatform/container/monitor/jvm and 1 other directory.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-02-22 15:08:35 -0500 (Mon, 22 Feb 2010)
New Revision: 1940
Modified:
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.java
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/monitor/jvm/TestJ2EEServerInfo.java
Log:
EXOJCR-536: The name of the configuration folder that is by default "exo-conf", can be changed thanks to the System property exo.conf.dir.name.
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.java 2010-02-22 20:08:23 UTC (rev 1939)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.java 2010-02-22 20:08:35 UTC (rev 1940)
@@ -32,9 +32,19 @@
*/
public class J2EEServerInfo
{
-
+
+ /**
+ * The name of the JVM parameter that allows us to change the location of the
+ * configuration directory
+ */
public static final String EXO_CONF_PARAM = "exo.conf.dir";
-
+
+ /**
+ * The name of the JVM parameter that allows us to change the default name
+ * of the configuration directory which is "exo-conf"
+ */
+ public static final String EXO_CONF_DIR_NAME_PARAM = "exo.conf.dir.name";
+
private String serverName_;
private String serverHome_;
@@ -58,11 +68,13 @@
String catalinaHome = System.getProperty("catalina.home");
String testHome = System.getProperty("maven.exoplatform.dir");
+ // The name of the configuration directory
+ final String confDirName = System.getProperty(EXO_CONF_DIR_NAME_PARAM, "exo-conf");
if (jonasHome != null)
{
serverName_ = "jonas";
serverHome_ = jonasHome;
- exoConfDir_ = serverHome_ + "/exo-conf";
+ exoConfDir_ = serverHome_ + "/" + confDirName;
}
else if (jbossHome != null)
{
@@ -76,16 +88,16 @@
{
try
{
- exoConfDir_ = new File(new URL(jbossConfigUrl).getFile() + "/exo-conf").getAbsolutePath();
+ exoConfDir_ = new File(new URL(jbossConfigUrl).getFile() + "/" + confDirName).getAbsolutePath();
}
catch (Throwable e)
{
// don't care about it
- exoConfDir_ = serverHome_ + "/exo-conf";
+ exoConfDir_ = serverHome_ + "/" + confDirName;
}
}
else
- exoConfDir_ = serverHome_ + "/exo-conf";
+ exoConfDir_ = serverHome_ + "/" + confDirName;
//
try
@@ -104,39 +116,39 @@
{
serverName_ = "jetty";
serverHome_ = jettyHome;
- exoConfDir_ = serverHome_ + "/exo-conf";
+ exoConfDir_ = serverHome_ + "/" + confDirName;
}
else if (websphereHome != null)
{
serverName_ = "websphere";
serverHome_ = websphereHome;
- exoConfDir_ = serverHome_ + "/exo-conf";
+ exoConfDir_ = serverHome_ + "/" + confDirName;
}
else if (weblogicHome != null)
{
serverName_ = "weblogic";
serverHome_ = weblogicHome;
- exoConfDir_ = serverHome_ + "/exo-conf";
+ exoConfDir_ = serverHome_ + "/" + confDirName;
// Catalina has to be processed at the end as other servers may embed it
}
else if (catalinaHome != null)
{
serverName_ = "tomcat";
serverHome_ = catalinaHome;
- exoConfDir_ = serverHome_ + "/exo-conf";
+ exoConfDir_ = serverHome_ + "/" + confDirName;
}
else if (testHome != null)
{
serverName_ = "test";
serverHome_ = testHome;
- exoConfDir_ = serverHome_ + "/exo-conf";
+ exoConfDir_ = serverHome_ + "/" + confDirName;
}
else
{
// throw new UnsupportedOperationException("unknown server platform") ;
serverName_ = "standalone";
serverHome_ = System.getProperty("user.dir");
- exoConfDir_ = serverHome_ + "/exo-conf";
+ exoConfDir_ = serverHome_ + "/" + confDirName;
mbeanServer = MBeanServerFactory.createMBeanServer();
}
Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/monitor/jvm/TestJ2EEServerInfo.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/monitor/jvm/TestJ2EEServerInfo.java 2010-02-22 20:08:23 UTC (rev 1939)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/monitor/jvm/TestJ2EEServerInfo.java 2010-02-22 20:08:35 UTC (rev 1940)
@@ -60,6 +60,61 @@
}
}
+ public void testConfigDirName()
+ {
+ testConfigDirName(null,"jonas.base");
+ testConfigDirName(null,"jboss.home.dir");
+ testConfigDirName(null,"jboss.home.dir", "jboss.server.config.url");
+ testConfigDirName(null,"jetty.home");
+ testConfigDirName(null,"was.install.root");
+ testConfigDirName(null,"wls.home");
+ testConfigDirName(null,"catalina.home");
+ testConfigDirName(null,"maven.exoplatform.dir");
+ testConfigDirName(null);
+ testConfigDirName("foo","jonas.base");
+ testConfigDirName("foo","jboss.home.dir");
+ testConfigDirName("foo","jboss.home.dir", "jboss.server.config.url");
+ testConfigDirName("foo","jetty.home");
+ testConfigDirName("foo","was.install.root");
+ testConfigDirName("foo","wls.home");
+ testConfigDirName("foo","catalina.home");
+ testConfigDirName("foo","maven.exoplatform.dir");
+ testConfigDirName("foo");
+ }
+
+ private void testConfigDirName(String confDirName, String... asVMParams)
+ {
+ if (confDirName != null)
+ {
+ System.setProperty(J2EEServerInfo.EXO_CONF_DIR_NAME_PARAM, confDirName);
+ }
+ if (asVMParams != null)
+ {
+ for (String asVMParam : asVMParams)
+ {
+ System.setProperty(asVMParam, confDir);
+ }
+ }
+ try
+ {
+ assertTrue((new J2EEServerInfo().getExoConfigurationDirectory()).contains(confDirName == null ? "exo-conf" : confDirName));
+ }
+ finally
+ {
+ if (confDirName != null)
+ {
+ System.getProperties().remove(J2EEServerInfo.EXO_CONF_DIR_NAME_PARAM);
+ }
+ if (asVMParams != null)
+ {
+ for (String asVMParam : asVMParams)
+ {
+ System.getProperties().remove(asVMParam);
+ }
+ }
+ }
+ }
+
public void testServerDirs() throws Exception
{
try
14 years, 2 months
exo-jcr SVN: r1939 - jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-02-22 15:08:23 -0500 (Mon, 22 Feb 2010)
New Revision: 1939
Modified:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/configuration.xml
Log:
EXOJCR-536: The name of the configuration folder that is by default "exo-conf", can be changed thanks to the System property exo.conf.dir.name.
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/configuration.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/configuration.xml 2010-02-22 17:04:15 UTC (rev 1938)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/configuration.xml 2010-02-22 20:08:23 UTC (rev 1939)
@@ -26,17 +26,239 @@
<section>
<title>Understanding How configuration files are loaded</title>
+ <para>eXo Portal uses PicoContainer, which implements the Inversion of
+ Control (IoC) design pattern. All eXo containers inherit from a
+ PicoContainer. There are mainly two eXo containers used, each of them can
+ provide one or several services. Each container service is delivered in a
+ JAR file. This JAR file may contain a default configuration. The use of
+ default configurations is recommended and most services provide it.</para>
+
+ <para>When a Pico Container searches for services and its configurations,
+ each configurable service may be reconfigured to override default values
+ or set additional parameters. If the service is configured in two or more
+ places the configuration override mechanism will be used.</para>
+
<section>
- <title>First concepts</title>
+ <title>Configuration Retrieval</title>
- <para>You can find the first concepts of <emphasis>How are the
- configuration files loaded</emphasis> <ulink
- url="http://wiki.exoplatform.org/xwiki/bin/view/Kernel/Container+Configuration">here</ulink>.</para>
+ <para>The container performs the following steps making eXo Container
+ configuration retrieval depending on the container type.</para>
+
+ <section>
+ <title>Configuration retrieval order for the
+ <envar>PortalContainer</envar></title>
+
+ <para>The container is initialized by looking into different
+ locations. This container is used by portal applications.
+ Configurations are overloaded in the following lookup sequence:</para>
+
+ <orderedlist>
+ <listitem>
+ <para>Services default <envar>RootContainer</envar> configurations
+ from JAR files <emphasis>/conf/configuration.xml</emphasis></para>
+ </listitem>
+
+ <listitem>
+ <para>External <envar>RootContainer</envar> configuration, if will
+ be found at
+ <emphasis>$AS_HOME/exo-conf/configuration.xml</emphasis></para>
+ </listitem>
+
+ <listitem>
+ <para>Services default <envar>PortalContainer</envar>
+ configurations from JAR files
+ <emphasis>/conf/portal/configuration.xml</emphasis></para>
+ </listitem>
+
+ <listitem>
+ <para>Web applications configurations from WAR files
+ <emphasis>/WEB-INF/conf/configuration.xml</emphasis></para>
+ </listitem>
+
+ <listitem>
+ <para>External configuration for services of named portal, if will
+ be found at
+ <emphasis>$AS_HOME/exo-conf/portal/$PORTAL_NAME/configuration.xml</emphasis></para>
+ </listitem>
+ </orderedlist>
+ </section>
+
+ <section>
+ <title>Configuration retrieval for a
+ <envar>StandaloneContainer</envar></title>
+
+ <para>The container is initialized by looking into different
+ locations. This container is used by non portal applications.
+ Configurations are overloaded in the following lookup sequence:</para>
+
+ <orderedlist>
+ <listitem>
+ <para>Services default <envar>RootContainer</envar> configurations
+ from JAR files <emphasis>/conf/configuration.xml</emphasis></para>
+ </listitem>
+
+ <listitem>
+ <para>External <envar>RootContainer</envar> configuration, if will
+ be found at
+ <emphasis>$AS_HOME/exo-conf/configuration.xml</emphasis></para>
+ </listitem>
+
+ <listitem>
+ <para>Services default <envar>StandaloneContainer</envar>
+ configurations from JAR files
+ <emphasis>/conf/portal/configuration.xml</emphasis></para>
+ </listitem>
+
+ <listitem>
+ <para>Web applications configurations from WAR files
+ <emphasis>/WEB-INF/conf/configuration.xml</emphasis></para>
+ </listitem>
+
+ <listitem>
+ <para>Then depending on the <envar>StandaloneContainer</envar>
+ configuration URL initialization:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>if configuration URL was initialized to be added to
+ services defaults, as below:<programlisting>// add configuration to the default services configurations from JARs/WARs
+StandaloneContainer.addConfigurationURL(containerConf);</programlisting></para>
+
+ <para>Configuration from added URL
+ <emphasis>containerConf</emphasis> will override only services
+ configured in the file</para>
+ </listitem>
+
+ <listitem>
+ <para>if configuration URL not initialized at all, it will be
+ found at <emphasis>$AS_HOME/exo-configuration.xml</emphasis>.
+ If <emphasis>$AS_HOME/exo-configuration.xml</emphasis> doesn't
+ exist and the <envar>StandaloneContainer</envar> instance
+ obtained with the dedicated configuration
+ <envar>ClassLoader</envar> the container will try to retrieve
+ the resource <emphasis>conf/exo-configuration.xml</emphasis>
+ within the given <envar>ClassLoader</envar>.</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </orderedlist>
+ </section>
+
+ <section>
+ <title>General notes about the configuration retrieval</title>
+
+ <note>
+ <para><emphasis>$AS_HOME</emphasis> - application server home
+ directory, or <emphasis>user.dir</emphasis> JVM system property
+ value in case of Java Standalone application.</para>
+ </note>
+
+ <note>
+ <para><emphasis>$PORTAL_NAME</emphasis> - portal web application
+ name.</para>
+ </note>
+
+ <note>
+ <para>External configuration location can be overridden with System
+ property <emphasis>exo.conf.dir</emphasis>. If the property exists
+ its value will be used as path to eXo configuration directory, i.e.
+ to <emphasis>$AS_HOME/exo-conf</emphasis> alternative. E.g. put
+ property in command line java
+ <emphasis>-Dexo.conf.dir=/path/to/exo/conf</emphasis>. In this
+ particular use case, you have no need to use any prefix to import
+ other files. For instance, if your configuration file is
+ <emphasis>$AS_HOME/exo-conf/portal/PORTAL_NAME/configuration.xml</emphasis>
+ and you want to import the configuration file
+ <emphasis>$AS_HOME/exo-conf/portal/PORTAL_NAME/mySubConfDir/myConfig.xml</emphasis>,
+ you can do it by adding
+ <emphasis><import>mySubConfDir/myConfig.xml</import></emphasis>
+ to your configuration file.</para>
+ </note>
+
+ <note>
+ <para>The name of the configuration folder that is by default
+ <emphasis>"exo-conf"</emphasis>, can be changed thanks to the System
+ property <emphasis>exo.conf.dir.name</emphasis>.</para>
+ </note>
+
+ <note>
+ <para>Under JBoss application server <emphasis>exo-conf</emphasis>
+ will be looked up in directory described by JBoss System property
+ <emphasis>jboss.server.config.url</emphasis>. If the property is not
+ found or empty <emphasis>$AS_HOME/exo-conf</emphasis> will be
+ asked.</para>
+ </note>
+
+ <note>
+ <para>The search looks for a configuration file in each JAR/WAR
+ available from the classpath using the current thread context
+ classloader. During the search these configurations are added to a
+ set. If the service was configured previously and the current JAR
+ contains a new configuration of that service the latest (from the
+ current JAR/WAR) will replace the previous one. The last one will be
+ applied to the service during the services start phase.</para>
+ </note>
+
+ <warning>
+ <para>Take care to have no dependencies between configurations from
+ JAR files (<emphasis>/conf/portal/configuration.xml</emphasis> and
+ <emphasis>/conf/configuration.xml</emphasis>) since we have no way
+ to know in advance the loading order of those configurations. In
+ other words, if you want to overload some configuration located in
+ the file <emphasis>/conf/portal/configuration.xml</emphasis> of a
+ given JAR file, you must not do it from the file
+ <emphasis>/conf/portal/configuration.xml</emphasis> of another JAR
+ file but from another configuration file loaded after configurations
+ from JAR files
+ <emphasis>/conf/portal/configuration.xml.</emphasis></para>
+ </warning>
+
+ <para>After the processing of all configurations available in system
+ the container will initialize it and start each service in order of
+ the dependency injection (DI).</para>
+
+ <para>The user/developer should be careful when configuring the same
+ service in different configuration files. It's recommended to
+ configure a service in its own JAR only. Or, in case of a portal
+ configuration, strictly reconfigure the services in portal WAR files
+ or in an external configuration.</para>
+
+ <para>There are services that can be (or should be) configured more
+ than one time. This depends on business logic of the service. A
+ service may initialize the same resource (shared with other services)
+ or may add a particular object to a set of objects (shared with other
+ services too). In the first case it's critical who will be the last,
+ i.e. whose configuration will be used. In the second case it's no
+ matter who is the first and who is the last (if the parameter objects
+ are independent).</para>
+ </section>
+
+ <section>
+ <title>Configuration retrieval log</title>
+
+ <para>In case of problems with service configuration it's important to
+ know from which JAR/WAR it comes. For that purpose the JVM system
+ property
+ <emphasis>org.exoplatform.container.configuration.debug</emphasis> can
+ be used.<programlisting>java -Dorg.exoplatform.container.configuration.debug ...</programlisting></para>
+
+ <para>If the property is enabled the container configuration manager
+ will report the configuration adding process to the standard output
+ (System.out).<programlisting>......
+ Add configuration jar:file:/D:/Projects/eXo/dev/exo-working/exo-tomcat/lib/exo.kernel.container-trunk.jar!/conf/portal/configuration.xml
+ Add configuration jar:file:/D:/Projects/eXo/dev/exo-working/exo-tomcat/lib/exo.kernel.component.cache-trunk.jar!/conf/portal/configuration.xml
+ Add configuration jndi:/localhost/portal/WEB-INF/conf/configuration.xml
+ import jndi:/localhost/portal/WEB-INF/conf/common/common-configuration.xml
+ import jndi:/localhost/portal/WEB-INF/conf/database/database-configuration.xml
+ import jndi:/localhost/portal/WEB-INF/conf/ecm/jcr-component-plugins-configuration.xml
+ import jndi:/localhost/portal/WEB-INF/conf/jcr/jcr-configuration.xml
+ ......</programlisting></para>
+ </section>
</section>
<section>
- <title>Advanced concepts for the <emphasis>PortalContainers</emphasis>
- </title>
+ <title>Advanced concepts for the
+ <emphasis>PortalContainers</emphasis></title>
<para>Since eXo JCR 1.12, we added a set of new features that have been
designed to extend portal applications such as GateIn.</para>
@@ -158,9 +380,9 @@
</tgroup>
</table>
- <para> A new <envar>PortalContainerDefinition</envar> can be defined
- at the <envar>RootContainer</envar> level thanks to an external
- plugin, see below an example:<programlisting> <external-component-plugins>
+ <para>A new <envar>PortalContainerDefinition</envar> can be defined at
+ the <envar>RootContainer</envar> level thanks to an external plugin,
+ see below an example:<programlisting> <external-component-plugins>
<!-- The full qualified name of the PortalContainerConfig -->
<target-component>org.exoplatform.container.definition.PortalContainerConfig</target-component>
<component-plugin>
@@ -450,7 +672,7 @@
name start with "<emphasis>portal.container.</emphasis>", so to get
the value of a setting called "<emphasis>foo</emphasis>" just use the
following syntax <emphasis>${portal.container.foo}</emphasis>. You can
- also use internal variables, such as: </para>
+ also use internal variables, such as:</para>
<table>
<title>Definition of the internal variables</title>
14 years, 2 months