exo-jcr SVN: r576 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent.
by do-not-reply@jboss.org
Author: tolusha
Date: 2009-11-12 03:07:37 -0500 (Thu, 12 Nov 2009)
New Revision: 576
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java
Log:
EXOJCR-201: remove TODO
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 2009-11-12 08:06:27 UTC (rev 575)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 2009-11-12 08:07:37 UTC (rev 576)
@@ -130,7 +130,6 @@
if (!systemConnSessionInfoAdded)
{
- // TODO userId
if (!systemConnection.equals(thisConnection))
systemConnection.addSessionInfo(currChangesLog.getSessionId());
systemConnSessionInfoAdded = true;
@@ -159,7 +158,6 @@
if (!thisConnSessionInfoAdded)
{
- // TODO userId
if (!thisConnection.equals(systemConnection))
thisConnection.addSessionInfo(currChangesLog.getSessionId());
thisConnSessionInfoAdded = true;
16 years, 8 months
exo-jcr SVN: r575 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent.
by do-not-reply@jboss.org
Author: tolusha
Date: 2009-11-12 03:06:27 -0500 (Thu, 12 Nov 2009)
New Revision: 575
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
Log:
EXOJCR-201: bug fix
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 2009-11-11 18:14:58 UTC (rev 574)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 2009-11-12 08:06:27 UTC (rev 575)
@@ -18,8 +18,11 @@
*/
package org.exoplatform.services.jcr.impl.dataflow.persistent;
+import org.exoplatform.services.jcr.dataflow.ChangesLogIterator;
+import org.exoplatform.services.jcr.dataflow.CompositeChangesLog;
import org.exoplatform.services.jcr.dataflow.ItemState;
import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog;
+import org.exoplatform.services.jcr.dataflow.PlainChangesLog;
import org.exoplatform.services.jcr.dataflow.ReadOnlyThroughChanges;
import org.exoplatform.services.jcr.datamodel.QPath;
import org.exoplatform.services.jcr.impl.Constants;
@@ -28,8 +31,10 @@
import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
+import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.List;
import java.util.Set;
import javax.jcr.RepositoryException;
@@ -44,7 +49,7 @@
*/
public class JBossCacheWorkspaceDataManager extends WorkspacePersistentDataManager
{
-
+
/**
* JBossCachePersistentDataManager constructor.
*
@@ -54,7 +59,7 @@
public JBossCacheWorkspaceDataManager(WorkspaceDataContainer dataContainer,
SystemDataContainerHolder<WorkspaceDataContainer> systemDataContainerHolder)
{
- super(dataContainer, systemDataContainerHolder);
+ super(dataContainer, systemDataContainerHolder);
}
@Override
@@ -69,85 +74,125 @@
WorkspaceStorageConnection thisConnection = null;
WorkspaceStorageConnection systemConnection = null;
+ // prepare changes log list
+ List<PlainChangesLog> chengesLogList = new ArrayList<PlainChangesLog>();
+ if (changesLog instanceof PlainChangesLog)
+ {
+ chengesLogList.add((PlainChangesLog)changesLog);
+ }
+ else if (changesLog instanceof CompositeChangesLog)
+ {
+ for (ChangesLogIterator iter = ((CompositeChangesLog)changesLog).getLogIterator(); iter.hasNextLog();)
+ {
+ chengesLogList.add(iter.nextLog());
+ }
+ }
+
try
{
- for (Iterator<ItemState> iter = changesLog.getAllStates().iterator(); iter.hasNext();)
+ for (PlainChangesLog currChangesLog : chengesLogList)
{
- ItemState itemState = iter.next();
+ boolean systemConnSessionInfoAdded = false;
+ boolean thisConnSessionInfoAdded = false;
- if (!itemState.isPersisted())
- continue;
+ for (Iterator<ItemState> iter = currChangesLog.getAllStates().iterator(); iter.hasNext();)
+ {
+ ItemState itemState = iter.next();
- long start = System.currentTimeMillis();
+ if (!itemState.isPersisted())
+ continue;
- TransientItemData data = (TransientItemData)itemState.getData();
+ long start = System.currentTimeMillis();
- WorkspaceStorageConnection conn = null;
- if (isSystemDescendant(data.getQPath()))
- {
- conn = systemConnection == null
- // we need system connection but it's not exist
- ? systemConnection = (systemDataContainer != dataContainer
- // if it's different container instances
- ? systemDataContainer.equals(dataContainer) && thisConnection != null
- // but container confugrations are same and non-system connnection open
- // reuse this connection as system
- ? systemDataContainer.reuseConnection(thisConnection)
- // or open one new system
- : systemDataContainer.openConnection()
- // else if it's same container instances (system and this)
- : thisConnection == null
- // and non-system connection doens't exist - open it
- ? thisConnection = dataContainer.openConnection()
- // if already open - use it
- : thisConnection)
- // system connection opened - use it
- : systemConnection;
- }
- else
- {
- conn = thisConnection == null
- // we need this conatiner conection
- ? thisConnection = (systemDataContainer != dataContainer
- // if it's different container instances
- ? dataContainer.equals(systemDataContainer) && systemConnection != null
- // but container confugrations are same and system connnection open
- // reuse system connection as this
- ? dataContainer.reuseConnection(systemConnection)
- // or open one new
- : dataContainer.openConnection()
- // else if it's same container instances (system and this)
- : systemConnection == null
- // and system connection doens't exist - open it
- ? systemConnection = dataContainer.openConnection()
- // if already open - use it
- : systemConnection)
- // this connection opened - use it
- : thisConnection;
- }
+ TransientItemData data = (TransientItemData)itemState.getData();
- data.increasePersistedVersion();
+ WorkspaceStorageConnection conn = null;
+ if (isSystemDescendant(data.getQPath()))
+ {
+ conn = systemConnection == null
+ // we need system connection but it's not exist
+ ? systemConnection = (systemDataContainer != dataContainer
+ // if it's different container instances
+ ? systemDataContainer.equals(dataContainer) && thisConnection != null
+ // but container confugrations are same and non-system connnection open
+ // reuse this connection as system
+ ? systemDataContainer.reuseConnection(thisConnection)
+ // or open one new system
+ : systemDataContainer.openConnection()
+ // else if it's same container instances (system and this)
+ : thisConnection == null
+ // and non-system connection doens't exist - open it
+ ? thisConnection = dataContainer.openConnection()
+ // if already open - use it
+ : thisConnection)
+ // system connection opened - use it
+ : systemConnection;
- if (itemState.isAdded())
- {
- doAdd(data, conn, addedNodes);
+ if (!systemConnSessionInfoAdded)
+ {
+ // TODO userId
+ if (!systemConnection.equals(thisConnection))
+ systemConnection.addSessionInfo(currChangesLog.getSessionId());
+ systemConnSessionInfoAdded = true;
+ }
+ }
+ else
+ {
+ conn = thisConnection == null
+ // we need this conatiner conection
+ ? thisConnection = (systemDataContainer != dataContainer
+ // if it's different container instances
+ ? dataContainer.equals(systemDataContainer) && systemConnection != null
+ // but container confugrations are same and system connnection open
+ // reuse system connection as this
+ ? dataContainer.reuseConnection(systemConnection)
+ // or open one new
+ : dataContainer.openConnection()
+ // else if it's same container instances (system and this)
+ : systemConnection == null
+ // and system connection doens't exist - open it
+ ? systemConnection = dataContainer.openConnection()
+ // if already open - use it
+ : systemConnection)
+ // this connection opened - use it
+ : thisConnection;
+
+ if (!thisConnSessionInfoAdded)
+ {
+ // TODO userId
+ if (!thisConnection.equals(systemConnection))
+ thisConnection.addSessionInfo(currChangesLog.getSessionId());
+ thisConnSessionInfoAdded = true;
+ }
+ }
+
+ data.increasePersistedVersion();
+
+ if (itemState.isAdded())
+ {
+ doAdd(data, conn, addedNodes);
+ }
+ else if (itemState.isUpdated())
+ {
+ doUpdate(data, conn);
+ }
+ else if (itemState.isDeleted())
+ {
+ doDelete(data, conn);
+ }
+ else if (itemState.isRenamed())
+ {
+ doRename(data, conn, addedNodes);
+ }
+
+ if (LOG.isDebugEnabled())
+ LOG.debug(ItemState.nameFromValue(itemState.getState()) + " " + (System.currentTimeMillis() - start)
+ + "ms, " + data.getQPath().getAsString());
}
- else if (itemState.isUpdated())
- {
- doUpdate(data, conn);
- }
- else if (itemState.isDeleted())
- {
- doDelete(data, conn);
- }
- else if (itemState.isRenamed())
- {
- doRename(data, conn, addedNodes);
- }
-
- if (LOG.isDebugEnabled())
- LOG.debug(ItemState.nameFromValue(itemState.getState()) + " " + (System.currentTimeMillis() - start)
- + "ms, " + data.getQPath().getAsString());
+ if (thisConnection != null)
+ thisConnection.removeSessionInfo();
+ if (systemConnection != null && !systemConnection.equals(thisConnection))
+ systemConnection.removeSessionInfo();
}
if (thisConnection != null)
thisConnection.commit();
@@ -166,7 +211,6 @@
}
}
-
/**
* Tell if the path is jcr:system descendant.
*
@@ -178,5 +222,5 @@
{
return path.isDescendantOf(Constants.JCR_SYSTEM_PATH) || path.equals(Constants.JCR_SYSTEM_PATH);
}
-
+
}
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2009-11-11 18:14:58 UTC (rev 574)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2009-11-12 08:06:27 UTC (rev 575)
@@ -131,125 +131,85 @@
WorkspaceStorageConnection thisConnection = null;
WorkspaceStorageConnection systemConnection = null;
- // prepare changes log list
- List<PlainChangesLog> chengesLogList = new ArrayList<PlainChangesLog>();
- if (changesLog instanceof PlainChangesLog)
- {
- chengesLogList.add((PlainChangesLog)changesLog);
- }
- else if (changesLog instanceof CompositeChangesLog)
- {
- for (ChangesLogIterator iter = ((CompositeChangesLog)changesLog).getLogIterator(); iter.hasNextLog();)
- {
- chengesLogList.add(iter.nextLog());
- }
- }
-
try
{
- for (PlainChangesLog currChangesLog : chengesLogList)
+ for (Iterator<ItemState> iter = changesLog.getAllStates().iterator(); iter.hasNext();)
{
- boolean systemConnSessionInfoAdded = false;
- boolean thisConnSessionInfoAdded = false;
+ ItemState itemState = iter.next();
- for (Iterator<ItemState> iter = currChangesLog.getAllStates().iterator(); iter.hasNext();)
- {
- ItemState itemState = iter.next();
+ if (!itemState.isPersisted())
+ continue;
- if (!itemState.isPersisted())
- continue;
+ long start = System.currentTimeMillis();
- long start = System.currentTimeMillis();
+ TransientItemData data = (TransientItemData)itemState.getData();
- TransientItemData data = (TransientItemData)itemState.getData();
+ WorkspaceStorageConnection conn = null;
+ if (isSystemDescendant(data.getQPath()))
+ {
+ conn = systemConnection == null
+ // we need system connection but it's not exist
+ ? systemConnection = (systemDataContainer != dataContainer
+ // if it's different container instances
+ ? systemDataContainer.equals(dataContainer) && thisConnection != null
+ // but container configurations are same and non-system connection open
+ // reuse this connection as system
+ ? systemDataContainer.reuseConnection(thisConnection)
+ // or open one new system
+ : systemDataContainer.openConnection()
+ // else if it's same container instances (system and this)
+ : thisConnection == null
+ // and non-system connection doens't exist - open it
+ ? thisConnection = dataContainer.openConnection()
+ // if already open - use it
+ : thisConnection)
+ // system connection opened - use it
+ : systemConnection;
+ }
+ else
+ {
+ conn = thisConnection == null
+ // we need this container connection
+ ? thisConnection = (systemDataContainer != dataContainer
+ // if it's different container instances
+ ? dataContainer.equals(systemDataContainer) && systemConnection != null
+ // but container configurations are same and system connection open
+ // reuse system connection as this
+ ? dataContainer.reuseConnection(systemConnection)
+ // or open one new
+ : dataContainer.openConnection()
+ // else if it's same container instances (system and this)
+ : systemConnection == null
+ // and system connection doens't exist - open it
+ ? systemConnection = dataContainer.openConnection()
+ // if already open - use it
+ : systemConnection)
+ // this connection opened - use it
+ : thisConnection;
+ }
- WorkspaceStorageConnection conn = null;
- if (isSystemDescendant(data.getQPath()))
- {
- conn = systemConnection == null
- // we need system connection but it's not exist
- ? systemConnection = (systemDataContainer != dataContainer
- // if it's different container instances
- ? systemDataContainer.equals(dataContainer) && thisConnection != null
- // but container configurations are same and non-system connection open
- // reuse this connection as system
- ? systemDataContainer.reuseConnection(thisConnection)
- // or open one new system
- : systemDataContainer.openConnection()
- // else if it's same container instances (system and this)
- : thisConnection == null
- // and non-system connection doens't exist - open it
- ? thisConnection = dataContainer.openConnection()
- // if already open - use it
- : thisConnection)
- // system connection opened - use it
- : systemConnection;
+ data.increasePersistedVersion();
- if (!systemConnSessionInfoAdded)
- {
- // TODO userId
- if (!systemConnection.equals(thisConnection))
- systemConnection.addSessionInfo(currChangesLog.getSessionId());
- systemConnSessionInfoAdded = true;
- }
- }
- else
- {
- conn = thisConnection == null
- // we need this container connection
- ? thisConnection = (systemDataContainer != dataContainer
- // if it's different container instances
- ? dataContainer.equals(systemDataContainer) && systemConnection != null
- // but container configurations are same and system connection open
- // reuse system connection as this
- ? dataContainer.reuseConnection(systemConnection)
- // or open one new
- : dataContainer.openConnection()
- // else if it's same container instances (system and this)
- : systemConnection == null
- // and system connection doens't exist - open it
- ? systemConnection = dataContainer.openConnection()
- // if already open - use it
- : systemConnection)
- // this connection opened - use it
- : thisConnection;
-
- if (!thisConnSessionInfoAdded)
- {
- // TODO userId
- if (!thisConnection.equals(systemConnection))
- thisConnection.addSessionInfo(currChangesLog.getSessionId());
- thisConnSessionInfoAdded = true;
- }
- }
-
- data.increasePersistedVersion();
-
- if (itemState.isAdded())
- {
- doAdd(data, conn, addedNodes);
- }
- else if (itemState.isUpdated())
- {
- doUpdate(data, conn);
- }
- else if (itemState.isDeleted())
- {
- doDelete(data, conn);
- }
- else if (itemState.isRenamed())
- {
- doRename(data, conn, addedNodes);
- }
-
- if (LOG.isDebugEnabled())
- LOG.debug(ItemState.nameFromValue(itemState.getState()) + " " + (System.currentTimeMillis() - start)
- + "ms, " + data.getQPath().getAsString());
+ if (itemState.isAdded())
+ {
+ doAdd(data, conn, addedNodes);
}
- if (thisConnection != null)
- thisConnection.removeSessionInfo();
- if (systemConnection != null && !systemConnection.equals(thisConnection))
- systemConnection.removeSessionInfo();
+ else if (itemState.isUpdated())
+ {
+ doUpdate(data, conn);
+ }
+ else if (itemState.isDeleted())
+ {
+ doDelete(data, conn);
+ }
+ else if (itemState.isRenamed())
+ {
+ doRename(data, conn, addedNodes);
+ }
+
+ if (LOG.isDebugEnabled())
+ LOG.debug(ItemState.nameFromValue(itemState.getState()) + " " + (System.currentTimeMillis() - start)
+ + "ms, " + data.getQPath().getAsString());
}
if (thisConnection != null)
thisConnection.commit();
16 years, 8 months
exo-jcr SVN: r574 - kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/impl.
by do-not-reply@jboss.org
Author: hung_van
Date: 2009-11-11 13:14:58 -0500 (Wed, 11 Nov 2009)
New Revision: 574
Modified:
kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/impl/JobSchedulerServiceImpl.java
Log:
EXOJCR-215 JobSchedulerServiceImpl.addCronJob() ignores JobDataMap argument
Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/impl/JobSchedulerServiceImpl.java
===================================================================
--- kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/impl/JobSchedulerServiceImpl.java 2009-11-11 18:13:28 UTC (rev 573)
+++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/impl/JobSchedulerServiceImpl.java 2009-11-11 18:14:58 UTC (rev 574)
@@ -155,7 +155,7 @@
JobInfo jobinfo = getJobInfo(jinfo);
CronTrigger trigger =
new CronTrigger(jobinfo.getJobName(), jobinfo.getGroupName(), jobinfo.getJobName(), jobinfo.getGroupName(),
- exp);
+ exp);
JobDetail job = new JobDetail(jobinfo.getJobName(), jobinfo.getGroupName(), jobinfo.getJob());
job.setDescription(jobinfo.getDescription());
scheduler_.addJob(job, true);
@@ -173,7 +173,7 @@
JobInfo jobinfo = getJobInfo(jinfo);
CronTrigger trigger =
new CronTrigger(jobinfo.getJobName(), jobinfo.getGroupName(), jobinfo.getJobName(), jobinfo.getGroupName(),
- exp);
+ exp);
JobDetail job = new JobDetail(jobinfo.getJobName(), jobinfo.getGroupName(), jobinfo.getJob());
job.setJobDataMap(jdatamap);
job.setDescription(jobinfo.getDescription());
16 years, 8 months
exo-jcr SVN: r573 - kernel/branches/mc-int-branch/component/common/src/main/java/org/exoplatform/services/scheduler/impl.
by do-not-reply@jboss.org
Author: hung_van
Date: 2009-11-11 13:13:28 -0500 (Wed, 11 Nov 2009)
New Revision: 573
Modified:
kernel/branches/mc-int-branch/component/common/src/main/java/org/exoplatform/services/scheduler/impl/JobSchedulerServiceImpl.java
Log:
EXOJCR-215 JobSchedulerServiceImpl.addCronJob() ignores JobDataMap argument
Modified: kernel/branches/mc-int-branch/component/common/src/main/java/org/exoplatform/services/scheduler/impl/JobSchedulerServiceImpl.java
===================================================================
--- kernel/branches/mc-int-branch/component/common/src/main/java/org/exoplatform/services/scheduler/impl/JobSchedulerServiceImpl.java 2009-11-11 18:08:57 UTC (rev 572)
+++ kernel/branches/mc-int-branch/component/common/src/main/java/org/exoplatform/services/scheduler/impl/JobSchedulerServiceImpl.java 2009-11-11 18:13:28 UTC (rev 573)
@@ -172,8 +172,8 @@
{
JobInfo jobinfo = getJobInfo(jinfo);
CronTrigger trigger =
- new CronTrigger(jobinfo.getJobName(), jobinfo.getGroupName(), jobinfo.getJobName(), jobinfo.getGroupName(),
- exp);
+ new CronTrigger(jobinfo.getJobName(), jobinfo.getGroupName(), jobinfo.getJobName(), jobinfo.getGroupName(),
+ exp);
JobDetail job = new JobDetail(jobinfo.getJobName(), jobinfo.getGroupName(), jobinfo.getJob());
job.setJobDataMap(jdatamap);
job.setDescription(jobinfo.getDescription());
16 years, 8 months
exo-jcr SVN: r572 - kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/impl.
by do-not-reply@jboss.org
Author: hung_van
Date: 2009-11-11 13:08:57 -0500 (Wed, 11 Nov 2009)
New Revision: 572
Modified:
kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/impl/JobSchedulerServiceImpl.java
Log:
JobSchedulerServiceImpl.addCronJob() ignores JobDataMap argument
Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/impl/JobSchedulerServiceImpl.java
===================================================================
--- kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/impl/JobSchedulerServiceImpl.java 2009-11-11 18:08:15 UTC (rev 571)
+++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/impl/JobSchedulerServiceImpl.java 2009-11-11 18:08:57 UTC (rev 572)
@@ -175,6 +175,7 @@
new CronTrigger(jobinfo.getJobName(), jobinfo.getGroupName(), jobinfo.getJobName(), jobinfo.getGroupName(),
exp);
JobDetail job = new JobDetail(jobinfo.getJobName(), jobinfo.getGroupName(), jobinfo.getJob());
+ job.setJobDataMap(jdatamap);
job.setDescription(jobinfo.getDescription());
scheduler_.addJob(job, true);
scheduler_.scheduleJob(trigger);
16 years, 8 months
exo-jcr SVN: r571 - kernel/branches/mc-int-branch/component/common/src/main/java/org/exoplatform/services/scheduler/impl.
by do-not-reply@jboss.org
Author: hung_van
Date: 2009-11-11 13:08:15 -0500 (Wed, 11 Nov 2009)
New Revision: 571
Modified:
kernel/branches/mc-int-branch/component/common/src/main/java/org/exoplatform/services/scheduler/impl/JobSchedulerServiceImpl.java
Log:
JobSchedulerServiceImpl.addCronJob() ignores JobDataMap argument
Modified: kernel/branches/mc-int-branch/component/common/src/main/java/org/exoplatform/services/scheduler/impl/JobSchedulerServiceImpl.java
===================================================================
--- kernel/branches/mc-int-branch/component/common/src/main/java/org/exoplatform/services/scheduler/impl/JobSchedulerServiceImpl.java 2009-11-11 16:15:26 UTC (rev 570)
+++ kernel/branches/mc-int-branch/component/common/src/main/java/org/exoplatform/services/scheduler/impl/JobSchedulerServiceImpl.java 2009-11-11 18:08:15 UTC (rev 571)
@@ -175,6 +175,7 @@
new CronTrigger(jobinfo.getJobName(), jobinfo.getGroupName(), jobinfo.getJobName(), jobinfo.getGroupName(),
exp);
JobDetail job = new JobDetail(jobinfo.getJobName(), jobinfo.getGroupName(), jobinfo.getJob());
+ job.setJobDataMap(jdatamap);
job.setDescription(jobinfo.getDescription());
scheduler_.addJob(job, true);
scheduler_.scheduleJob(trigger);
16 years, 8 months
exo-jcr SVN: r570 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2009-11-11 11:15:26 -0500 (Wed, 11 Nov 2009)
New Revision: 570
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ObservationCacheLoader.java
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java
Log:
EXOJCR-204: Updated test
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ObservationCacheLoader.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ObservationCacheLoader.java 2009-11-11 16:11:07 UTC (rev 569)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ObservationCacheLoader.java 2009-11-11 16:15:26 UTC (rev 570)
@@ -20,8 +20,6 @@
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.core.NamespaceAccessor;
-import org.exoplatform.services.jcr.core.nodetype.NodeTypeData;
-import org.exoplatform.services.jcr.datamodel.InternalQName;
import org.exoplatform.services.jcr.datamodel.ItemData;
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.datamodel.QPath;
@@ -91,7 +89,7 @@
public void put(List<Modification> modifications) throws Exception
{
- // get SessionID from list
+ // TODO: get SessionID from session registry
String userId = "";
// get UserID from list
String sessionId = "";
@@ -116,7 +114,6 @@
if (isItemSubtree(m))
{
ItemData item = getItemData(m);
- // TODO: remove hardcode
if (item != null)
{
int eventType = eventType(m);
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-11 16:11:07 UTC (rev 569)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-11 16:15:26 UTC (rev 570)
@@ -24,7 +24,6 @@
import org.exoplatform.services.jcr.core.nodetype.ItemDefinitionData;
import org.exoplatform.services.jcr.core.nodetype.NodeDefinitionData;
import org.exoplatform.services.jcr.core.nodetype.NodeTypeData;
-import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataImpl;
import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager;
import org.exoplatform.services.jcr.core.nodetype.NodeTypeValue;
import org.exoplatform.services.jcr.core.nodetype.PropertyDefinitionData;
@@ -49,7 +48,6 @@
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -86,7 +84,7 @@
{
super.setUp();
loader = new ObservationCacheLoader();
- registry = new ObservationManagerRegistry(null, null, null,new DummyNodeTypeDataManager());
+ registry = new ObservationManagerRegistry(null, null, null, new DummyNodeTypeDataManager());
workspaceStorageConnection = new DummyWorkspaceStorageConnection();
final Map<String, String> ns = new HashMap<String, String>();
16 years, 8 months
exo-jcr SVN: r569 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/core/query/cacheloader and 1 other directories.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2009-11-11 11:11:07 -0500 (Wed, 11 Nov 2009)
New Revision: 569
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManagerImpl.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java
Log:
EXOJCR-202: IndexerCacheLoaderRuntimeTest added
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManagerImpl.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManagerImpl.java 2009-11-11 15:53:32 UTC (rev 568)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManagerImpl.java 2009-11-11 16:11:07 UTC (rev 569)
@@ -54,6 +54,7 @@
import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePersistentDataManager;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
+import org.jboss.cache.factories.annotations.NonVolatile;
import org.picocontainer.Startable;
import java.io.IOException;
@@ -85,6 +86,7 @@
* @author <a href="karpenko.sergiy(a)gmail.com">Karpenko Sergiy</a>
* @version $Id: SearchManagerImpl.java 111 2008-11-11 11:11:11Z serg $
*/
+@NonVolatile
public class SearchManagerImpl implements SearchManager, Startable, MandatoryItemsPersistenceListener
{
@@ -361,82 +363,85 @@
public void updateIndex(final Set<String> removedNodes, final Set<String> addedNodes) throws RepositoryException,
IOException
{
- Iterator<NodeData> addedStates = new Iterator<NodeData>()
+ if (handler != null)
{
- private final Iterator<String> iter = addedNodes.iterator();
-
- public boolean hasNext()
+ Iterator<NodeData> addedStates = new Iterator<NodeData>()
{
- return iter.hasNext();
- }
+ private final Iterator<String> iter = addedNodes.iterator();
- public NodeData next()
- {
+ public boolean hasNext()
+ {
+ return iter.hasNext();
+ }
- // cycle till find a next or meet the end of set
- do
+ public NodeData next()
{
- String id = iter.next();
- try
+
+ // cycle till find a next or meet the end of set
+ do
{
- ItemData item = itemMgr.getItemData(id);
- if (item != null)
+ String id = iter.next();
+ try
{
- if (item.isNode())
- return (NodeData)item; // return node
+ ItemData item = itemMgr.getItemData(id);
+ if (item != null)
+ {
+ if (item.isNode())
+ return (NodeData)item; // return node
+ else
+ log.warn("Node not found, but property " + id + ", " + item.getQPath().getAsString()
+ + " found. ");
+ }
else
- log.warn("Node not found, but property " + id + ", " + item.getQPath().getAsString()
- + " found. ");
+ log.warn("Unable to index node with id " + id + ", node does not exist.");
+
}
- else
- log.warn("Unable to index node with id " + id + ", node does not exist.");
+ catch (RepositoryException e)
+ {
+ log.error("Can't read next node data " + id, e);
+ }
+ }
+ while (iter.hasNext()); // get next if error or node not found
- }
- catch (RepositoryException e)
- {
- log.error("Can't read next node data " + id, e);
- }
+ return null; // we met the end of iterator set
}
- while (iter.hasNext()); // get next if error or node not found
- return null; // we met the end of iterator set
- }
+ public void remove()
+ {
+ throw new UnsupportedOperationException();
+ }
+ };
- public void remove()
+ Iterator<String> removedIds = new Iterator<String>()
{
- throw new UnsupportedOperationException();
- }
- };
+ private final Iterator<String> iter = removedNodes.iterator();
- Iterator<String> removedIds = new Iterator<String>()
- {
- private final Iterator<String> iter = removedNodes.iterator();
+ public boolean hasNext()
+ {
+ return iter.hasNext();
+ }
- public boolean hasNext()
- {
- return iter.hasNext();
- }
+ public String next()
+ {
+ return nextNodeId();
+ }
- public String next()
- {
- return nextNodeId();
- }
+ public String nextNodeId() throws NoSuchElementException
+ {
+ return iter.next();
+ }
- public String nextNodeId() throws NoSuchElementException
- {
- return iter.next();
- }
+ public void remove()
+ {
+ throw new UnsupportedOperationException();
- public void remove()
+ }
+ };
+
+ if (removedNodes.size() > 0 || addedNodes.size() > 0)
{
- throw new UnsupportedOperationException();
-
+ handler.updateNodes(removedIds, addedStates);
}
- };
-
- if (removedNodes.size() > 0 || addedNodes.size() > 0)
- {
- handler.updateNodes(removedIds, addedStates);
}
}
@@ -510,6 +515,9 @@
try
{
indexingRootData = (NodeData)itemMgr.getItemData(Constants.ROOT_UUID);
+ // indexingRootData =
+ // new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_UUID, 1, Constants.NT_UNSTRUCTURED,
+ // new InternalQName[0], 0, null, new AccessControlList());
}
catch (RepositoryException e)
{
@@ -608,7 +616,6 @@
QueryHandler parentHandler = (this.parentSearchManager != null) ? parentSearchManager.getHandler() : null;
QueryHandlerContext context = createQueryHandlerContext(parentHandler);
handler.init(context);
-
}
catch (SecurityException e)
{
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-11 15:53:32 UTC (rev 568)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-11 16:11:07 UTC (rev 569)
@@ -25,6 +25,7 @@
import org.jboss.cache.CacheException;
import org.jboss.cache.Fqn;
import org.jboss.cache.Modification;
+import org.jboss.cache.factories.annotations.Inject;
import java.util.HashSet;
import java.util.List;
@@ -52,7 +53,8 @@
{
}
- public void registerSearchManager(SearchManager manager)
+ @Inject
+ public void injectDependencies(SearchManager manager)
{
searchManager = manager;
}
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-11 15:53:32 UTC (rev 568)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-11 16:11:07 UTC (rev 569)
@@ -67,7 +67,7 @@
super.setUp();
searchManager = new DummySearchManager();
indexerCacheLoader = new IndexerCacheLoader();
- indexerCacheLoader.registerSearchManager(searchManager);
+ indexerCacheLoader.injectDependencies(searchManager);
}
/**
16 years, 8 months
exo-jcr SVN: r568 - core/trunk.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2009-11-11 10:53:32 -0500 (Wed, 11 Nov 2009)
New Revision: 568
Modified:
core/trunk/pom.xml
Log:
EXOJCR-179 com.sun.tools excluded from dependencies
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2009-11-11 15:39:11 UTC (rev 567)
+++ core/trunk/pom.xml 2009-11-11 15:53:32 UTC (rev 568)
@@ -197,7 +197,13 @@
<groupId>org.htmlparser</groupId>
<artifactId>htmlparser</artifactId>
<version>1.6</version>
- <scope>compile</scope>
+ <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>com.sun</groupId>
+ <artifactId>tools</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
16 years, 8 months
exo-jcr SVN: r567 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2009-11-11 10:39:11 -0500 (Wed, 11 Nov 2009)
New Revision: 567
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java
Log:
EXOJCR-201 : The JDBCCacheLoader and JBossCacheStorageConnection was changed.
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11-11 15:14:43 UTC (rev 566)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11-11 15:39:11 UTC (rev 567)
@@ -64,6 +64,8 @@
*/
private boolean batchStarted = false;
+ private boolean isCommited = false;
+
/**
* JBossCacheStorageConnection constructor.
*
@@ -506,6 +508,7 @@
{
this.cache.endBatch(true); // treePrint(treeRoot);
batchStarted = false;
+ isCommited = true;
}
else
{
@@ -542,7 +545,7 @@
*/
public boolean isOpened()
{
- return true;
+ return !isCommited;
}
/**
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-11 15:14:43 UTC (rev 566)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-11 15:39:11 UTC (rev 567)
@@ -138,7 +138,6 @@
if (jdbcConnection != null) {
jdbcConnection.commit();
-// jdbcConnection.close();
jdbcConnection = null;
}
}
16 years, 8 months