[exo-jcr-commits] exo-jcr SVN: r5556 - in jcr/trunk: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl and 4 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Feb 1 09:17:54 EST 2012


Author: tolusha
Date: 2012-02-01 09:17:53 -0500 (Wed, 01 Feb 2012)
New Revision: 5556

Modified:
   jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/WorkspaceContainerFacade.java
   jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java
   jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java
   jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
   jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
   jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/cluster-config.xml
Log:
EXOJCR-1726: Ensure that all the running transactions are over before allowing to stop the JCR

Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/WorkspaceContainerFacade.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/WorkspaceContainerFacade.java	2012-02-01 14:03:00 UTC (rev 5555)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/WorkspaceContainerFacade.java	2012-02-01 14:17:53 UTC (rev 5556)
@@ -188,6 +188,7 @@
                      setOnline();
                      break;
                   case ManageableRepository.OFFLINE :
+                     suspend();
                      break;
                   case ManageableRepository.READONLY :
                      setReadOnly(true);
@@ -249,7 +250,10 @@
       {
          try
          {
-            component.suspend();
+            if (!component.isSuspended())
+            {
+               component.suspend();
+            }
          }
          catch (SuspendException e)
          {

Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java	2012-02-01 14:03:00 UTC (rev 5555)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java	2012-02-01 14:17:53 UTC (rev 5556)
@@ -31,6 +31,7 @@
 import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
 import org.exoplatform.services.jcr.config.RepositoryEntry;
 import org.exoplatform.services.jcr.config.WorkspaceEntry;
+import org.exoplatform.services.jcr.core.ManageableRepository;
 import org.exoplatform.services.jcr.core.nodetype.ExtendedNodeTypeManager;
 import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager;
 import org.exoplatform.services.jcr.core.security.JCRRuntimePermissions;
@@ -504,6 +505,17 @@
    @Override
    public synchronized void stop()
    {
+      RepositoryImpl repository = (RepositoryImpl)getComponentInstanceOfType(RepositoryImpl.class);
+
+      try
+      {
+         repository.setState(ManageableRepository.OFFLINE);
+      }
+      catch (RepositoryException e)
+      {
+         log.error("Can not switch repository to OFFLINE", e);
+      }
+
       super.stop();
       super.unregisterAllComponents();
    }

Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java	2012-02-01 14:03:00 UTC (rev 5555)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java	2012-02-01 14:17:53 UTC (rev 5556)
@@ -407,7 +407,6 @@
    public SessionImpl getDynamicSession(String workspaceName, Collection<MembershipEntry> membershipEntries)
             throws RepositoryException
    {
-
       if (getState() == OFFLINE)
          LOG.warn("Repository " + getName() + " is OFFLINE.");
 
@@ -723,10 +722,18 @@
          throw new RepositoryException("First switch repository to ONLINE and then to needed state.\n" + toString());
       }
 
-      // set state for all workspaces
-      for (String workspaceName : getWorkspaceNames())
+      String[] workspaces = getWorkspaceNames();
+      if (workspaces.length > 0)
       {
-         getWorkspaceContainer(workspaceName).setState(state);
+         // set state for all workspaces
+         for (String workspaceName : workspaces)
+         {
+            if (!workspaceName.equals(systemWorkspaceName))
+            {
+               getWorkspaceContainer(workspaceName).setState(state);
+            }
+         }
+         getWorkspaceContainer(systemWorkspaceName).setState(state);
       }
 
       isOffline = state == OFFLINE;

Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java	2012-02-01 14:03:00 UTC (rev 5555)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java	2012-02-01 14:17:53 UTC (rev 5556)
@@ -1200,10 +1200,10 @@
     */
    public void suspend() throws SuspendException
    {
-      isResponsibleForResuming = true;
-
       if (rpcService != null)
       {
+         isResponsibleForResuming = true;
+
          try
          {
             rpcService.executeCommandOnAllNodes(suspend, true);
@@ -1274,13 +1274,13 @@
          {
             throw new ResumeException(e);
          }
+
+         isResponsibleForResuming = false;
       }
       else
       {
          resumeLocally();
       }
-
-      isResponsibleForResuming = false;
    }
 
    /**
@@ -1541,32 +1541,29 @@
       {
          throw new SuspendException("Can't suspend index, while reindexing in progeress.");
       }
-      if (isSuspended)
-      {
-         throw new SuspendException("Component already suspended.");
-      }
 
-      if (handler instanceof Suspendable)
+      if (!isSuspended)
       {
-         ((Suspendable)handler).suspend();
-      }
+         if (handler instanceof Suspendable)
+         {
+            ((Suspendable)handler).suspend();
+         }
 
-      isSuspended = true;
+         isSuspended = true;
+      }
    }
 
    protected void resumeLocally() throws ResumeException
    {
-      if (!isSuspended)
+      if (isSuspended)
       {
-         throw new ResumeException("Component is not suspended.");
-      }
+         if (handler instanceof Suspendable)
+         {
+            ((Suspendable)handler).resume();
+         }
 
-      if (handler instanceof Suspendable)
-      {
-         ((Suspendable)handler).resume();
+         isSuspended = false;
       }
-
-      isSuspended = false;
    }
 
    /**

Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java	2012-02-01 14:03:00 UTC (rev 5555)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java	2012-02-01 14:17:53 UTC (rev 5556)
@@ -968,6 +968,14 @@
       finally
       {
          workingThreads.decrementAndGet();
+
+         if (isSuspended && workingThreads.get() == 0)
+         {
+            synchronized (workingThreads)
+            {
+               workingThreads.notifyAll();
+            }
+         }
       }
    }
 
@@ -1953,10 +1961,10 @@
     */
    public void suspend() throws SuspendException
    {
-      isResponsibleForResuming = true;
-
       if (rpcService != null)
       {
+         isResponsibleForResuming = true;
+
          try
          {
             rpcService.executeCommandOnAllNodes(suspend, true);
@@ -1995,13 +2003,13 @@
          {
             throw new ResumeException(e);
          }
+
+         isResponsibleForResuming = false;
       }
       else
       {
          resumeLocally();
       }
-
-      isResponsibleForResuming = false;
    }
 
    /**
@@ -2014,36 +2022,41 @@
 
    private void suspendLocally() throws SuspendException
    {
-      if (isSuspended)
+      if (!isSuspended)
       {
-         throw new SuspendException("Component already suspended.");
-      }
+         latcher = new CountDownLatch(1);
+         isSuspended = true;
 
-      latcher = new CountDownLatch(1);
-      isSuspended = true;
-
-      while (workingThreads.get() != 0)
-      {
-         try
+         if (workingThreads.get() > 0)
          {
-            Thread.sleep(50);
+            synchronized (workingThreads)
+            {
+               while (workingThreads.get() > 0)
+               {
+                  try
+                  {
+                     workingThreads.wait();
+                  }
+                  catch (InterruptedException e)
+                  {
+                     if (LOG.isTraceEnabled())
+                     {
+                        LOG.trace(e.getMessage(), e);
+                     }
+                  }
+               }
+            }
          }
-         catch (InterruptedException e)
-         {
-            throw new SuspendException(e);
-         }
       }
    }
 
    private void resumeLocally() throws ResumeException
    {
-      if (!isSuspended)
+      if (isSuspended)
       {
-         throw new ResumeException("Component is not suspended.");
+         latcher.countDown();
+         isSuspended = false;
       }
-
-      latcher.countDown();
-      isSuspended = false;
    }
 
    /**

Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/cluster-config.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/cluster-config.xml	2012-02-01 14:03:00 UTC (rev 5555)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/cluster-config.xml	2012-02-01 14:17:53 UTC (rev 5556)
@@ -1,39 +1,54 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- This document was created with Syntext Serna Free. --><!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This document was created with Syntext Serna Free. -->
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
 <chapter id="JCR.ClusterConfig">
-<?dbhtml filename="ch-cluster-config.html"?>  <title>Configuring JBoss AS with eXo JCR in cluster</title>
+  <?dbhtml filename="ch-cluster-config.html"?>
+
+  <title>Configuring JBoss AS with eXo JCR in cluster</title>
+
   <section>
     <title>Launching Cluster</title>
+
     <section>
       <title>Deploying eXo JCR to JBoss As</title>
+
       <para>To deploy eXo JCR to JBoss, do the following steps:</para>
+
       <orderedlist>
         <listitem>
-          <para>Download the latest version of eXo JCR .ear file distribution.</para>
+          <para>Download the latest version of eXo JCR .ear file
+          distribution.</para>
         </listitem>
+
         <listitem>
           <para>Copy &lt;jcr.ear&gt; into
           &lt;%jboss_home%/server/default/deploy&gt;</para>
         </listitem>
+
         <listitem>
           <para>Put exo-configuration.xml to the root
           &lt;%jboss_home%/exo-configuration.xml&gt;</para>
         </listitem>
+
         <listitem>
           <para>Configure JAAS by inserting XML fragment shown below into
           &lt;%jboss_home%/server/default/conf/login-config.xml&gt;</para>
-          
-          <programlisting language="xml">&lt;application-policy name=&quot;exo-domain&quot;&gt;
+
+          <programlisting language="xml">&lt;application-policy name="exo-domain"&gt;
    &lt;authentication&gt;
-      &lt;login-module code=&quot;org.exoplatform.services.security.j2ee.JbossLoginModule&quot; flag=&quot;required&quot;&gt;&lt;/login-module&gt;
+      &lt;login-module code="org.exoplatform.services.security.j2ee.JbossLoginModule" flag="required"&gt;&lt;/login-module&gt;
    &lt;/authentication&gt;
 &lt;/application-policy&gt;</programlisting>
         </listitem>
+
         <listitem>
-          <para>Ensure that you use JBossTS <link linkend="Kernel.TransactionService">Transaction Service</link> and
-          JBossCache <link linkend="JCR.JBossTransactionsService">Transaction Manager</link>. Your exo-configuration.xml must contain such
+          <para>Ensure that you use JBossTS <link
+          linkend="Kernel.TransactionService">Transaction Service</link> and
+          JBossCache <link linkend="JCR.JBossTransactionsService">Transaction
+          Manager</link>. Your exo-configuration.xml must contain such
           parts:</para>
-          
+
           <programlisting language="xml">&lt;component&gt;
    &lt;key&gt;org.jboss.cache.transaction.TransactionManagerLookup&lt;/key&gt;
    &lt;type&gt;org.jboss.cache.GenericTransactionManagerLookup&lt;/type&gt;^
@@ -50,72 +65,79 @@
    &lt;/init-params&gt;
 &lt;/component&gt;</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 <uri>http://localhostu:8080/browser</uri> with
-          root/exo as login/password if you have done everything right, you&apos;ll
+          root/exo as login/password if you have done everything right, you'll
           get access to repository browser.</para>
         </listitem>
       </orderedlist>
     </section>
+
     <section id="JCR.ClusterConfig.JCRExternalConfig">
       <title>Configuring JCR to use external configuration</title>
+
       <itemizedlist>
         <listitem>
           <para>To manually configure repository, create a new configuration
-          file (e.g., exo-jcr-configuration.xml). For details, see <link linkend="JCR.eXoJCRconfiguration">JCR Configuration</link>. Your
+          file (e.g., exo-jcr-configuration.xml). For details, see <link
+          linkend="JCR.eXoJCRconfiguration">JCR Configuration</link>. Your
           configuration must look like:</para>
-          
-          <programlisting language="xml">&lt;repository-service default-repository=&quot;repository1&quot;&gt;
+
+          <programlisting language="xml">&lt;repository-service default-repository="repository1"&gt;
    &lt;repositories&gt;
-      &lt;repository name=&quot;repository1&quot; system-workspace=&quot;ws1&quot; default-workspace=&quot;ws1&quot;&gt;
+      &lt;repository name="repository1" system-workspace="ws1" default-workspace="ws1"&gt;
          &lt;security-domain&gt;exo-domain&lt;/security-domain&gt;
          &lt;access-control&gt;optional&lt;/access-control&gt;
          &lt;authentication-policy&gt;org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator&lt;/authentication-policy&gt;
          &lt;workspaces&gt;
-            &lt;workspace name=&quot;ws1&quot;&gt;
-               &lt;container class=&quot;org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer&quot;&gt;
+            &lt;workspace name="ws1"&gt;
+               &lt;container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer"&gt;
                   &lt;properties&gt;
-                     &lt;property name=&quot;source-name&quot; value=&quot;jdbcjcr&quot; /&gt;
-                     &lt;property name=&quot;dialect&quot; value=&quot;oracle&quot; /&gt;
-                     &lt;property name=&quot;multi-db&quot; value=&quot;false&quot; /&gt;
-                     &lt;property name=&quot;update-storage&quot; value=&quot;false&quot; /&gt;
-                     &lt;property name=&quot;max-buffer-size&quot; value=&quot;200k&quot; /&gt;
-                     &lt;property name=&quot;swap-directory&quot; value=&quot;../temp/swap/production&quot; /&gt;
+                     &lt;property name="source-name" value="jdbcjcr" /&gt;
+                     &lt;property name="dialect" value="oracle" /&gt;
+                     &lt;property name="multi-db" value="false" /&gt;
+                     &lt;property name="update-storage" value="false" /&gt;
+                     &lt;property name="max-buffer-size" value="200k" /&gt;
+                     &lt;property name="swap-directory" value="../temp/swap/production" /&gt;
                   &lt;/properties&gt;
                   &lt;value-storages&gt;
-                     see &quot;<link linkend="conf_value_storage">Value storage configuration</link>&quot; part.
+                     see "<link linkend="conf_value_storage">Value storage configuration</link>" part.
                   &lt;/value-storages&gt;
                &lt;/container&gt;
-               &lt;initializer class=&quot;org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer&quot;&gt;
+               &lt;initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer"&gt;
                   &lt;properties&gt;
-                     &lt;property name=&quot;root-nodetype&quot; value=&quot;nt:unstructured&quot; /&gt;
+                     &lt;property name="root-nodetype" value="nt:unstructured" /&gt;
                   &lt;/properties&gt;
                &lt;/initializer&gt;
-               &lt;cache enabled=&quot;true&quot; class=&quot;org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache&quot;&gt;
-                     see  &quot;<link linkend="conf_cache">Cache configuration</link>&quot; part.
+               &lt;cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache"&gt;
+                     see  "<link linkend="conf_cache">Cache configuration</link>" part.
                &lt;/cache&gt;
-               &lt;query-handler class=&quot;org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex&quot;&gt;
-                  see  &quot;<link linkend="conf_indexer">Indexer configuration</link>&quot; part.
+               &lt;query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex"&gt;
+                  see  "<link linkend="conf_indexer">Indexer configuration</link>" part.
                &lt;/query-handler&gt;
-               &lt;lock-manager class=&quot;org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl&quot;&gt;
-                  see  &quot;<link linkend="conf_lock_manager">Lock Manager configuration</link>&quot; part.
+               &lt;lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl"&gt;
+                  see  "<link linkend="conf_lock_manager">Lock Manager configuration</link>" part.
                &lt;/lock-manager&gt;
             &lt;/workspace&gt;
-            &lt;workspace name=&quot;ws2&quot;&gt;
+            &lt;workspace name="ws2"&gt;
                         ...
             &lt;/workspace&gt;
-            &lt;workspace name=&quot;wsN&quot;&gt;
+            &lt;workspace name="wsN"&gt;
                         ...
             &lt;/workspace&gt;
          &lt;/workspaces&gt;
@@ -123,10 +145,11 @@
    &lt;/repositories&gt;
 &lt;/repository-service&gt; </programlisting>
         </listitem>
+
         <listitem>
-          <para>Then,  update RepositoryServiceConfiguration configuration in
+          <para>Then, update RepositoryServiceConfiguration configuration in
           exo-configuration.xml to use this file:</para>
-          
+
           <programlisting language="xml">&lt;component&gt;
    &lt;key&gt;org.exoplatform.services.jcr.config.RepositoryServiceConfiguration&lt;/key&gt;
    &lt;type&gt;org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl&lt;/type&gt;
@@ -142,97 +165,139 @@
       </itemizedlist>
     </section>
   </section>
+
   <section>
     <title>Requirements</title>
+
     <section>
       <title>Environment requirements</title>
+
       <itemizedlist>
         <listitem>
           <para>Every node of cluster MUST have the same mounted Network File
           System with the read and write permissions on it.</para>
-          <para>&quot;/mnt/tornado&quot; - path to the mounted Network File System (all
+
+          <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>The same Clusters on different nodes MUST have the same 
-          names (e.g., if Indexer cluster in workspace production on the first
-          node has the name &quot;production_indexer_cluster&quot;, then indexer clusters in
+          <para>The same Clusters on different nodes MUST have the same names
+          (e.g., if Indexer cluster in workspace production on the first node
+          has the name "production_indexer_cluster", then indexer clusters in
           workspace production on all other nodes MUST have the same name
-          &quot;production_indexer_cluster&quot; ).</para>
+          "production_indexer_cluster" ).</para>
         </listitem>
       </itemizedlist>
     </section>
+
     <section>
       <title>Configuration requirements</title>
+
       <para>Configuration of every workspace in repository must contains of
       such parts:</para>
+
       <itemizedlist>
         <listitem id="conf_value_storage">
           <para>Value Storage configuration:</para>
-          
+
           <programlisting language="xml">&lt;value-storages&gt;
-   &lt;value-storage id=&quot;system&quot; class=&quot;org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage&quot;&gt;
+   &lt;value-storage id="system" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage"&gt;
       &lt;properties&gt;
-         &lt;property name=&quot;path&quot; value=&quot;/mnt/tornado/temp/values/production&quot; /&gt;    &lt;!--path within NFS where ValueStorage will hold it&apos;s data--&gt;
+         &lt;property name="path" value="/mnt/tornado/temp/values/production" /&gt;    &lt;!--path within NFS where ValueStorage will hold it's data--&gt;
       &lt;/properties&gt;
       &lt;filters&gt;
-         &lt;filter property-type=&quot;Binary&quot; /&gt;
+         &lt;filter property-type="Binary" /&gt;
       &lt;/filters&gt;
    &lt;/value-storage&gt;
 &lt;/value-storages&gt;</programlisting>
         </listitem>
+
         <listitem id="conf_cache">
           <para>Cache configuration:</para>
-          
-          <programlisting language="xml">&lt;cache enabled=&quot;true&quot; class=&quot;org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache&quot;&gt;
+
+          <programlisting language="xml">&lt;cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache"&gt;
    &lt;properties&gt;
-      &lt;property name=&quot;jbosscache-configuration&quot; value=&quot;jar:/conf/portal/test-jbosscache-data.xml&quot; /&gt;     &lt;!--    path to JBoss Cache configuration for data storage --&gt;
-      &lt;property name=&quot;jgroups-configuration&quot; value=&quot;jar:/conf/portal/udp-mux.xml&quot; /&gt;                     &lt;!--    path to JGroups configuration --&gt;
-      &lt;property name=&quot;jbosscache-cluster-name&quot; value=&quot;JCR_Cluster_cache_production&quot; /&gt;                   &lt;!--    JBoss Cache data storage cluster name --&gt;
-      &lt;property name=&quot;jgroups-multiplexer-stack&quot; value=&quot;true&quot; /&gt;
+      &lt;property name="jbosscache-configuration" value="jar:/conf/portal/test-jbosscache-data.xml" /&gt;     &lt;!--    path to JBoss Cache configuration for data storage --&gt;
+      &lt;property name="jgroups-configuration" value="jar:/conf/portal/udp-mux.xml" /&gt;                     &lt;!--    path to JGroups configuration --&gt;
+      &lt;property name="jbosscache-cluster-name" value="JCR_Cluster_cache_production" /&gt;                   &lt;!--    JBoss Cache data storage cluster name --&gt;
+      &lt;property name="jgroups-multiplexer-stack" value="true" /&gt;
    &lt;/properties&gt;
 &lt;/cache&gt; </programlisting>
         </listitem>
+
         <listitem id="conf_indexer">
           <para>Indexer configuration:</para>
-          
-          <programlisting language="xml">&lt;query-handler class=&quot;org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex&quot;&gt;
+
+          <programlisting language="xml">&lt;query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex"&gt;
    &lt;properties&gt;
-      &lt;property name=&quot;changesfilter-class&quot; value=&quot;org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter&quot; /&gt;
-      &lt;property name=&quot;index-dir&quot; value=&quot;/mnt/tornado/temp/jcrlucenedb/production&quot; /&gt;                       &lt;!--    path within NFS where ValueStorage will hold it&apos;s data --&gt;
-      &lt;property name=&quot;jbosscache-configuration&quot; value=&quot;jar:/conf/portal/test-jbosscache-indexer.xml&quot; /&gt;    &lt;!--    path to JBoss Cache configuration for indexer --&gt;
-      &lt;property name=&quot;jgroups-configuration&quot; value=&quot;jar:/conf/portal/udp-mux.xml&quot; /&gt;                       &lt;!--    path to JGroups configuration --&gt;
-      &lt;property name=&quot;jbosscache-cluster-name&quot; value=&quot;JCR_Cluster_indexer_production&quot; /&gt;                   &lt;!--    JBoss Cache indexer cluster name --&gt;
-      &lt;property name=&quot;jgroups-multiplexer-stack&quot; value=&quot;true&quot; /&gt;
+      &lt;property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" /&gt;
+      &lt;property name="index-dir" value="/mnt/tornado/temp/jcrlucenedb/production" /&gt;                       &lt;!--    path within NFS where ValueStorage will hold it's data --&gt;
+      &lt;property name="jbosscache-configuration" value="jar:/conf/portal/test-jbosscache-indexer.xml" /&gt;    &lt;!--    path to JBoss Cache configuration for indexer --&gt;
+      &lt;property name="jgroups-configuration" value="jar:/conf/portal/udp-mux.xml" /&gt;                       &lt;!--    path to JGroups configuration --&gt;
+      &lt;property name="jbosscache-cluster-name" value="JCR_Cluster_indexer_production" /&gt;                   &lt;!--    JBoss Cache indexer cluster name --&gt;
+      &lt;property name="jgroups-multiplexer-stack" value="true" /&gt;
    &lt;/properties&gt;
 &lt;/query-handler&gt; </programlisting>
         </listitem>
+
         <listitem id="conf_lock_manager">
           <para>Lock Manager configuration:</para>
-          
-          <programlisting language="xml">&lt;lock-manager class=&quot;org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl&quot;&gt;
+
+          <programlisting language="xml">&lt;lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl"&gt;
    &lt;properties&gt;
-      &lt;property name=&quot;time-out&quot; value=&quot;15m&quot; /&gt;
-      &lt;property name=&quot;jbosscache-configuration&quot; value=&quot;jar:/conf/portal/test-jbosscache-lock.xml&quot; /&gt;       &lt;!--    path to JBoss Cache configuration for lock manager --&gt;
-      &lt;property name=&quot;jgroups-configuration&quot; value=&quot;jar:/conf/portal/udp-mux.xml&quot; /&gt;                       &lt;!--    path to JGroups configuration --&gt;
-      &lt;property name=&quot;jgroups-multiplexer-stack&quot; value=&quot;true&quot; /&gt;
-      &lt;property name=&quot;jbosscache-cluster-name&quot; value=&quot;JCR_Cluster_lock_production&quot; /&gt;                      &lt;!--    JBoss Cache locks cluster name --&gt;
+      &lt;property name="time-out" value="15m" /&gt;
+      &lt;property name="jbosscache-configuration" value="jar:/conf/portal/test-jbosscache-lock.xml" /&gt;       &lt;!--    path to JBoss Cache configuration for lock manager --&gt;
+      &lt;property name="jgroups-configuration" value="jar:/conf/portal/udp-mux.xml" /&gt;                       &lt;!--    path to JGroups configuration --&gt;
+      &lt;property name="jgroups-multiplexer-stack" value="true" /&gt;
+      &lt;property name="jbosscache-cluster-name" value="JCR_Cluster_lock_production" /&gt;                      &lt;!--    JBoss Cache locks cluster name --&gt;
                      
-      &lt;property name=&quot;jbosscache-cl-cache.jdbc.table.name&quot; value=&quot;jcrlocks_production&quot;/&gt;                   &lt;!--    the name of the DB table where lock&apos;s data will be stored --&gt;
-      &lt;property name=&quot;jbosscache-cl-cache.jdbc.table.create&quot; value=&quot;true&quot;/&gt;
-      &lt;property name=&quot;jbosscache-cl-cache.jdbc.table.drop&quot; value=&quot;false&quot;/&gt;
-      &lt;property name=&quot;jbosscache-cl-cache.jdbc.table.primarykey&quot; value=&quot;jcrlocks_production_pk&quot;/&gt;
-      &lt;property name=&quot;jbosscache-cl-cache.jdbc.fqn.column&quot; value=&quot;fqn&quot;/&gt;
-      &lt;property name=&quot;jbosscache-cl-cache.jdbc.node.column&quot; value=&quot;node&quot;/&gt;
-      &lt;property name=&quot;jbosscache-cl-cache.jdbc.parent.column&quot; value=&quot;parent&quot;/&gt;
-      &lt;property name=&quot;jbosscache-cl-cache.jdbc.datasource&quot; value=&quot;jdbcjcr&quot;/&gt;
+      &lt;property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks_production"/&gt;                   &lt;!--    the name of the DB table where lock's data will be stored --&gt;
+      &lt;property name="jbosscache-cl-cache.jdbc.table.create" value="true"/&gt;
+      &lt;property name="jbosscache-cl-cache.jdbc.table.drop" value="false"/&gt;
+      &lt;property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_production_pk"/&gt;
+      &lt;property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn"/&gt;
+      &lt;property name="jbosscache-cl-cache.jdbc.node.column" value="node"/&gt;
+      &lt;property name="jbosscache-cl-cache.jdbc.parent.column" value="parent"/&gt;
+      &lt;property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr"/&gt;
    &lt;/properties&gt;
 &lt;/lock-manager&gt;</programlisting>
         </listitem>
       </itemizedlist>
     </section>
   </section>
+
+  <section>
+    <title>How properly stop the node</title>
+
+    <para>To be sure that all transactions are over and JCR is in consistent
+    state after stopping node, you need to follow next steps:</para>
+
+    <itemizedlist>
+      <listitem>
+        <para>Connect using JMX to one of cluster's node which you won't need
+        to stop.</para>
+      </listitem>
+
+      <listitem>
+        <para>Use RepositorySuspendController suspend all repositories (see
+        <link linked="JCR.SearchIndexBackup">37.1 Repository
+        suspending</link>)</para>
+      </listitem>
+
+      <listitem>
+        <para>Stop the node</para>
+      </listitem>
+
+      <listitem>
+        <para>Use RepositorySuspendController to resume all repositories (see
+        <link linked="JCR.SearchIndexBackup">37.3 Repository
+        resuming</link>)</para>
+      </listitem>
+    </itemizedlist>
+  </section>
 </chapter>



More information about the exo-jcr-commits mailing list