exo-jcr SVN: r3518 - jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2010-11-23 04:11:41 -0500 (Tue, 23 Nov 2010)
New Revision: 3518
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryServiceImpl.java
Log:
JCR-1522: added unregistration of RepositoryContainer on it's removal
Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryServiceImpl.java
===================================================================
--- jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryServiceImpl.java 2010-11-23 09:06:20 UTC (rev 3517)
+++ jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryServiceImpl.java 2010-11-23 09:11:41 UTC (rev 3518)
@@ -240,6 +240,7 @@
repositoryContainer.stop();
repositoryContainers.remove(name);
config.getRepositoryConfigurations().remove(repconfig);
+ parentContainer.unregisterComponentByInstance(repositoryContainer);
}
catch (RepositoryConfigurationException e)
{
15 years, 6 months
exo-jcr SVN: r3517 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl: dataflow/persistent and 1 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-11-23 04:06:20 -0500 (Tue, 23 Nov 2010)
New Revision: 3517
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/BackupWorkspaceInitializer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/FilePersistedValueData.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/cleaner/DBCleanerService.java
Log:
EXOJCR-852: wrap file operation in privileged block
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/BackupWorkspaceInitializer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/BackupWorkspaceInitializer.java 2010-11-23 09:02:57 UTC (rev 3516)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/BackupWorkspaceInitializer.java 2010-11-23 09:06:20 UTC (rev 3517)
@@ -290,9 +290,13 @@
File rDir = new File(restoreDir);
Pattern fullBackupPattern = Pattern.compile(".+\\.0");
- for (File f : rDir.listFiles(new BackupFilesFilter()))
+ for (File f : PrivilegedFileHelper.listFiles(rDir, new BackupFilesFilter()))
+ {
if (fullBackupPattern.matcher(f.getName()).matches() == false)
+ {
list.add(f);
+ }
+ }
return list;
}
@@ -312,11 +316,13 @@
File rDir = new File(restoreDir);
Pattern p = Pattern.compile(".+\\.0");
- for (File f : rDir.listFiles(new BackupFilesFilter()))
+ for (File f : PrivilegedFileHelper.listFiles(rDir, new BackupFilesFilter()))
{
Matcher m = p.matcher(f.getName());
if (m.matches())
+ {
return PrivilegedFileHelper.getAbsolutePath(f);
+ }
}
return null;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/FilePersistedValueData.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/FilePersistedValueData.java 2010-11-23 09:02:57 UTC (rev 3516)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/FilePersistedValueData.java 2010-11-23 09:06:20 UTC (rev 3517)
@@ -264,7 +264,7 @@
if (file != null)
{
// TODO for tests byte[] buf = file.getPath().getBytes("UTF-8");
- byte[] buf = file.getCanonicalPath().getBytes("UTF-8");
+ byte[] buf = PrivilegedFileHelper.getCanonicalPath(file).getBytes("UTF-8");
out.writeInt(buf.length);
out.write(buf);
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/cleaner/DBCleanerService.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/cleaner/DBCleanerService.java 2010-11-23 09:02:57 UTC (rev 3516)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/cleaner/DBCleanerService.java 2010-11-23 09:06:20 UTC (rev 3517)
@@ -16,6 +16,7 @@
*/
package org.exoplatform.services.jcr.impl.util.jdbc.cleaner;
+import org.exoplatform.commons.utils.SecurityHelper;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.config.RepositoryEntry;
import org.exoplatform.services.jcr.config.WorkspaceEntry;
@@ -25,6 +26,7 @@
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
+import java.security.PrivilegedExceptionAction;
import java.sql.Connection;
import java.sql.SQLException;
@@ -101,7 +103,14 @@
Connection conn = null;
try
{
- conn = ds.getConnection();
+ final DataSource fds = ds;
+ conn = SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Connection>()
+ {
+ public Connection run() throws Exception
+ {
+ return fds.getConnection();
+ }
+ });
}
catch (SQLException e)
{
15 years, 6 months
exo-jcr SVN: r3515 - kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-11-23 04:01:30 -0500 (Tue, 23 Nov 2010)
New Revision: 3515
Modified:
kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/PrivilegedFileHelper.java
Log:
EXOJCR-852: add new method listFiles(final File file, final FilenameFilter filter)
Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/PrivilegedFileHelper.java
===================================================================
--- kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/PrivilegedFileHelper.java 2010-11-22 16:14:36 UTC (rev 3514)
+++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/PrivilegedFileHelper.java 2010-11-23 09:01:30 UTC (rev 3515)
@@ -653,6 +653,24 @@
* @param file
* @return
*/
+ public static File[] listFiles(final File file, final FilenameFilter filter)
+ {
+ PrivilegedAction<File[]> action = new PrivilegedAction<File[]>()
+ {
+ public File[] run()
+ {
+ return file.listFiles(filter);
+ }
+ };
+ return AccessController.doPrivileged(action);
+ }
+
+ /**
+ * Get file's list in privileged mode.
+ *
+ * @param file
+ * @return
+ */
public static File[] listFiles(final File file, final FileFilter filter)
{
PrivilegedAction<File[]> action = new PrivilegedAction<File[]>()
@@ -664,5 +682,4 @@
};
return AccessController.doPrivileged(action);
}
-
}
15 years, 6 months
exo-jcr SVN: r3514 - in jcr/branches/1.14-ISPN/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/dataflow/persistent and 3 other directories.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2010-11-22 11:14:36 -0500 (Mon, 22 Nov 2010)
New Revision: 3514
Added:
jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheRefsId.java
Modified:
jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/WorkspaceStorageCache.java
jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java
jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java
jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java
jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
jcr/branches/1.14-ISPN/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java
Log:
EXOJCR-1039: Porting code for storing result of getReferences in the cache made within JCR-1491 and EXOJCR-1029 , into the Infninispan-based classes.
Attention! Please take in to the consideration, that JBoss-related code contains stub methods! For testing purposes only! MODIFICATIONS OF JBC CODE SHOULD NOT BE PORTED INTO THE TRUNK!
Modified: jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/WorkspaceStorageCache.java
===================================================================
--- jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/WorkspaceStorageCache.java 2010-11-22 16:08:28 UTC (rev 3513)
+++ jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/WorkspaceStorageCache.java 2010-11-22 16:14:36 UTC (rev 3514)
@@ -107,6 +107,26 @@
*/
List<PropertyData> listChildProperties(final NodeData parentData);
+ /**
+ * Get referenced properties.
+ *
+ * @param identifier
+ * referenceable id
+ * @return
+ * list of REFERENCE properties.
+ */
+ List<PropertyData> getReferencedProperties(String identifier);
+
+ /**
+ * Add referenced properties.
+ *
+ * @param identifier
+ * referenceable id
+ * @param refProperties
+ * list of properties
+ */
+ void addReferencedProperties(String identifier, List<PropertyData> refProperties);
+
/**
* Adds (or updates if found) ItemData.
*
Modified: jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
===================================================================
--- jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2010-11-22 16:08:28 UTC (rev 3513)
+++ jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2010-11-22 16:14:36 UTC (rev 3514)
@@ -29,12 +29,15 @@
import org.exoplatform.services.jcr.datamodel.PropertyData;
import org.exoplatform.services.jcr.datamodel.QPathEntry;
import org.exoplatform.services.jcr.datamodel.ValueData;
+import org.exoplatform.services.jcr.impl.Constants;
import org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache;
import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder;
import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnection;
import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
import org.exoplatform.services.transaction.TransactionService;
+import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
@@ -99,6 +102,11 @@
*/
static private final int GET_LIST_PROPERTIES = 5;
+ /**
+ * GET_REFERENCES type.
+ */
+ static public final int GET_REFERENCES = 6;
+
/**
* Request type.
*/
@@ -383,6 +391,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public ItemData getItemData(NodeData parentData, QPathEntry name) throws RepositoryException
{
return getItemData(parentData, name, ItemType.UNKNOWN);
@@ -484,7 +493,26 @@
public List<PropertyData> getReferencesData(String identifier, boolean skipVersionStorage)
throws RepositoryException
{
- return super.getReferencesData(identifier, skipVersionStorage);
+ List<PropertyData> props = getReferencedPropertiesData(identifier);
+
+ if (skipVersionStorage)
+ {
+ List<PropertyData> result = new ArrayList<PropertyData>();
+
+ Iterator<PropertyData> iterator = props.iterator();
+ while (iterator.hasNext())
+ {
+ PropertyData prop = iterator.next();
+ if (!prop.getQPath().isDescendantOf(Constants.JCR_VERSION_STORAGE_PATH))
+ {
+ result.add(prop);
+ }
+ }
+
+ return result;
+ }
+
+ return props;
}
/**
@@ -666,6 +694,54 @@
}
}
+ /**
+ * Get referenced properties data.
+ *
+ * @param identifier
+ * referenceable identifier
+ * @return List<PropertyData>
+ * @throws RepositoryException
+ * Repository error
+ */
+ protected List<PropertyData> getReferencedPropertiesData(String identifier) throws RepositoryException
+ {
+ List<PropertyData> refProps = null;
+ if (cache.isEnabled())
+ {
+ refProps = cache.getReferencedProperties(identifier);
+ if (refProps != null)
+ {
+ return refProps;
+ }
+ }
+ final DataRequest request = new DataRequest(identifier, DataRequest.GET_REFERENCES);
+
+ try
+ {
+ request.start();
+ if (cache.isEnabled())
+ {
+ // Try first to get the value from the cache since a
+ // request could have been launched just before
+ refProps = cache.getReferencedProperties(identifier);
+ if (refProps != null)
+ {
+ return refProps;
+ }
+ }
+ refProps = super.getReferencesData(identifier, false);
+ if (cache.isEnabled())
+ {
+ cache.addReferencedProperties(identifier, refProps);
+ }
+ return refProps;
+ }
+ finally
+ {
+ request.done();
+ }
+ }
+
/**
* Get persisted ItemData.
*
Modified: jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java
===================================================================
--- jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java 2010-11-22 16:08:28 UTC (rev 3513)
+++ jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java 2010-11-22 16:14:36 UTC (rev 3514)
@@ -841,6 +841,21 @@
}
}
+ /**
+ * {@inheritDoc}
+ */
+ public List<PropertyData> getReferencedProperties(String identifier)
+ {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addReferencedProperties(String identifier, List<PropertyData> refProperties)
+ {
+ }
+
/**
* {@inheritDoc}
*/
Modified: jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java
===================================================================
--- jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java 2010-11-22 16:08:28 UTC (rev 3513)
+++ jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java 2010-11-22 16:14:36 UTC (rev 3514)
@@ -194,11 +194,14 @@
{
private final Object value;
+ private final boolean forceModify;
+
public AddToListContainer(CacheKey key, Object value, AdvancedCache<Serializable, Object> cache,
- int historicalIndex, boolean local, Boolean allowLocalChanges)
+ boolean forceModify, int historicalIndex, boolean local, Boolean allowLocalChanges)
{
super(key, ChangesType.PUT, cache, historicalIndex, local, allowLocalChanges);
this.value = value;
+ this.forceModify = forceModify;
}
@Override
@@ -211,7 +214,7 @@
Set<Object> newSet = new HashSet<Object>();
// if set found of null, perform add
- if (existingObject instanceof Set || existingObject == null)
+ if (existingObject instanceof Set || (existingObject == null && forceModify))
{
// set found
if (existingObject instanceof Set)
@@ -223,7 +226,7 @@
setCacheLocalMode();
cache.put(key, newSet);
}
- else
+ else if (existingObject != null)
{
LOG.error("Unexpected object found by key " + key.toString() + ". Expected Set, but found:"
+ existingObject.getClass().getName());
@@ -931,11 +934,11 @@
* @param key
* @param value
*/
- public void addToList(CacheKey key, Object value)
+ public void addToList(CacheKey key, Object value, boolean forceModify)
{
CompressedISPNChangesBuffer changesContainer = getChangesBufferSafe();
- changesContainer.add(new AddToListContainer(key, value, parentCache, changesContainer.getHistoryIndex(), local
- .get(), allowLocalChanges));
+ changesContainer.add(new AddToListContainer(key, value, parentCache, forceModify, changesContainer
+ .getHistoryIndex(), local.get(), allowLocalChanges));
}
/**
Added: jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheRefsId.java
===================================================================
--- jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheRefsId.java (rev 0)
+++ jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheRefsId.java 2010-11-22 16:14:36 UTC (rev 3514)
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan;
+
+/**
+ * Created by The eXo Platform SAS
+ *
+ * Date: 10.06.2008
+ *
+ * Cache record used to store item Id key.
+ *
+ * @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter Nedonosko</a>
+ * @version $Id: CachePropsId.java 2845 2010-07-30 13:29:37Z tolusha $
+ */
+public class CacheRefsId extends CacheKey
+{
+
+ public static final String PREFIX = "R";
+
+ CacheRefsId(String id)
+ {
+ super(PREFIX + id);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof CacheRefsId)
+ {
+ CacheRefsId cachePropsId = (CacheRefsId)obj;
+ return (cachePropsId.hash == hash && cachePropsId.id.equals(id));
+ }
+ else
+ {
+ return false;
+ }
+ }
+}
Property changes on: jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheRefsId.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java
===================================================================
--- jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java 2010-11-22 16:08:28 UTC (rev 3513)
+++ jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java 2010-11-22 16:14:36 UTC (rev 3514)
@@ -37,6 +37,7 @@
import org.exoplatform.services.jcr.datamodel.PropertyData;
import org.exoplatform.services.jcr.datamodel.QPath;
import org.exoplatform.services.jcr.datamodel.QPathEntry;
+import org.exoplatform.services.jcr.datamodel.ValueData;
import org.exoplatform.services.jcr.impl.Constants;
import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData;
import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData;
@@ -45,6 +46,7 @@
import org.exoplatform.services.log.Log;
import org.infinispan.Cache;
+import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
@@ -55,6 +57,7 @@
import java.util.NoSuchElementException;
import java.util.Set;
+import javax.jcr.PropertyType;
import javax.jcr.RepositoryException;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
@@ -650,10 +653,10 @@
cache.put(new CacheQPath(node.getParentIdentifier(), node.getQPath(), ItemType.NODE), node.getIdentifier());
// if MODIFY and List present OR FORCE_MODIFY, then write
- if ((modifyListsOfChild == ModifyChildOption.MODIFY && cache.get(new CacheNodesId(node.getParentIdentifier())) != null)
- || modifyListsOfChild == ModifyChildOption.FORCE_MODIFY)
+ if (modifyListsOfChild != ModifyChildOption.NOT_MODIFY)
{
- cache.addToList(new CacheNodesId(node.getParentIdentifier()), node.getIdentifier());
+ cache.addToList(new CacheNodesId(node.getParentIdentifier()), node.getIdentifier(),
+ modifyListsOfChild == ModifyChildOption.FORCE_MODIFY);
}
}
@@ -667,10 +670,10 @@
cache.put(new CacheQPath(node.getParentIdentifier(), node.getQPath(), ItemType.NODE), node.getIdentifier());
// if MODIFY and List present OR FORCE_MODIFY, then write
- if ((modifyListsOfChild == ModifyChildOption.MODIFY && cache.get(new CacheNodesId(node.getParentIdentifier())) != null)
- || modifyListsOfChild == ModifyChildOption.FORCE_MODIFY)
+ if (modifyListsOfChild != ModifyChildOption.NOT_MODIFY)
{
- cache.addToList(new CacheNodesId(node.getParentIdentifier()), node.getIdentifier());
+ cache.addToList(new CacheNodesId(node.getParentIdentifier()), node.getIdentifier(),
+ modifyListsOfChild == ModifyChildOption.FORCE_MODIFY);
}
}
@@ -726,14 +729,38 @@
protected PropertyData putProperty(PropertyData prop, ModifyChildOption modifyListsOfChild)
{
// if MODIFY and List present OR FORCE_MODIFY, then write
- if ((modifyListsOfChild == ModifyChildOption.MODIFY && cache.get(new CachePropsId(prop.getParentIdentifier())) != null)
- || modifyListsOfChild == ModifyChildOption.FORCE_MODIFY)
+ if (modifyListsOfChild != ModifyChildOption.NOT_MODIFY)
{
- cache.addToList(new CachePropsId(prop.getParentIdentifier()), prop.getIdentifier());
+ cache.addToList(new CachePropsId(prop.getParentIdentifier()), prop.getIdentifier(),
+ modifyListsOfChild == ModifyChildOption.FORCE_MODIFY);
}
cache.put(new CacheQPath(prop.getParentIdentifier(), prop.getQPath(), ItemType.PROPERTY), prop.getIdentifier());
+ // add referenced property
+ if (modifyListsOfChild != ModifyChildOption.NOT_MODIFY && prop.getType() == PropertyType.REFERENCE)
+ {
+ List<ValueData> lData = prop.getValues();
+ for (int i = 0, length = lData.size(); i < length; i++)
+ {
+ ValueData vdata = lData.get(i);
+ String nodeIdentifier = null;
+ try
+ {
+ nodeIdentifier = new String(vdata.getAsByteArray(), Constants.DEFAULT_ENCODING);
+ }
+ catch (IllegalStateException e)
+ {
+ // Do nothing. Never happens.
+ }
+ catch (IOException e)
+ {
+ // Do nothing. Never happens.
+ }
+ cache.addToList(new CacheRefsId(nodeIdentifier), prop.getIdentifier(),
+ modifyListsOfChild == ModifyChildOption.FORCE_MODIFY);
+ }
+ }
// NullItemData must never be returned inside internal cache operations.
PropertyData propData = (PropertyData)cache.put(new CacheId(prop.getIdentifier()), prop, true);
return (propData instanceof NullPropertyData) ? null : propData;
@@ -752,6 +779,7 @@
cache.remove(new CachePropsId(item.getIdentifier()));
cache.removeFromList(new CacheNodesId(item.getParentIdentifier()), item.getIdentifier());
+ cache.remove(new CacheRefsId(item.getIdentifier()));
}
else
{
@@ -1003,4 +1031,88 @@
}
}
+ /**
+ * @see org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCache#addReferencedProperties(java.lang.String, java.util.List)
+ */
+ public void addReferencedProperties(String identifier, List<PropertyData> refProperties)
+ {
+ boolean inTransaction = cache.isTransactionActive();
+ try
+ {
+ if (!inTransaction)
+ {
+ cache.beginTransaction();
+ }
+ cache.setLocal(true);
+ // remove previous all (to be sure about consistency)
+ cache.remove(new CacheRefsId(identifier));
+
+ Set<Object> set = new HashSet<Object>();
+ for (PropertyData prop : refProperties)
+ {
+ putProperty(prop, ModifyChildOption.NOT_MODIFY);
+ set.add(prop.getIdentifier());
+ }
+ cache.put(new CacheRefsId(identifier), set);
+ }
+ finally
+ {
+ cache.setLocal(false);
+ if (!inTransaction)
+ {
+ cache.commitTransaction();
+ }
+ }
+ }
+
+ /**
+ * @see org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCache#getReferencedProperties(java.lang.String)
+ */
+ public List<PropertyData> getReferencedProperties(String identifier)
+ {
+ // get list of children uuids
+ final Set<String> set = (Set<String>)cache.get(new CacheRefsId(identifier));
+ if (set != null)
+ {
+ final List<PropertyData> props = new ArrayList<PropertyData>();
+
+ for (String childId : set)
+ {
+ PropertyData prop = (PropertyData)cache.get(new CacheId(childId));
+
+ if (prop == null || prop instanceof NullItemData)
+ {
+ return null;
+ }
+ // add property as many times as has referenced values
+ List<ValueData> lData = prop.getValues();
+ for (int i = 0, length = lData.size(); i < length; i++)
+ {
+ ValueData vdata = lData.get(i);
+ try
+ {
+ if (new String(vdata.getAsByteArray(), Constants.DEFAULT_ENCODING).equals(identifier))
+ {
+ props.add(prop);
+ }
+ }
+ catch (IllegalStateException e)
+ {
+ // property was not added, force read from lower layer
+ return null;
+ }
+ catch (IOException e)
+ {
+ // property was not added, force read from lower layer
+ return null;
+ }
+ }
+ }
+ return props;
+ }
+ else
+ {
+ return null;
+ }
+ }
}
Modified: jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2010-11-22 16:08:28 UTC (rev 3513)
+++ jcr/branches/1.14-ISPN/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2010-11-22 16:14:36 UTC (rev 3514)
@@ -1337,4 +1337,22 @@
}
}
}
+
+ /**
+ * @see org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCache#addReferencedProperties(java.lang.String, java.util.List)
+ */
+ public void addReferencedProperties(String identifier, List<PropertyData> refProperties)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * @see org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCache#getReferencedProperties(java.lang.String)
+ */
+ public List<PropertyData> getReferencedProperties(String identifier)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
Modified: jcr/branches/1.14-ISPN/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java
===================================================================
--- jcr/branches/1.14-ISPN/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java 2010-11-22 16:08:28 UTC (rev 3513)
+++ jcr/branches/1.14-ISPN/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java 2010-11-22 16:14:36 UTC (rev 3514)
@@ -338,6 +338,15 @@
return childProperties;
}
+ public List<PropertyData> getReferencedProperties(String identifier)
+ {
+ return null;
+ }
+
+ public void addReferencedProperties(String identifier, List<PropertyData> refProperties)
+ {
+ }
+
public long getSize()
{
return 0;
15 years, 6 months
exo-jcr SVN: r3513 - in jcr/trunk: exo.jcr.component.ext and 1 other directory.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-11-22 11:08:28 -0500 (Mon, 22 Nov 2010)
New Revision: 3513
Modified:
jcr/trunk/exo.jcr.component.ext/pom.xml
jcr/trunk/pom.xml
Log:
EXOJCR-929: core.database dependency added to ext pom.xml
Modified: jcr/trunk/exo.jcr.component.ext/pom.xml
===================================================================
--- jcr/trunk/exo.jcr.component.ext/pom.xml 2010-11-22 16:03:13 UTC (rev 3512)
+++ jcr/trunk/exo.jcr.component.ext/pom.xml 2010-11-22 16:08:28 UTC (rev 3513)
@@ -1,234 +1,238 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.exoplatform.jcr</groupId>
- <artifactId>jcr-parent</artifactId>
- <version>1.14.0-CR1-SNAPSHOT</version>
- </parent>
- <artifactId>exo.jcr.component.ext</artifactId>
- <name>eXo JCR :: Component :: Extension Service</name>
- <description>eXo JCR Services extension</description>
- <dependencies>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.commons</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.container</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.component.command</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.commons.test</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.core</groupId>
- <artifactId>exo.core.component.document</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.core</groupId>
- <artifactId>exo.core.component.organization.api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.core</groupId>
- <artifactId>exo.core.component.security.core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.jcr</groupId>
- <artifactId>exo.jcr.component.core</artifactId>
- <exclusions>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xerces</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.core</groupId>
- <artifactId>exo.core.component.script.groovy</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>exo.ws.rest.core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>exo.ws.rest.ext</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>exo.ws.commons</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>exo.ws.frameworks.json</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.jcr</groupId>
- <artifactId>jcr</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.annotation</groupId>
- <artifactId>jsr250-api</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-chain</groupId>
- <artifactId>commons-chain</artifactId>
- </dependency>
- <dependency>
- <groupId>jgroups</groupId>
- <artifactId>jgroups</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.ws.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- </dependency>
- <dependency>
- <groupId>picocontainer</groupId>
- <artifactId>picocontainer</artifactId>
- </dependency>
- <dependency>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.xml.stream</groupId>
- <artifactId>stax-api</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- </dependency>
-
- <dependency>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <testResources>
- <testResource>
- <directory>src/test/resources</directory>
- <includes>
- <include>**/*.pdf</include>
- <include>**/*.xml</include>
- <include>**/*.xls</include>
- <include>**/*.groovy</include>
- <include>**/login.conf</include>
- </includes>
- </testResource>
- </testResources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifest>
- <addClasspath>true</addClasspath>
- </manifest>
- </archive>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <argLine>${env.MAVEN_OPTS} -Djava.security.manager=org.exoplatform.commons.test.TestSecurityManager -Djava.security.policy=${project.build.directory}/test-classes/test.policy</argLine>
- <includes>
- <include>**/actions/*Test.java</include>
- <include>**/metadata/*Test.java</include>
- <include>**/owner/*Test.java</include>
- <include>**/registry/*Test.java</include>
- <include>**/app/*Test.java</include>
- <include>**/resource/*Test.java</include>
- <include>**/groovy/*Test.java</include>
- <include>**/replication/*.java</include>
- <include>**/replication/external/*.java</include>
- <include>**/replication/async/**/*.java</include>
- </includes>
- <excludes>
- <exclude>**/BaseStandaloneTest.java</exclude>
- <exclude>**/replication/*.java</exclude>
- <exclude>**/replication/external/*.java</exclude>
- <exclude>**/replication/external/BaseTestCaseChecker.java</exclude>
- <exclude>**/access/*.java</exclude>
- <exclude>**/LocalStorageMultithreadTest.java</exclude>
- </excludes>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>prepare-test-policy</id>
- <phase>process-test-resources</phase>
- <configuration>
- <tasks>
- <echo>Creating Access Policy for tests</echo>
- <makeurl file="${settings.localRepository}" property="localRepositoryURL" />
- <makeurl file="${project.build.outputDirectory}" property="outputDirectoryURL" />
- <makeurl file="${project.build.testOutputDirectory}" property="testOutputDirectoryURL" />
- <copy todir="${project.build.testOutputDirectory}" overwrite="true">
- <fileset dir="${project.basedir}/src/test/resources/">
- <include name="test.policy" />
- </fileset>
- <filterset>
- <filter token="MAVEN_REPO" value="${localRepositoryURL}" />
- <filter token="MAIN_CLASSES" value="${outputDirectoryURL}" />
- <filter token="TEST_CLASSES" value="${testOutputDirectoryURL}" />
- </filterset>
- </copy>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant-optional</artifactId>
- <version>1.5.3-1</version>
- </dependency>
- </dependencies>
- </plugin>
- </plugins>
- </build>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>jcr-parent</artifactId>
+ <version>1.14.0-CR1-SNAPSHOT</version>
+ </parent>
+ <artifactId>exo.jcr.component.ext</artifactId>
+ <name>eXo JCR :: Component :: Extension Service</name>
+ <description>eXo JCR Services extension</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.commons</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.container</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.command</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.commons.test</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.core</groupId>
+ <artifactId>exo.core.component.database</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.core</groupId>
+ <artifactId>exo.core.component.document</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.core</groupId>
+ <artifactId>exo.core.component.organization.api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.core</groupId>
+ <artifactId>exo.core.component.security.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.component.core</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xerces</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.core</groupId>
+ <artifactId>exo.core.component.script.groovy</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.rest.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.rest.ext</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.commons</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.frameworks.json</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.jcr</groupId>
+ <artifactId>jcr</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-chain</groupId>
+ <artifactId>commons-chain</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jgroups</groupId>
+ <artifactId>jgroups</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>jsr311-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>picocontainer</groupId>
+ <artifactId>picocontainer</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <includes>
+ <include>**/*.pdf</include>
+ <include>**/*.xml</include>
+ <include>**/*.xls</include>
+ <include>**/*.groovy</include>
+ <include>**/login.conf</include>
+ </includes>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <addClasspath>true</addClasspath>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <argLine>${env.MAVEN_OPTS} -Djava.security.manager=org.exoplatform.commons.test.TestSecurityManager -Djava.security.policy=${project.build.directory}/test-classes/test.policy</argLine>
+ <includes>
+ <include>**/actions/*Test.java</include>
+ <include>**/metadata/*Test.java</include>
+ <include>**/owner/*Test.java</include>
+ <include>**/registry/*Test.java</include>
+ <include>**/app/*Test.java</include>
+ <include>**/resource/*Test.java</include>
+ <include>**/groovy/*Test.java</include>
+ <include>**/replication/*.java</include>
+ <include>**/replication/external/*.java</include>
+ <include>**/replication/async/**/*.java</include>
+ </includes>
+ <excludes>
+ <exclude>**/BaseStandaloneTest.java</exclude>
+ <exclude>**/replication/*.java</exclude>
+ <exclude>**/replication/external/*.java</exclude>
+ <exclude>**/replication/external/BaseTestCaseChecker.java</exclude>
+ <exclude>**/access/*.java</exclude>
+ <exclude>**/LocalStorageMultithreadTest.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>prepare-test-policy</id>
+ <phase>process-test-resources</phase>
+ <configuration>
+ <tasks>
+ <echo>Creating Access Policy for tests</echo>
+ <makeurl file="${settings.localRepository}" property="localRepositoryURL" />
+ <makeurl file="${project.build.outputDirectory}" property="outputDirectoryURL" />
+ <makeurl file="${project.build.testOutputDirectory}" property="testOutputDirectoryURL" />
+ <copy todir="${project.build.testOutputDirectory}" overwrite="true">
+ <fileset dir="${project.basedir}/src/test/resources/">
+ <include name="test.policy" />
+ </fileset>
+ <filterset>
+ <filter token="MAVEN_REPO" value="${localRepositoryURL}" />
+ <filter token="MAIN_CLASSES" value="${outputDirectoryURL}" />
+ <filter token="TEST_CLASSES" value="${testOutputDirectoryURL}" />
+ </filterset>
+ </copy>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-optional</artifactId>
+ <version>1.5.3-1</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Modified: jcr/trunk/pom.xml
===================================================================
--- jcr/trunk/pom.xml 2010-11-22 16:03:13 UTC (rev 3512)
+++ jcr/trunk/pom.xml 2010-11-22 16:08:28 UTC (rev 3513)
@@ -1,473 +1,478 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.exoplatform</groupId>
- <artifactId>foundation-parent</artifactId>
- <version>7</version>
- </parent>
-
- <groupId>org.exoplatform.jcr</groupId>
- <artifactId>jcr-parent</artifactId>
- <version>1.14.0-CR1-SNAPSHOT</version>
- <packaging>pom</packaging>
- <name>eXo JCR</name>
-
- <scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/trunk</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr/trunk</developerConnection>
- <url>http://fisheye.jboss.org/browse/exo-jcr/jcr/trunk</url>
- </scm>
-
- <properties>
- <exo.product.name>exo-jcr</exo.product.name>
- <exo.product.specification>1.14</exo.product.specification>
- <org.exoplatform.kernel.version>2.3.0-CR1-SNAPSHOT</org.exoplatform.kernel.version>
- <org.exoplatform.core.version>2.4.0-CR1-SNAPSHOT</org.exoplatform.core.version>
- <org.exoplatform.ws.version>2.2.0-CR1-SNAPSHOT</org.exoplatform.ws.version>
- <org.exoplatform.doc-style.version>1</org.exoplatform.doc-style.version>
- </properties>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.commons</artifactId>
- <version>${org.exoplatform.kernel.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.commons.test</artifactId>
- <version>${org.exoplatform.kernel.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.component.command</artifactId>
- <version>${org.exoplatform.kernel.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.container</artifactId>
- <version>${org.exoplatform.kernel.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.component.common</artifactId>
- <version>${org.exoplatform.kernel.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.component.cache</artifactId>
- <version>${org.exoplatform.kernel.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.core</groupId>
- <artifactId>exo.core.component.document</artifactId>
- <version>${org.exoplatform.core.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.core</groupId>
- <artifactId>exo.core.component.organization.api</artifactId>
- <version>${org.exoplatform.core.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.core</groupId>
- <artifactId>exo.core.component.security.core</artifactId>
- <version>${org.exoplatform.core.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.core</groupId>
- <artifactId>exo.core.component.script.groovy</artifactId>
- <version>${org.exoplatform.core.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>exo.ws.rest.core</artifactId>
- <version>${org.exoplatform.ws.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>exo.ws.rest.ext</artifactId>
- <version>${org.exoplatform.ws.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>exo.ws.commons</artifactId>
- <version>${org.exoplatform.ws.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>exo.ws.frameworks.json</artifactId>
- <version>${org.exoplatform.ws.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>exo.ws.frameworks.servlet</artifactId>
- <version>${org.exoplatform.ws.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.jcr</groupId>
- <artifactId>exo.jcr.component.ext</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.jcr</groupId>
- <artifactId>exo.jcr.component.core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.jcr</groupId>
- <artifactId>exo.jcr.framework.command</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.jcr</groupId>
- <artifactId>exo.jcr.component.ftp</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.jcr</groupId>
- <artifactId>exo.jcr.component.webdav</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.jcr</groupId>
- <artifactId>exo.jcr.framework.web</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.jcr</groupId>
- <artifactId>exo.jcr.framework.ftpclient</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.jcr</groupId>
- <artifactId>exo.jcr.cluster.testclient</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.jcr</groupId>
- <artifactId>exo.jcr.applications.fckeditor</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.jcr</groupId>
- <artifactId>exo.jcr.applications.browser</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.jcr</groupId>
- <artifactId>exo.jcr.applications.rest</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.jcr</groupId>
- <artifactId>exo.jcr.connectors.localadapter</artifactId>
- <type>rar</type>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.4</version>
- </dependency>
- <dependency>
- <groupId>commons-chain</groupId>
- <artifactId>commons-chain</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>org.jibx</groupId>
- <artifactId>jibx-run</artifactId>
- <version>1.2.1</version>
- </dependency>
- <dependency>
- <groupId>picocontainer</groupId>
- <artifactId>picocontainer</artifactId>
- <version>1.1</version>
- </dependency>
- <dependency>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- <version>1.0.b2</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.5.8</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.5.8</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- <version>1.0.1</version>
- </dependency>
- <dependency>
- <groupId>javax.jcr</groupId>
- <artifactId>jcr</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- </dependency>
- <dependency>
- <groupId>javax.annotation</groupId>
- <artifactId>jsr250-api</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>javax.ws.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- <version>1.0.1B</version>
- </dependency>
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- <version>1.5</version>
- </dependency>
- <dependency>
- <groupId>jtidy</groupId>
- <artifactId>jtidy</artifactId>
- <version>4aug2000r7-dev</version>
- </dependency>
- <dependency>
- <groupId>org.apache.lucene</groupId>
- <artifactId>lucene-core</artifactId>
- <version>2.4.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.lucene</groupId>
- <artifactId>lucene-spellchecker</artifactId>
- <version>2.4.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.lucene</groupId>
- <artifactId>lucene-memory</artifactId>
- <version>2.4.1</version>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.stream</groupId>
- <artifactId>sjsxp</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>commons-dbcp</groupId>
- <artifactId>commons-dbcp</artifactId>
- <version>1.2.2</version>
- <exclusions>
- <exclusion>
- <groupId>commons-pool</groupId>
- <artifactId>commons-pool</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>commons-pool</groupId>
- <artifactId>commons-pool</artifactId>
- <version>1.5.4</version>
- </dependency>
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- <version>1.8.0</version>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1</version>
- </dependency>
- <dependency>
- <groupId>javax.xml.stream</groupId>
- <artifactId>stax-api</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>xpp3</groupId>
- <artifactId>xpp3</artifactId>
- <version>1.1.3.4.O</version>
- </dependency>
- <dependency>
- <groupId>concurrent</groupId>
- <artifactId>concurrent</artifactId>
- <version>1.3.4</version>
- </dependency>
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>3.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ws.commons</groupId>
- <artifactId>ws-commons-util</artifactId>
- <version>1.0.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jackrabbit</groupId>
- <artifactId>jackrabbit-jcr-tests</artifactId>
- <version>1.6.0</version>
- <classifier>sources</classifier>
- </dependency>
- <dependency>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- <version>1.8.0.7</version>
- </dependency>
- <dependency>
- <groupId>jgroups</groupId>
- <artifactId>jgroups</artifactId>
- <version>2.6.13.GA</version>
- </dependency>
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <version>1.2.1</version>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- <version>2.1.7</version>
- </dependency>
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector</artifactId>
- <version>1.5</version>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>1.3</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.cache</groupId>
- <artifactId>jbosscache-core</artifactId>
- <version>3.2.6.GA</version>
- </dependency>
- <dependency>
- <groupId>jboss.jbossts</groupId>
- <artifactId>jbossjts</artifactId>
- <version>4.6.1.GA</version>
- </dependency>
- <dependency>
- <groupId>jboss.jbossts</groupId>
- <artifactId>jbossts-common</artifactId>
- <version>4.6.1.GA</version>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjrt</artifactId>
- <version>1.6.8</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <build>
- <resources>
- <resource>
- <directory>src/main/java</directory>
- <includes>
- <include>**/*.xml</include>
- <include>**/*.xsl</include>
- <include>**/*.properties</include>
- <include>**/*.ion</include>
- <include>**/*.conf</include>
- <include>**/*.config</include>
- </includes>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- <includes>
- <include>**/*.xml</include>
- <include>**/*.xsl</include>
- <include>**/*.properties</include>
- <include>**/login.conf</include>
- <include>**/*.ion</include>
- <include>**/*.conf</include>
- <include>**/*.config</include>
- </includes>
- </resource>
- </resources>
- <testResources>
- <testResource>
- <directory>src/test/java</directory>
- <includes>
- <include>**/*.properties</include>
- <include>**/*.xml</include>
- <include>**/*.txt</include>
- <include>**/*.conf</include>
- <include>**/*.config</include>
- </includes>
- </testResource>
- <testResource>
- <directory>src/test/resources</directory>
- <includes>
- <include>**/*.properties</include>
- <include>**/*.xml</include>
- <include>**/*.txt</include>
- <include>**/*.conf</include>
- <include>**/*.config</include>
- </includes>
- </testResource>
- </testResources>
- </build>
- <modules>
- <module>exo.jcr.component.core</module>
- <module>exo.jcr.component.statistics</module>
- <module>exo.jcr.component.ext</module>
- <module>exo.jcr.component.ftp</module>
- <module>exo.jcr.component.webdav</module>
- <module>exo.jcr.connectors.localadapter</module>
- <module>exo.jcr.framework.command</module>
- <module>exo.jcr.framework.web</module>
- <module>exo.jcr.framework.ftpclient</module>
- <module>applications</module>
- <module>exo.jcr.docs</module>
- <module>packaging/module</module>
- </modules>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.exoplatform</groupId>
+ <artifactId>foundation-parent</artifactId>
+ <version>7</version>
+ </parent>
+
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>jcr-parent</artifactId>
+ <version>1.14.0-CR1-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>eXo JCR</name>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/trunk</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr/trunk</developerConnection>
+ <url>http://fisheye.jboss.org/browse/exo-jcr/jcr/trunk</url>
+ </scm>
+
+ <properties>
+ <exo.product.name>exo-jcr</exo.product.name>
+ <exo.product.specification>1.14</exo.product.specification>
+ <org.exoplatform.kernel.version>2.3.0-CR1-SNAPSHOT</org.exoplatform.kernel.version>
+ <org.exoplatform.core.version>2.4.0-CR1-SNAPSHOT</org.exoplatform.core.version>
+ <org.exoplatform.ws.version>2.2.0-CR1-SNAPSHOT</org.exoplatform.ws.version>
+ <org.exoplatform.doc-style.version>1</org.exoplatform.doc-style.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.commons</artifactId>
+ <version>${org.exoplatform.kernel.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.commons.test</artifactId>
+ <version>${org.exoplatform.kernel.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.command</artifactId>
+ <version>${org.exoplatform.kernel.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.container</artifactId>
+ <version>${org.exoplatform.kernel.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.common</artifactId>
+ <version>${org.exoplatform.kernel.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.cache</artifactId>
+ <version>${org.exoplatform.kernel.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.core</groupId>
+ <artifactId>exo.core.component.database</artifactId>
+ <version>${org.exoplatform.core.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.core</groupId>
+ <artifactId>exo.core.component.document</artifactId>
+ <version>${org.exoplatform.core.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.core</groupId>
+ <artifactId>exo.core.component.organization.api</artifactId>
+ <version>${org.exoplatform.core.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.core</groupId>
+ <artifactId>exo.core.component.security.core</artifactId>
+ <version>${org.exoplatform.core.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.core</groupId>
+ <artifactId>exo.core.component.script.groovy</artifactId>
+ <version>${org.exoplatform.core.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.rest.core</artifactId>
+ <version>${org.exoplatform.ws.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.rest.ext</artifactId>
+ <version>${org.exoplatform.ws.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.commons</artifactId>
+ <version>${org.exoplatform.ws.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.frameworks.json</artifactId>
+ <version>${org.exoplatform.ws.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.frameworks.servlet</artifactId>
+ <version>${org.exoplatform.ws.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.component.ext</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.component.core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.framework.command</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.component.ftp</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.component.webdav</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.framework.web</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.framework.ftpclient</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.cluster.testclient</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.applications.fckeditor</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.applications.browser</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.applications.rest</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.connectors.localadapter</artifactId>
+ <type>rar</type>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-chain</groupId>
+ <artifactId>commons-chain</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jibx</groupId>
+ <artifactId>jibx-run</artifactId>
+ <version>1.2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>picocontainer</groupId>
+ <artifactId>picocontainer</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ <version>1.0.b2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.5.8</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.5.8</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.jcr</groupId>
+ <artifactId>jcr</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>jsr311-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ <version>1.0.1B</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ <version>1.5</version>
+ </dependency>
+ <dependency>
+ <groupId>jtidy</groupId>
+ <artifactId>jtidy</artifactId>
+ <version>4aug2000r7-dev</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.lucene</groupId>
+ <artifactId>lucene-core</artifactId>
+ <version>2.4.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.lucene</groupId>
+ <artifactId>lucene-spellchecker</artifactId>
+ <version>2.4.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.lucene</groupId>
+ <artifactId>lucene-memory</artifactId>
+ <version>2.4.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.stream</groupId>
+ <artifactId>sjsxp</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-dbcp</groupId>
+ <artifactId>commons-dbcp</artifactId>
+ <version>1.2.2</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-pool</groupId>
+ <artifactId>commons-pool</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>commons-pool</groupId>
+ <artifactId>commons-pool</artifactId>
+ <version>1.5.4</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.8.0</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>xpp3</groupId>
+ <artifactId>xpp3</artifactId>
+ <version>1.1.3.4.O</version>
+ </dependency>
+ <dependency>
+ <groupId>concurrent</groupId>
+ <artifactId>concurrent</artifactId>
+ <version>1.3.4</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ws.commons</groupId>
+ <artifactId>ws-commons-util</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jackrabbit</groupId>
+ <artifactId>jackrabbit-jcr-tests</artifactId>
+ <version>1.6.0</version>
+ <classifier>sources</classifier>
+ </dependency>
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>1.8.0.7</version>
+ </dependency>
+ <dependency>
+ <groupId>jgroups</groupId>
+ <artifactId>jgroups</artifactId>
+ <version>2.6.13.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <version>1.2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.1.7</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector</artifactId>
+ <version>1.5</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ <version>3.2.6.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>jboss.jbossts</groupId>
+ <artifactId>jbossjts</artifactId>
+ <version>4.6.1.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>jboss.jbossts</groupId>
+ <artifactId>jbossts-common</artifactId>
+ <version>4.6.1.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>1.6.8</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.xsl</include>
+ <include>**/*.properties</include>
+ <include>**/*.ion</include>
+ <include>**/*.conf</include>
+ <include>**/*.config</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.xsl</include>
+ <include>**/*.properties</include>
+ <include>**/login.conf</include>
+ <include>**/*.ion</include>
+ <include>**/*.conf</include>
+ <include>**/*.config</include>
+ </includes>
+ </resource>
+ </resources>
+ <testResources>
+ <testResource>
+ <directory>src/test/java</directory>
+ <includes>
+ <include>**/*.properties</include>
+ <include>**/*.xml</include>
+ <include>**/*.txt</include>
+ <include>**/*.conf</include>
+ <include>**/*.config</include>
+ </includes>
+ </testResource>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <includes>
+ <include>**/*.properties</include>
+ <include>**/*.xml</include>
+ <include>**/*.txt</include>
+ <include>**/*.conf</include>
+ <include>**/*.config</include>
+ </includes>
+ </testResource>
+ </testResources>
+ </build>
+ <modules>
+ <module>exo.jcr.component.core</module>
+ <module>exo.jcr.component.statistics</module>
+ <module>exo.jcr.component.ext</module>
+ <module>exo.jcr.component.ftp</module>
+ <module>exo.jcr.component.webdav</module>
+ <module>exo.jcr.connectors.localadapter</module>
+ <module>exo.jcr.framework.command</module>
+ <module>exo.jcr.framework.web</module>
+ <module>exo.jcr.framework.ftpclient</module>
+ <module>applications</module>
+ <module>exo.jcr.docs</module>
+ <module>packaging/module</module>
+ </modules>
+</project>
15 years, 6 months
exo-jcr SVN: r3512 - in jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository: creation and 1 other directory.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-11-22 11:03:13 -0500 (Mon, 22 Nov 2010)
New Revision: 3512
Added:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationException.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationService.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java
Log:
EXOJCR-929: RepositoryCreationServiceImpl partial implementation added
Added: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationException.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationException.java (rev 0)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationException.java 2010-11-22 16:03:13 UTC (rev 3512)
@@ -0,0 +1,46 @@
+/*
+ * 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.jcr.ext.repository.creation;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date:
+ *
+ * @author <a href="karpenko.sergiy(a)gmail.com">Karpenko Sergiy</a>
+ * @version $Id: RepositoryCreationException.java 111 2008-11-11 11:11:11Z serg $
+ */
+public class RepositoryCreationException extends Exception
+{
+
+ /**
+ * {@inheritDoc}
+ */
+ public RepositoryCreationException(String message)
+ {
+ super(message);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public RepositoryCreationException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+}
Added: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationService.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationService.java (rev 0)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationService.java 2010-11-22 16:03:13 UTC (rev 3512)
@@ -0,0 +1,107 @@
+/*
+ * 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.jcr.ext.repository.creation;
+
+import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
+import org.exoplatform.services.jcr.config.RepositoryEntry;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date:
+ *
+ * @author <a href="karpenko.sergiy(a)gmail.com">Karpenko Sergiy</a>
+ * @version $Id: RepositoryCreationService.java 111 2008-11-11 11:11:11Z serg $
+ */
+public interface RepositoryCreationService
+{
+ /**
+ * Reserves, validates and creates repository in a simplified form.
+ *
+ * 1. check possibility to create repository locally
+ * - check existing, pending repository and datasources with same names
+ * 2. reserve name and put additional information (ex. ip and port of current machine)
+ * 3. check possibility to create repository on others nodes
+ * - sending to all cluster nodes information about new repository and waiting for answers
+ * - all cluster nodes receive information and check possibility to create repository locally
+ * - send response
+ * 4. reserve name on all nodes of cluster
+ * 6. Check that name is reserved
+ * 7. Create repository locally from backup
+ * - create related DB
+ * - bind datasources
+ * - restore repository from backup (in synchronous mode)
+ * 8. If need to do the same in cluster then send requests to others cluster nodes to create repository and waits for responses
+ * 9. On each others cluster nodes:
+ * - bind datasources
+ * - start repository
+ * - send response
+ * 10. Release lock (unreserve name)
+
+ * @param rEntry
+ * @param backupId
+ * @throws RepositoryCreationServiceException
+ * if some exception occurred during repository creation or repository name is absent in reserved list
+ */
+ void createRepository(String backupId, RepositoryEntry rEntry) throws RepositoryConfigurationException,
+ RepositoryCreationException;
+
+ /**
+ * Reserve repository name to prevent repository creation with same name from other place in same time
+ * via this service.
+ *
+ * 1. check possibility to create repository locally
+ * - check existing, pending repository and datasources with same names
+ * 2. reserve name and put additional information (repository name token)
+ * 3. check possibility to create repository on others nodes
+ * - sending to all cluster nodes information about new repository and waiting for answers
+ * - all cluster nodes receive information and check possibility to create repository locally
+ * - send response
+ * 4. reserve name on all nodes of cluster
+ *
+ * @param repositoryName
+ * @return repository token. Anyone obtaining a token can later create a repository of reserved name.
+ * @throws RepositoryCreationServiceException
+ * if can't reserve name
+ */
+ String reserveRepositoryName(String repositoryName) throws RepositoryCreationException;
+
+ /**
+ * Creates repository, using token of already reserved repository name. Good for cases, when repository creation should be delayed or
+ * made asynchronously in dedicated thread.
+ *
+ * 1. Check that name is reserved
+ * 2. Create repository locally from backup
+ * - create related DB
+ * - bind datasources
+ * - restore repository from backup (in synchronous mode)
+ * 3. If need to do the same in cluster then send requests to others cluster nodes to create repository and waits for responses
+ * 4. On each others cluster nodes:
+ * - bind datasources
+ * - start repository
+ * - send response
+ * 5. Release lock (unreserve name)
+ *
+ * @param rEntry
+ * @param backupId
+ * @param rToken
+ * @throws RepositoryCreationServiceException
+ * if some exception occurred during repository creation or repository name is absent in reserved list
+ */
+ void createRepository(String backupId, RepositoryEntry rEntry, String rToken)
+ throws RepositoryConfigurationException, RepositoryCreationException;
+}
Added: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java (rev 0)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2010-11-22 16:03:13 UTC (rev 3512)
@@ -0,0 +1,236 @@
+/*
+ * 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.jcr.ext.repository.creation;
+
+import org.exoplatform.services.database.creator.DBConnectionInfo;
+import org.exoplatform.services.database.creator.DBCreator;
+import org.exoplatform.services.database.creator.DBCreatorException;
+import org.exoplatform.services.jcr.RepositoryService;
+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.ext.backup.BackupConfigurationException;
+import org.exoplatform.services.jcr.ext.backup.BackupManager;
+import org.exoplatform.services.jcr.ext.backup.BackupOperationException;
+import org.exoplatform.services.jcr.ext.backup.RepositoryBackupChainLog;
+import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.exoplatform.services.naming.InitialContextInitializer;
+import org.exoplatform.services.rpc.RPCService;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.jcr.RepositoryException;
+import javax.naming.NamingException;
+import javax.sql.DataSource;
+import javax.xml.stream.XMLStreamException;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date:
+ *
+ * @author <a href="karpenko.sergiy(a)gmail.com">Karpenko Sergiy</a>
+ * @version $Id: RepositoryCreationServiceImpl.java 111 2008-11-11 11:11:11Z serg $
+ */
+public class RepositoryCreationServiceImpl implements RepositoryCreationService
+{
+ /**
+ * The logger.
+ */
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.RepositoryCreationSynchronizer");
+
+ private final RepositoryService repositoryService;
+
+ /**
+ * The RPC Service used to communicate with other nodes
+ */
+ private final RPCService rpcService;
+
+ private final BackupManager backupManager;
+
+ private final DBCreator dbCreator;
+
+ private final InitialContextInitializer initialContextInitializer;
+
+ private final Set<String> pendingRepositories = new HashSet<String>();
+
+ public RepositoryCreationServiceImpl(RepositoryService repositoryService, BackupManager backupManager,
+ DBCreator dbCreator, InitialContextInitializer initialContextInitializer, final RPCService rpcService)
+ {
+ this.repositoryService = repositoryService;
+ this.backupManager = backupManager;
+ this.rpcService = rpcService;
+ this.dbCreator = dbCreator;
+ this.initialContextInitializer = initialContextInitializer;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void createRepository(String backupId, RepositoryEntry rEntry) throws RepositoryConfigurationException,
+ RepositoryCreationException
+ {
+ // TODO Auto-generated method stub
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void createRepository(String backupId, RepositoryEntry rEntry, String rToken)
+ throws RepositoryConfigurationException, RepositoryCreationException
+ {
+ // check does token registered
+ if (!this.pendingRepositories.contains(rToken))
+ {
+ throw new RepositoryCreationException("Token " + rToken + " does not registered.");
+ }
+
+ // Prepare list of datasource names that must be binded to newly created databases.
+ Set<String> dataSourceNames = new HashSet<String>();
+ for (WorkspaceEntry wsEntry : rEntry.getWorkspaceEntries())
+ {
+
+ boolean isMultiDB =
+ Boolean.parseBoolean(wsEntry.getContainer().getParameterValue(JDBCWorkspaceDataContainer.MULTIDB));
+ String dbSourceName = wsEntry.getContainer().getParameterValue(JDBCWorkspaceDataContainer.SOURCE_NAME);
+
+ if (isMultiDB && dataSourceNames.contains(dbSourceName))
+ {
+ throw new RepositoryCreationException("RepositoryEntry for new " + rToken
+ + " repository contains workspaces that marked as multiDB but have same datasource " + dbSourceName
+ + ".");
+ }
+
+ try
+ {
+ DataSource ds = (DataSource)initialContextInitializer.getInitialContext().lookup(dbSourceName);
+ if (ds != null)
+ {
+ throw new RepositoryConfigurationException("RepositoryEntry for new " + rToken
+ + " repository contains already bibded datasource " + dbSourceName + ".");
+ }
+ }
+ catch (NamingException e)
+ {
+ throw new RepositoryConfigurationException(e.getMessage(), e);
+ }
+
+ dataSourceNames.add(dbSourceName);
+ }
+
+ // create and bind related database to each datasource name
+ for (String dataSource : dataSourceNames)
+ {
+ // 1) create related DB
+ Map<String, String> refAddr = new HashMap<String, String>();
+ try
+ {
+ DBConnectionInfo dbConnectionInfo = dbCreator.createDatabase(rToken + "_" + dataSource);
+ refAddr.put("driverClassName", dbConnectionInfo.getDriver());
+ refAddr.put("url", dbConnectionInfo.getUrl());
+ refAddr.put("username", dbConnectionInfo.getUsername());
+ refAddr.put("password", dbConnectionInfo.getPassword());
+ }
+ catch (DBCreatorException e)
+ {
+ throw new RepositoryCreationException("Can not create new database for " + rToken + " repository.", e);
+ }
+
+ // 2) bind data-source
+ try
+ {
+ //bind new data-source
+ initialContextInitializer.bind(dataSource, "javax.sql.DataSource",
+ "org.apache.commons.dbcp.BasicDataSourceFactory", null, refAddr);
+ }
+ catch (NamingException e)
+ {
+ throw new RepositoryCreationException(e.getMessage(), e);
+ }
+ catch (FileNotFoundException e)
+ {
+ throw new RepositoryCreationException(e.getMessage(), e);
+ }
+ catch (XMLStreamException e)
+ {
+ throw new RepositoryCreationException(e.getMessage(), e);
+ }
+ }
+
+ //3) restore repository from backup
+ RepositoryBackupChainLog backupChain = null;
+ for (RepositoryBackupChainLog chainLog : backupManager.getRepositoryBackupsLogs())
+ {
+ if (chainLog.getBackupId().equals(backupId))
+ {
+ backupChain = chainLog;
+ break;
+ }
+ }
+
+ if (backupChain == null)
+ {
+ throw new RepositoryCreationException("BackupChain by id " + backupId + " does not exists.");
+ }
+
+ File backLog = new File(backupChain.getLogFilePath());
+ if (backLog != null && backLog.exists())
+ {
+ try
+ {
+ backupManager.restore(backupChain, rEntry, false);
+ }
+ catch (BackupOperationException e)
+ {
+ throw new RepositoryCreationException(e.getLocalizedMessage(), e);
+ }
+ catch (BackupConfigurationException e)
+ {
+ throw new RepositoryCreationException(e.getLocalizedMessage(), e);
+ }
+ catch (RepositoryException e)
+ {
+ throw new RepositoryCreationException(e.getLocalizedMessage(), e);
+ }
+ }
+ else
+ {
+ throw new RepositoryCreationException("Backup log file by id " + backupId
+ + (backLog != null ? (" and file path=" + backLog.getAbsolutePath()) : "") + " do not exists.");
+ }
+ //TODO execute "clone repository" on other cluster nodes
+ // release tokens
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String reserveRepositoryName(String repositoryName) throws RepositoryCreationException
+ {
+ pendingRepositories.add(repositoryName);
+ //TODO notify all cluster-nodes that repositoryName is reserved
+ return repositoryName;
+ }
+
+}
15 years, 6 months
exo-jcr SVN: r3511 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-11-22 07:50:14 -0500 (Mon, 22 Nov 2010)
New Revision: 3511
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataHierarchyHolder.java
Log:
JCR-1067: Reduce contention on read in NodeTypeDataHierarchyHolder
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataHierarchyHolder.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataHierarchyHolder.java 2010-11-22 12:47:58 UTC (rev 3510)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataHierarchyHolder.java 2010-11-22 12:50:14 UTC (rev 3511)
@@ -25,11 +25,12 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
import javax.jcr.RepositoryException;
@@ -46,11 +47,11 @@
*/
private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.NodeTypeDataHierarchyHolder");
- private final Map<InternalQName, NodeTypeHolder> nodeTypes;
+ private volatile Map<InternalQName, NodeTypeHolder> nodeTypes;
public NodeTypeDataHierarchyHolder()
{
- nodeTypes = new ConcurrentHashMap<InternalQName, NodeTypeHolder>();
+ this(new HashMap<InternalQName, NodeTypeHolder>());
}
/**
@@ -60,7 +61,7 @@
*/
public NodeTypeDataHierarchyHolder(Map<InternalQName, NodeTypeHolder> nodeTypes)
{
- this.nodeTypes = nodeTypes;
+ this.nodeTypes = Collections.unmodifiableMap(nodeTypes);
}
/**
@@ -209,12 +210,19 @@
{
final Set<InternalQName> supers = new HashSet<InternalQName>();
mergeAllSupertypes(supers, nodeType.getDeclaredSupertypeNames(), volatileNodeTypes);
- nodeTypes.put(nodeType.getName(), new NodeTypeHolder(nodeType, supers));
+ synchronized (this)
+ {
+ Map<InternalQName, NodeTypeHolder> nodeTypesTmp = new HashMap<InternalQName, NodeTypeHolder>(nodeTypes);
+ nodeTypesTmp.put(nodeType.getName(), new NodeTypeHolder(nodeType, supers));
+ this.nodeTypes = Collections.unmodifiableMap(nodeTypesTmp);
+ }
}
- void removeNodeType(final InternalQName nodeTypeName)
+ synchronized void removeNodeType(final InternalQName nodeTypeName)
{
- nodeTypes.remove(nodeTypeName);
+ Map<InternalQName, NodeTypeHolder> nodeTypesTmp = new HashMap<InternalQName, NodeTypeHolder>(nodeTypes);
+ nodeTypesTmp.remove(nodeTypeName);
+ this.nodeTypes = Collections.unmodifiableMap(nodeTypesTmp);
}
protected synchronized void mergeAllSupertypes(Set<InternalQName> list, final InternalQName[] supers,
@@ -256,7 +264,7 @@
*/
protected NodeTypeDataHierarchyHolder createCopy()
{
- return new NodeTypeDataHierarchyHolder(new ConcurrentHashMap<InternalQName, NodeTypeHolder>(nodeTypes));
+ return new NodeTypeDataHierarchyHolder(new HashMap<InternalQName, NodeTypeHolder>(nodeTypes));
}
class NodeTypeHolder
15 years, 6 months
exo-jcr SVN: r3510 - jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-11-22 07:47:58 -0500 (Mon, 22 Nov 2010)
New Revision: 3510
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataHierarchyHolder.java
Log:
JCR-1506: Reduce contention on read in NodeTypeDataHierarchyHolder
Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataHierarchyHolder.java
===================================================================
--- jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataHierarchyHolder.java 2010-11-22 10:50:10 UTC (rev 3509)
+++ jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataHierarchyHolder.java 2010-11-22 12:47:58 UTC (rev 3510)
@@ -25,11 +25,12 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
import javax.jcr.RepositoryException;
@@ -46,11 +47,11 @@
*/
private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.NodeTypeDataHierarchyHolder");
- private final Map<InternalQName, NodeTypeHolder> nodeTypes;
+ private volatile Map<InternalQName, NodeTypeHolder> nodeTypes;
public NodeTypeDataHierarchyHolder()
{
- nodeTypes = new ConcurrentHashMap<InternalQName, NodeTypeHolder>();
+ this(new HashMap<InternalQName, NodeTypeHolder>());
}
/**
@@ -60,7 +61,7 @@
*/
public NodeTypeDataHierarchyHolder(Map<InternalQName, NodeTypeHolder> nodeTypes)
{
- this.nodeTypes = nodeTypes;
+ this.nodeTypes = Collections.unmodifiableMap(nodeTypes);
}
/**
@@ -209,12 +210,19 @@
{
final Set<InternalQName> supers = new HashSet<InternalQName>();
mergeAllSupertypes(supers, nodeType.getDeclaredSupertypeNames(), volatileNodeTypes);
- nodeTypes.put(nodeType.getName(), new NodeTypeHolder(nodeType, supers));
+ synchronized (this)
+ {
+ Map<InternalQName, NodeTypeHolder> nodeTypesTmp = new HashMap<InternalQName, NodeTypeHolder>(nodeTypes);
+ nodeTypesTmp.put(nodeType.getName(), new NodeTypeHolder(nodeType, supers));
+ this.nodeTypes = Collections.unmodifiableMap(nodeTypesTmp);
+ }
}
- void removeNodeType(final InternalQName nodeTypeName)
+ synchronized void removeNodeType(final InternalQName nodeTypeName)
{
- nodeTypes.remove(nodeTypeName);
+ Map<InternalQName, NodeTypeHolder> nodeTypesTmp = new HashMap<InternalQName, NodeTypeHolder>(nodeTypes);
+ nodeTypesTmp.remove(nodeTypeName);
+ this.nodeTypes = Collections.unmodifiableMap(nodeTypesTmp);
}
protected synchronized void mergeAllSupertypes(Set<InternalQName> list, final InternalQName[] supers,
@@ -256,7 +264,7 @@
*/
protected NodeTypeDataHierarchyHolder createCopy()
{
- return new NodeTypeDataHierarchyHolder(new ConcurrentHashMap<InternalQName, NodeTypeHolder>(nodeTypes));
+ return new NodeTypeDataHierarchyHolder(new HashMap<InternalQName, NodeTypeHolder>(nodeTypes));
}
class NodeTypeHolder
15 years, 6 months
exo-jcr SVN: r3509 - jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2010-11-22 05:50:10 -0500 (Mon, 22 Nov 2010)
New Revision: 3509
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/WorkspaceContainer.java
Log:
JCR-1522: changed names of MBean components to id's like ${portal-container-name}-${repository-name}-${workspace-name}
Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java
===================================================================
--- jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java 2010-11-22 09:44:12 UTC (rev 3508)
+++ jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java 2010-11-22 10:50:10 UTC (rev 3509)
@@ -89,6 +89,11 @@
private final RepositoryEntry config;
/**
+ * Repository name.
+ */
+ private final String name;
+
+ /**
* System workspace DataManager.
*/
private LocalWorkspaceDataManagerStub systemDataManager = null;
@@ -121,7 +126,9 @@
config.setAccessControl(AccessControlPolicy.OPTIONAL);
this.config = config;
+ this.name = parent.getContext().getName() + "-" + config.getName();
+ parent.registerComponentInstance(name, this);
registerComponents();
}
@@ -137,7 +144,7 @@
@ManagedDescription("The repository container name")
public String getName()
{
- return config.getName();
+ return name;
}
public NamespaceRegistry getNamespaceRegistry()
Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/WorkspaceContainer.java
===================================================================
--- jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/WorkspaceContainer.java 2010-11-22 09:44:12 UTC (rev 3508)
+++ jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/WorkspaceContainer.java 2010-11-22 10:50:10 UTC (rev 3509)
@@ -61,7 +61,7 @@
super(new MX4JComponentAdapterFactory(), parent);
repositoryContainer = parent;
- this.name = config.getName();
+ this.name = repositoryContainer.getName() + "-" + config.getName();
}
// Components access methods -------
15 years, 6 months
exo-jcr SVN: r3508 - jcr/branches/1.12.x.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-11-22 04:44:12 -0500 (Mon, 22 Nov 2010)
New Revision: 3508
Modified:
jcr/branches/1.12.x/pom.xml
Log:
JCR-1510: change dependency to branch
Modified: jcr/branches/1.12.x/pom.xml
===================================================================
--- jcr/branches/1.12.x/pom.xml 2010-11-22 09:20:02 UTC (rev 3507)
+++ jcr/branches/1.12.x/pom.xml 2010-11-22 09:44:12 UTC (rev 3508)
@@ -42,9 +42,9 @@
<properties>
<exo.product.name>exo-jcr</exo.product.name>
<exo.product.specification>1.12</exo.product.specification>
- <org.exoplatform.kernel.version>2.2.6-CR02</org.exoplatform.kernel.version>
- <org.exoplatform.core.version>2.3.6-CR02</org.exoplatform.core.version>
- <org.exoplatform.ws.version>2.1.6-CR02</org.exoplatform.ws.version>
+ <org.exoplatform.kernel.version>2.2.6-GA-SNAPSHOT</org.exoplatform.kernel.version>
+ <org.exoplatform.core.version>2.3.6-GA-SNAPSHOT</org.exoplatform.core.version>
+ <org.exoplatform.ws.version>2.1.6-GA-SNAPSHOT</org.exoplatform.ws.version>
<org.exoplatform.doc-style.version>1</org.exoplatform.doc-style.version>
</properties>
15 years, 6 months