exo-jcr SVN: r1848 - jcr/trunk/applications.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2010-02-17 04:48:09 -0500 (Wed, 17 Feb 2010)
New Revision: 1848
Removed:
jcr/trunk/applications/java/
Log:
EXOJCR-521 java folder removed
16 years, 2 months
exo-jcr SVN: r1847 - in jcr/trunk/applications: java and 1 other directory.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2010-02-17 04:43:07 -0500 (Wed, 17 Feb 2010)
New Revision: 1847
Added:
jcr/trunk/applications/exo.jcr.applications.fckeditor/
jcr/trunk/applications/exo.jcr.applications.rest/
jcr/trunk/applications/exo.jcr.ear/
Removed:
jcr/trunk/applications/java/exo.jcr.applications.fckeditor/
jcr/trunk/applications/java/exo.jcr.applications.rest/
jcr/trunk/applications/java/exo.jcr.ear/
Log:
EXOJCR-521 exo.jcr.applications.fckeditor, exo.jcr.applications.rest and exo.jcr.ear moved to applications folder
Copied: jcr/trunk/applications/exo.jcr.applications.fckeditor (from rev 1846, jcr/trunk/applications/java/exo.jcr.applications.fckeditor)
Copied: jcr/trunk/applications/exo.jcr.applications.rest (from rev 1846, jcr/trunk/applications/java/exo.jcr.applications.rest)
Copied: jcr/trunk/applications/exo.jcr.ear (from rev 1846, jcr/trunk/applications/java/exo.jcr.ear)
16 years, 2 months
exo-jcr SVN: r1846 - in jcr/trunk/applications: java and 1 other directory.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2010-02-17 04:38:49 -0500 (Wed, 17 Feb 2010)
New Revision: 1846
Added:
jcr/trunk/applications/exo.jcr.applications.browser/
Removed:
jcr/trunk/applications/java/exo.jcr.applications.browser/
Log:
EXOJCR-521 exo.jcr.applications.browser moved to applications folder
Copied: jcr/trunk/applications/exo.jcr.applications.browser (from rev 1845, jcr/trunk/applications/java/exo.jcr.applications.browser)
16 years, 2 months
exo-jcr SVN: r1845 - in jcr/trunk/applications: java and 1 other directory.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2010-02-17 04:37:16 -0500 (Wed, 17 Feb 2010)
New Revision: 1845
Added:
jcr/trunk/applications/exo.jcr.applications.backupconsole/
Removed:
jcr/trunk/applications/java/exo.jcr.applications.backupconsole/
Log:
EXOJCR-521 exo.jcr.applications.backupconsole moved to applications folder
Copied: jcr/trunk/applications/exo.jcr.applications.backupconsole (from rev 1844, jcr/trunk/applications/java/exo.jcr.applications.backupconsole)
16 years, 2 months
exo-jcr SVN: r1844 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2010-02-17 03:22:00 -0500 (Wed, 17 Feb 2010)
New Revision: 1844
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java
Log:
EXOJCR-422 : Add catching PDFDocumentReadException in NodeIndexer.addValues
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java 2010-02-17 08:20:41 UTC (rev 1843)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java 2010-02-17 08:22:00 UTC (rev 1844)
@@ -20,6 +20,7 @@
import org.apache.lucene.document.Field;
import org.apache.lucene.document.Fieldable;
import org.exoplatform.services.document.DocumentReader;
+import org.exoplatform.services.document.PDFDocumentReadException;
import org.exoplatform.services.document.DocumentReaderService;
import org.exoplatform.services.document.HandlerNotFoundException;
import org.exoplatform.services.jcr.core.ExtendedPropertyType;
@@ -303,9 +304,12 @@
// ok, have a reader
// if the prop obtainer from cache it will contains a values,
// otherwise read prop with values from DM
- data =
- prop.getValues().size() > 0 ? prop.getValues() : ((PropertyData)stateProvider.getItemData(node,
- new QPathEntry(Constants.JCR_DATA, 0))).getValues();
+
+ PropertyData propData = prop.getValues().size() > 0 ? prop : ((PropertyData)stateProvider.getItemData(node,
+ new QPathEntry(Constants.JCR_DATA, 0)));
+
+ data = propData.getValues();
+
if (data == null)
log.warn("null value found at property " + prop.getQPath().getAsString());
@@ -322,10 +326,15 @@
InputStream is = null;
try
{
-
is = pvd.getAsStream();
- Reader reader = new StringReader(dreader.getContentAsText(is, encoding));
- doc.add(createFulltextField(reader));
+ try {
+ Reader reader = new StringReader(dreader.getContentAsText(is, encoding));
+ doc.add(createFulltextField(reader));
+ }
+ catch (PDFDocumentReadException e)
+ {
+ log.error("Can not indexing the PDF document by path " + propData.getQPath().getAsString(), e);
+ }
}
finally
@@ -349,8 +358,14 @@
try
{
is = pvd.getAsStream();
- Reader reader = new StringReader(dreader.getContentAsText(is));
- doc.add(createFulltextField(reader));
+ try {
+ Reader reader = new StringReader(dreader.getContentAsText(is));
+ doc.add(createFulltextField(reader));
+ }
+ catch (PDFDocumentReadException e)
+ {
+ log.error("Can not indexing the PDF document by path " + propData.getQPath().getAsString(), e);
+ }
}
finally
{
16 years, 2 months
exo-jcr SVN: r1843 - jcr/tags/1.12.0-Beta04.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2010-02-17 03:20:41 -0500 (Wed, 17 Feb 2010)
New Revision: 1843
Added:
jcr/tags/1.12.0-Beta04/readme.txt
Log:
readme.txt
Added: jcr/tags/1.12.0-Beta04/readme.txt
===================================================================
--- jcr/tags/1.12.0-Beta04/readme.txt (rev 0)
+++ jcr/tags/1.12.0-Beta04/readme.txt 2010-02-17 08:20:41 UTC (rev 1843)
@@ -0,0 +1,37 @@
+JCR 1.12.0-Beta04
+=================
+
+
+eXoPlatform Java Content Repository (JSR-170) implementation and Extension services.
+Includes:
+* eXo Kernel 2.2.0-Beta04
+* eXo Core 2.3.0-Beta04
+* eXo WS 2.1.0-Beta04
+
+
+Release Notes - eXo-JCR - Version JCR-1.12.0-Beta04
+
+Bug
+
+ * [EXOJCR-255] - InputHeadersMap in exo.ws.rest.core does not provide correct size of items.
+ * [EXOJCR-259] - [Unplanned] move test-configuration.xml files from main to tests
+
+Task
+
+ * [EXOJCR-162] - [SWF] Clean up modules dependencies
+ * [EXOJCR-254] - Change the hibernate dependency to 3.3.2.GA
+ * [EXOJCR-257] - Change propertyDefinition exo:autoloadto autoCreated="true" in exo:groovyResourceContainer nodeType
+ * [EXOJCR-261] - upgrade hibernate jars to 3.3.2.GA
+
+
+Resources
+=========
+
+ Project site http://www.jboss.org/exojcr
+ Company site http://www.exoplatform.com
+ Documentation wiki http://wiki.exoplatform.org
+ Community JIRA http://jira.exoplatform.org
+ Comminity site http://www.exoplatform.org
+ Community forum http://www.exoplatform.com/portal/public/en/forum
+ JavaDoc site http://docs.exoplatform.org
+
\ No newline at end of file
16 years, 2 months
exo-jcr SVN: r1842 - jcr/trunk/docs/reference/en/src/main/docbook/en-us/modules.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2010-02-16 12:02:49 -0500 (Tue, 16 Feb 2010)
New Revision: 1842
Added:
jcr/trunk/docs/reference/en/src/main/docbook/en-us/modules/cluster-config.xml
Log:
EXOJCR-490 article describing launching JCR in cluster added
Added: jcr/trunk/docs/reference/en/src/main/docbook/en-us/modules/cluster-config.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-us/modules/cluster-config.xml (rev 0)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-us/modules/cluster-config.xml 2010-02-16 17:02:49 UTC (rev 1842)
@@ -0,0 +1,251 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+"http://www.oasis-open.org/docbook/xml/4.3b2/docbookx.dtd">
+<article>
+ <articleinfo>
+ <title>Configuring JBoss AS with eXo JCR in cluster</title>
+ </articleinfo>
+
+ <sect1>
+ <title>Launching Cluster</title>
+
+ <sect2>
+ <title>Deploying eXo JCR to JBoss As</title>
+
+ <para>To deploy eXo JCR to JBoss As follow next steps:</para>
+
+ <orderedlist>
+ <listitem>
+ <para>Dowload the latest version of eXo JCR ear distribution from
+ [LINK THERE]</para>
+ </listitem>
+
+ <listitem>
+ <para>Copy <jcr.ear> into
+ <%jboss_home%/server/default/deploy></para>
+ </listitem>
+
+ <listitem>
+ <para>Put exo-configuration.xml to the root
+ <%jboss_home%/exo-configuration.xml></para>
+ </listitem>
+
+ <listitem>
+ <para>Configure JAAS by inserting XML fragment shown below into
+ <%jboss_home%/server/default/conf/login-config.xml></para>
+
+ <programlisting><application-policy name="exo-domain">
+ <authentication>
+ <login-module code="org.exoplatform.services.security.j2ee.JbossLoginModule" flag="required"></login-module>
+ </authentication>
+</application-policy></programlisting>
+ </listitem>
+
+ <listitem>
+ <para>Start server:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>bin/run.sh for Unix</para>
+ </listitem>
+
+ <listitem>
+ <para>bin/run.bat for Windows</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+
+ <listitem>
+ <para>Try accessing <ulink
+ url="http://localhost:8080/browser">http://localhost:8080/browser</ulink>
+ with root/exo as login/password if you have done everything right,
+ you'll get access to repository browser.</para>
+ </listitem>
+ </orderedlist>
+ </sect2>
+
+ <sect2>
+ <title>Configuring JCR to use external configuration</title>
+
+ <itemizedlist>
+ <listitem>
+ <para>To manually configure repository create a new configuration
+ file (f.e. exo-jcr-configuration.xml). For details see <ulink
+ url="http://wiki.exoplatform.org/xwiki/bin/view/JCR/#HConfiguration">JCR
+ Configuration</ulink>. Your configuration must look like:</para>
+
+ <programlisting><repository-service default-repository="repository1">
+ <repositories>
+ <repository name="repository1" system-workspace="ws1" default-workspace="ws1">
+ <security-domain>exo-domain</security-domain>
+ <access-control>optional</access-control>
+ <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+ <workspaces>
+ <workspace name="ws1">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr" />
+ <property name="dialect" value="oracle" />
+ <property name="multi-db" value="false" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="../temp/swap/production" />
+ </properties>
+ <value-storages>
+ see "Value storage configuration" part.
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ </properties>
+ </initializer>
+ <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
+ see "Cache configuration" part.
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ see "Indexer configuration" part.
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ see "Lock Manager configuration" part.
+ </lock-manager>
+ </workspace>
+ <workspace name="ws2">
+ ...
+ </workspace>
+ <workspace name="wsN">
+ ...
+ </workspace>
+ </workspaces>
+ </repository>
+ </repositories>
+</repository-service> </programlisting>
+ </listitem>
+
+ <listitem>
+ <para>and update RepositoryServiceConfiguration configuration in
+ exo-configuration.xml to use this file:<programlisting><component>
+ <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+ <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>exo-jcr-configuration.xml</value>
+ </value-param>
+ </init-params>
+</component></programlisting></para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+ </sect1>
+
+ <sect1>
+ <title>Requirements</title>
+
+ <sect2>
+ <title>Enviorenment requirements</title>
+
+ <itemizedlist>
+ <listitem>
+ <para>Every node of cluster MUST have the same mounted Network File
+ System with read and write permissions on it.</para>
+
+ <para>"/mnt/tornado" - path to the mounted Network File System (all
+ cluster nodes must use the same NFS)</para>
+ </listitem>
+
+ <listitem>
+ <para>Every node of cluster MUST use the same database</para>
+ </listitem>
+
+ <listitem>
+ <para>Same Clusters on different nodes MUST have the same cluster
+ names (f.e if Indexer cluster in workspace production on the first
+ node has name "production_indexer_cluster", then indexer clusters in
+ workspace production on all other nodes MUST have the same name
+ "production_indexer_cluster" )</para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Enviorenment requirements</title>
+
+ <para>Configuration of every workspace in repository must contains of
+ such parts:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Value Storage configuration:</para>
+
+ <programlisting><value-storages>
+ <value-storage id="system" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="/mnt/tornado/temp/values/production" /> - path within NFS where ValueStorage will hold it's data
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+</value-storages></programlisting>
+ </listitem>
+ </itemizedlist>
+
+ <itemizedlist>
+ <listitem>
+ <para>Cache configuration:</para>
+
+ <programlisting><cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
+ <properties>
+ <property name="jbosscache-configuration" value="jar:/conf/portal/test-jbosscache-data.xml" /> - path to JBoss Cache configuration for data storage
+ <property name="jgroups-configuration" value="jar:/conf/portal/udp-mux.xml" /> - path to JGroups configuration
+ <property name="jbosscache-cluster-name" value="JCR_Cluster_cache_production" /> - JBoss Cache data storage cluster name
+ <property name="jgroups-multiplexer-stack" value="true" />
+ </properties>
+</cache> </programlisting>
+ </listitem>
+ </itemizedlist>
+
+ <itemizedlist>
+ <listitem>
+ <para>Indexer configuration:</para>
+
+ <programlisting><query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
+ <property name="index-dir" value="/mnt/tornado/temp/jcrlucenedb/production" /> - path within NFS where ValueStorage will hold it's data
+ <property name="jbosscache-configuration" value="jar:/conf/portal/test-jbosscache-indexer.xml" /> - path to JBoss Cache configuration for indexer
+ <property name="jgroups-configuration" value="jar:/conf/portal/udp-mux.xml" /> - path to JGroups configuration
+ <property name="jbosscache-cluster-name" value="JCR_Cluster_indexer_production" /> - JBoss Cache indexer cluster name
+ <property name="jgroups-multiplexer-stack" value="true" />
+ </properties>
+</query-handler> </programlisting>
+ </listitem>
+
+ <listitem>
+ <para>Lock Manager configuration:</para>
+
+ <programlisting><lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="jar:/conf/portal/test-jbosscache-lock.xml" /> - path to JBoss Cache configuration for lock manager
+ <property name="jgroups-configuration" value="jar:/conf/portal/udp-mux.xml" /> - path to JGroups configuration
+ <property name="jgroups-multiplexer-stack" value="true" />
+ <property name="jbosscache-cluster-name" value="JCR_Cluster_lock_production" /> - JBoss Cache locks cluster name
+
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks_production"/> - the name of the DB table where lock's data will be stored
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true"/>
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false"/>
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_production_pk"/>
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn"/>
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node"/>
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent"/>
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr"/>
+ </properties>
+</lock-manager></programlisting>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+ </sect1>
+</article>
16 years, 2 months
exo-jcr SVN: r1841 - in kernel/trunk: exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss and 1 other directories.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-02-16 11:53:30 -0500 (Tue, 16 Feb 2010)
New Revision: 1841
Modified:
kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/ExoCacheConfig.java
kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/AbstractExoCache.java
kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/java/org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java
Log:
EXOJCR-520: JBC implementation of ExoCache: Avoid to go through the interceptor chain when it is possible
ExoCacheConfig: The live time field is always expressed in seconds
AbstractExoCache: We know go though the interceptor chain when it is needed
TestAbstractExoCache: Test on evict even has been added
Modified: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/ExoCacheConfig.java
===================================================================
--- kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/ExoCacheConfig.java 2010-02-16 16:00:38 UTC (rev 1840)
+++ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/ExoCacheConfig.java 2010-02-16 16:53:30 UTC (rev 1841)
@@ -43,7 +43,7 @@
private int maxSize;
/**
- * The amount of time (in milliseconds) an element is not written or
+ * The amount of time (in seconds) an element is not written or
* read before it is evicted.
*/
private long liveTime;
@@ -105,7 +105,7 @@
public void setLiveTime(long period)
{
- liveTime = period * 1000;
+ liveTime = period;
}
public boolean isDistributed()
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/AbstractExoCache.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/AbstractExoCache.java 2010-02-16 16:00:38 UTC (rev 1840)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/AbstractExoCache.java 2010-02-16 16:53:30 UTC (rev 1841)
@@ -35,8 +35,9 @@
import org.jboss.cache.notifications.annotation.NodeEvicted;
import org.jboss.cache.notifications.annotation.NodeModified;
import org.jboss.cache.notifications.annotation.NodeRemoved;
-import org.jboss.cache.notifications.event.EventImpl;
-import org.jboss.cache.notifications.event.NodeEvent;
+import org.jboss.cache.notifications.event.NodeEvictedEvent;
+import org.jboss.cache.notifications.event.NodeModifiedEvent;
+import org.jboss.cache.notifications.event.NodeRemovedEvent;
import java.io.Serializable;
import java.util.LinkedList;
@@ -303,7 +304,9 @@
throw new NullPointerException("No null cache key accepted");
}
final Fqn<Serializable> fqn = getFqn(name);
- final NodeSPI<K, V> node = cache.getNode(fqn);
+ // We use the methods peek and getDirect to avoid going through the interceptor chain
+ // in order to avoid to visit nodes that were about to be evicted
+ final NodeSPI<K, V> node = cache.peek(fqn, false);
V result = null;
if (node != null)
{
@@ -342,7 +345,9 @@
continue;
}
final K key = getKey(node);
- final V value = node.get(key);
+ // We use the method getDirect to avoid going through the interceptor chain
+ // in order to avoid to visit nodes that were about to be evicted
+ final V value = ((NodeSPI<K, V>)node).getDirect(key);
ObjectCacheInfo<V> info = new ObjectCacheInfo<V>()
{
public V get()
@@ -527,47 +532,37 @@
{
@NodeEvicted
- public void nodeEvicted(NodeEvent ne)
+ public void nodeEvicted(NodeEvictedEvent ne)
{
if (ne.isPre())
{
- // Cannot give the value since
- // since it disturbs the eviction
- // algorithms
- onExpire(getKey(ne.getFqn()), null);
+ final NodeSPI<K, V> node = cache.peek(ne.getFqn(), true);
+ final K key = getKey(ne.getFqn());
+ onExpire(key, node == null ? null : node.getDirect(key));
}
}
+ @SuppressWarnings("unchecked")
@NodeRemoved
- public void nodeRemoved(NodeEvent ne)
+ public void nodeRemoved(NodeRemovedEvent ne)
{
if (ne.isPre() && !ne.isOriginLocal())
{
- final Node<K, V> node = cache.getNode(ne.getFqn());
final K key = getKey(ne.getFqn());
- onRemove(key, node.get(key));
+ final Map<K, V> data = ne.getData();
+ onRemove(key, data == null ? null : data.get(key));
}
}
@SuppressWarnings("unchecked")
@NodeModified
- public void nodeModified(NodeEvent ne)
+ public void nodeModified(NodeModifiedEvent ne)
{
if (!ne.isOriginLocal() && !ne.isPre())
{
final K key = getKey(ne.getFqn());
- if (ne instanceof EventImpl)
- {
- EventImpl evt = (EventImpl)ne;
- Map<K, V> data = evt.getData();
- if (data != null)
- {
- onPut(key, data.get(key));
- return;
- }
- }
- final Node<K, V> node = cache.getNode(ne.getFqn());
- onPut(key, node.get(key));
+ final Map<K, V> data = ne.getData();
+ onPut(key, data == null ? null : data.get(key));
}
}
}
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/java/org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/java/org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java 2010-02-16 16:00:38 UTC (rev 1840)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/java/org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java 2010-02-16 16:53:30 UTC (rev 1841)
@@ -236,12 +236,14 @@
ExoCacheConfig config = new ExoCacheConfig();
config.setName("MyCacheDistributed");
config.setMaxSize(5);
- config.setLiveTime(1000);
+ config.setLiveTime(1);
+ config.setImplementation("LRU");
config.setDistributed(true);
ExoCacheConfig config2 = new ExoCacheConfig();
config2.setName("MyCacheDistributed2");
config2.setMaxSize(5);
- config2.setLiveTime(1000);
+ config2.setLiveTime(1);
+ config2.setImplementation("LRU");
config2.setDistributed(true);
AbstractExoCache<Serializable, Object> cache1 = (AbstractExoCache<Serializable, Object>)factory.createCache(config);
MyCacheListener listener1 = new MyCacheListener();
@@ -379,6 +381,7 @@
cache1.putMap(values);
assertEquals(2, cache1.getCacheSize());
assertEquals(2, cache2.getCacheSize());
+ assertEquals(1, cache3.getCacheSize());
assertEquals(5, listener1.put);
assertEquals(5, listener2.put);
assertEquals(1, listener3.put);
@@ -391,6 +394,28 @@
assertEquals(1, listener1.clearCache);
assertEquals(0, listener2.clearCache);
assertEquals(0, listener3.clearCache);
+ assertEquals(0, listener1.expire);
+ assertEquals(0, listener2.expire);
+ assertEquals(0, listener3.expire);
+ Thread.sleep(1600);
+ assertEquals(0, cache1.getCacheSize());
+ assertEquals(0, cache2.getCacheSize());
+ assertEquals(0, cache3.getCacheSize());
+ assertEquals(5, listener1.put);
+ assertEquals(5, listener2.put);
+ assertEquals(1, listener3.put);
+ assertEquals(2, listener1.get);
+ assertEquals(4, listener2.get);
+ assertEquals(1, listener3.get);
+ assertEquals(2, listener1.remove);
+ assertEquals(2, listener2.remove);
+ assertEquals(0, listener3.remove);
+ assertEquals(1, listener1.clearCache);
+ assertEquals(0, listener2.clearCache);
+ assertEquals(0, listener3.clearCache);
+ assertEquals(2, listener1.expire);
+ assertEquals(2, listener2.expire);
+ assertEquals(1, listener3.expire);
}
finally
{
16 years, 2 months
exo-jcr SVN: r1840 - jcr/trunk/docs/reference/en/src/main/docbook/en-us/modules.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2010-02-16 11:00:38 -0500 (Tue, 16 Feb 2010)
New Revision: 1840
Added:
jcr/trunk/docs/reference/en/src/main/docbook/en-us/modules/jbosscache-configuration-templates.xml
Log:
EXOJCR-490: Added documentation on template-based configuration.
Added: jcr/trunk/docs/reference/en/src/main/docbook/en-us/modules/jbosscache-configuration-templates.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-us/modules/jbosscache-configuration-templates.xml (rev 0)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-us/modules/jbosscache-configuration-templates.xml 2010-02-16 16:00:38 UTC (rev 1840)
@@ -0,0 +1,265 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<article>
+ <articleinfo>
+ <title>JBoss Cache configuration</title>
+ </articleinfo>
+
+ <section>
+ <title>JBoss cache configuration for indexer, lock manager and data
+ container</title>
+
+ <para>Each mentioned components uses instances of JBoss Cache product for
+ caching in clustered environment. So every element has it's own transport
+ and has to be configured in proper way. As usual, workspaces has similar
+ configuration but with different cluster-names and may-be some other
+ parameters. The simplest way to configure them is to define their's own
+ configuration files for each component in each workspace: </para>
+
+ <programlisting><property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock-db1-ws1.xml" /></programlisting>
+
+ <para>But if there are few workspaces, configuring them in such a way can
+ be painful and hard-manageable. eXo JCR offers a template-based
+ configuration for JBoss Cache instances. You can have one template for
+ Lock Manager, one for Indexer and one for data container and use them in
+ all the workspaces, defining the map of substitution parameters in main
+ configuration file. Just simply define ${jbosscache-<parameter
+ name>} inside xml-template and list correct value in JCR configuration
+ file just below "jbosscache-configuration", as shown:</para>
+
+ <para>template: </para>
+
+ <programlisting>...
+<clustering mode="replication" clusterName="${jbosscache-cluster-name}">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" />
+...</programlisting>
+
+ <para>and JCR configuration file: </para>
+
+ <programlisting>...
+<property name="jbosscache-configuration" value="jar:/conf/portal/jbosscache-lock.xml" />
+<property name="jbosscache-cluster-name" value="JCR-cluster-locks-db1-ws" />
+...</programlisting>
+ </section>
+
+ <section>
+ <title>JGroups configuration</title>
+
+ <para>JGroups is used by JBoss Cache for network communications and
+ transport in clustered environment. If property "jgroups-configuration" is
+ defined in component configuration, it will be injected into the JBoss
+ Cache instance on startup. </para>
+
+ <programlisting><property name="jgroups-configuration" value="your/path/to/modified-udp.xml" /></programlisting>
+
+ <para>As mentioned above, each component (lock manager, data container and
+ query handler) for each workspace requires it's own clustered environment.
+ Saying with another words, they have their own clusters with unique names.
+ By default each cluster should perform multi-casts on separate port. This
+ configuration leads to great unnecessary overhead on cluster. Thats why
+ JGroups offers multiplexer feature, providing ability to use one single
+ channel for set of clusters. This feature reduces network overheads
+ increasing performance and stability of application. To enable multiplexer
+ stack, You should define appropriate configuration file (upd-mux.xml is
+ pre-shipped one with eXo JCR) and set "jgroups-multiplexer-stack" into
+ "true".</para>
+
+ <programlisting><property name="jgroups-configuration" value="jar:/conf/portal/udp-mux.xml" />
+<property name="jgroups-multiplexer-stack" value="true" /></programlisting>
+ </section>
+
+ <section>
+ <title>Shipped JBoss Cache configuration templates</title>
+
+ <para>Exo JCR implementation is shipped with ready-to-use JBoss Cache
+ configuration templates for JCR's components. They are situated in
+ application package in /conf/porta/ folder.</para>
+
+ <section>
+ <title>Data container template</title>
+
+ <para>Data container template is "jbosscache-data.xml" It's</para>
+
+ <programlisting><?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+ <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false"
+ lockAcquisitionTimeout="20000" />
+
+ <clustering mode="replication" clusterName="${jbosscache-cluster-name}">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" />
+ <jgroupsConfig multiplexerStack="jcr.stack" />
+ <sync />
+ </clustering>
+
+ <!-- Eviction configuration -->
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm"
+ actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ParentNodeEvictionActionPolicy"
+ eventQueueSize="1000000">
+ <property name="maxNodes" value="1000000" />
+ <property name="timeToLive" value="120000" />
+ </default>
+ </eviction>
+</jbosscache></programlisting>
+
+ <table>
+ <title>Template variables</title>
+
+ <tgroup cols="1">
+ <thead>
+ <row>
+ <entry align="center">Variable</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>jbosscache-cluster-name</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para> </para>
+ </section>
+
+ <section>
+ <title>Lock manager template</title>
+
+ <para>It's template name is "jbosscache-lock.xml" </para>
+
+ <programlisting><?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+ <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false"
+ lockAcquisitionTimeout="20000" />
+ <clustering mode="replication" clusterName="${jbosscache-cluster-name}">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" />
+ <jgroupsConfig multiplexerStack="jcr.stack" />
+ <sync />
+ </clustering>
+ <loaders passivation="false" shared="true">
+ <preload>
+ <node fqn="/" />
+ </preload>
+ <loader class="org.jboss.cache.loader.JDBCCacheLoader" async="false" fetchPersistentState="false"
+ ignoreModifications="false" purgeOnStartup="false">
+ <properties>
+ cache.jdbc.table.name=${jbosscache-cl-cache.jdbc.table.name}
+ cache.jdbc.table.create=${jbosscache-cl-cache.jdbc.table.create}
+ cache.jdbc.table.drop=${jbosscache-cl-cache.jdbc.table.drop}
+ cache.jdbc.table.primarykey=${jbosscache-cl-cache.jdbc.table.primarykey}
+ cache.jdbc.fqn.column=${jbosscache-cl-cache.jdbc.fqn.column}
+ cache.jdbc.fqn.type=${jbosscache-cl-cache.jdbc.fqn.type}
+ cache.jdbc.node.column=${jbosscache-cl-cache.jdbc.node.column}
+ cache.jdbc.node.type=${jbosscache-cl-cache.jdbc.node.type}
+ cache.jdbc.parent.column=${jbosscache-cl-cache.jdbc.parent.column}
+ cache.jdbc.datasource=${jbosscache-cl-cache.jdbc.datasource}
+ </properties>
+ </loader>
+ </loaders>
+</jbosscache></programlisting>
+
+ <table>
+ <title>Template variables</title>
+
+ <tgroup cols="1">
+ <thead>
+ <row>
+ <entry align="center">Variable</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>jbosscache-cluster-name</entry>
+ </row>
+
+ <row>
+ <entry>jbosscache-cl-cache.jdbc.table.name</entry>
+ </row>
+
+ <row>
+ <entry>jbosscache-cl-cache.jdbc.table.create</entry>
+ </row>
+
+ <row>
+ <entry>jbosscache-cl-cache.jdbc.table.drop</entry>
+ </row>
+
+ <row>
+ <entry>jbosscache-cl-cache.jdbc.table.primarykey</entry>
+ </row>
+
+ <row>
+ <entry>jbosscache-cl-cache.jdbc.fqn.column</entry>
+ </row>
+
+ <row>
+ <entry>jbosscache-cl-cache.jdbc.fqn.type</entry>
+ </row>
+
+ <row>
+ <entry>jbosscache-cl-cache.jdbc.node.column</entry>
+ </row>
+
+ <row>
+ <entry>jbosscache-cl-cache.jdbc.node.type</entry>
+ </row>
+
+ <row>
+ <entry>jbosscache-cl-cache.jdbc.parent.column</entry>
+ </row>
+
+ <row>
+ <entry>jbosscache-cl-cache.jdbc.datasource</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+
+ <section>
+ <title>Query handler (indexer) template</title>
+
+ <para>Have a look at "jbosscache-indexer.xml" </para>
+
+ <programlisting><?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
+ <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false"
+ lockAcquisitionTimeout="20000" />
+ <clustering mode="replication" clusterName="${jbosscache-cluster-name}">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" />
+ <jgroupsConfig multiplexerStack="jcr.stack" />
+ <sync />
+ </clustering>
+ <!-- Eviction configuration -->
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.FIFOAlgorithm" eventQueueSize="1000000">
+ <property name="maxNodes" value="10000" />
+ <property name="minTimeToLive" value="60000" />
+ </default>
+ </eviction>
+</jbosscache></programlisting>
+ <table>
+ <title>Template variables</title>
+
+ <tgroup cols="1">
+ <thead>
+ <row>
+ <entry align="center">Variable</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>jbosscache-cluster-name</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+ </section>
+</article>
Property changes on: jcr/trunk/docs/reference/en/src/main/docbook/en-us/modules/jbosscache-configuration-templates.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 2 months
exo-jcr SVN: r1839 - in core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document: impl and 1 other directory.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2010-02-16 10:59:42 -0500 (Tue, 16 Feb 2010)
New Revision: 1839
Added:
core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/PDFDocumentReadException.java
Modified:
core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/PDFDocumentReader.java
Log:
EXOJCR-422 : The adding throw PDFDocumentReadException when IOException
Added: core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/PDFDocumentReadException.java
===================================================================
--- core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/PDFDocumentReadException.java (rev 0)
+++ core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/PDFDocumentReadException.java 2010-02-16 15:59:42 UTC (rev 1839)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2003-2010 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.document;
+
+import java.io.IOException;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date: 2010
+ *
+ * @author <a href="mailto:alex.reshetnyak@exoplatform.com.ua">Alex Reshetnyak</a>
+ * @version $Id: PDFDocumentReaderException.java 111 2010-11-11 11:11:11Z rainf0x $
+ */
+public class PDFDocumentReadException
+ extends DocumentReadException
+{
+
+ /**
+ * Constructor.
+ *
+ * @param message
+ * String, the message of exception
+ * @param cause
+ * the cause of exception.
+ */
+ public PDFDocumentReadException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
\ No newline at end of file
Modified: core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/PDFDocumentReader.java
===================================================================
--- core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/PDFDocumentReader.java 2010-02-16 15:45:59 UTC (rev 1838)
+++ core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/PDFDocumentReader.java 2010-02-16 15:59:42 UTC (rev 1839)
@@ -24,6 +24,7 @@
import org.exoplatform.commons.utils.ISO8601;
import org.exoplatform.services.document.DCMetaData;
import org.exoplatform.services.document.DocumentReadException;
+import org.exoplatform.services.document.PDFDocumentReadException;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.pdfbox.pdmodel.PDDocument;
@@ -84,13 +85,16 @@
StringWriter sw = new StringWriter();
try
{
+ if (is.available() == 0)
+ return "";
+
try
{
pdDocument = PDDocument.load(is);
}
catch (IOException e)
{
- return "";
+ throw new PDFDocumentReadException("Can not load PDF documet.", e);
}
PDFTextStripper stripper = new PDFTextStripper();
16 years, 2 months