exo-jcr SVN: r2354 - in jcr/branches/1.14.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command: proppatch and 1 other directory.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2010-05-06 09:57:53 -0400 (Thu, 06 May 2010)
New Revision: 2354
Modified:
jcr/branches/1.14.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/dasl/SearchResultResponseEntity.java
jcr/branches/1.14.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/proppatch/PropPatchResponseEntity.java
Log:
EXOJCR-698 url difference fixed. Now all responces return decoder url
Modified: jcr/branches/1.14.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/dasl/SearchResultResponseEntity.java
===================================================================
--- jcr/branches/1.14.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/dasl/SearchResultResponseEntity.java 2010-05-06 13:57:17 UTC (rev 2353)
+++ jcr/branches/1.14.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/dasl/SearchResultResponseEntity.java 2010-05-06 13:57:53 UTC (rev 2354)
@@ -35,6 +35,7 @@
import java.io.IOException;
import java.io.OutputStream;
import java.net.URI;
+import java.net.URLDecoder;
import java.util.HashSet;
import java.util.Set;
@@ -172,7 +173,7 @@
xmlStreamWriter.writeStartElement("DAV:", "response");
xmlStreamWriter.writeStartElement("DAV:", "href");
- xmlStreamWriter.writeCharacters(resource.getIdentifier().toASCIIString());
+ xmlStreamWriter.writeCharacters(URLDecoder.decode(resource.getIdentifier().toASCIIString(), "UTF-8"));
xmlStreamWriter.writeEndElement();
PropstatGroupedRepresentation propstat = new PropstatGroupedRepresentation(resource, properties, false);
Modified: jcr/branches/1.14.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/proppatch/PropPatchResponseEntity.java
===================================================================
--- jcr/branches/1.14.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/proppatch/PropPatchResponseEntity.java 2010-05-06 13:57:17 UTC (rev 2353)
+++ jcr/branches/1.14.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/proppatch/PropPatchResponseEntity.java 2010-05-06 13:57:53 UTC (rev 2354)
@@ -37,6 +37,7 @@
import java.io.IOException;
import java.io.OutputStream;
import java.net.URI;
+import java.net.URLDecoder;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -155,7 +156,7 @@
xmlStreamWriter.writeStartElement("DAV:", "response");
xmlStreamWriter.writeStartElement("DAV:", "href");
- xmlStreamWriter.writeCharacters(uri.toASCIIString());
+ xmlStreamWriter.writeCharacters(URLDecoder.decode(uri.toASCIIString(), "UTF-8"));
xmlStreamWriter.writeEndElement();
Map<String, Set<HierarchicalProperty>> propStats = getPropStat();
16 years, 2 months
exo-jcr SVN: r2353 - in jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command: proppatch and 1 other directory.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2010-05-06 09:57:17 -0400 (Thu, 06 May 2010)
New Revision: 2353
Modified:
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/dasl/SearchResultResponseEntity.java
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/proppatch/PropPatchResponseEntity.java
Log:
EXOJCR-698 url difference fixed. Now all responces return decoder url
Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/dasl/SearchResultResponseEntity.java
===================================================================
--- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/dasl/SearchResultResponseEntity.java 2010-05-06 13:21:54 UTC (rev 2352)
+++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/dasl/SearchResultResponseEntity.java 2010-05-06 13:57:17 UTC (rev 2353)
@@ -35,6 +35,7 @@
import java.io.IOException;
import java.io.OutputStream;
import java.net.URI;
+import java.net.URLDecoder;
import java.util.HashSet;
import java.util.Set;
@@ -172,7 +173,7 @@
xmlStreamWriter.writeStartElement("DAV:", "response");
xmlStreamWriter.writeStartElement("DAV:", "href");
- xmlStreamWriter.writeCharacters(resource.getIdentifier().toASCIIString());
+ xmlStreamWriter.writeCharacters(URLDecoder.decode(resource.getIdentifier().toASCIIString(), "UTF-8"));
xmlStreamWriter.writeEndElement();
PropstatGroupedRepresentation propstat = new PropstatGroupedRepresentation(resource, properties, false);
Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/proppatch/PropPatchResponseEntity.java
===================================================================
--- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/proppatch/PropPatchResponseEntity.java 2010-05-06 13:21:54 UTC (rev 2352)
+++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/proppatch/PropPatchResponseEntity.java 2010-05-06 13:57:17 UTC (rev 2353)
@@ -37,6 +37,7 @@
import java.io.IOException;
import java.io.OutputStream;
import java.net.URI;
+import java.net.URLDecoder;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -155,7 +156,7 @@
xmlStreamWriter.writeStartElement("DAV:", "response");
xmlStreamWriter.writeStartElement("DAV:", "href");
- xmlStreamWriter.writeCharacters(uri.toASCIIString());
+ xmlStreamWriter.writeCharacters(URLDecoder.decode(uri.toASCIIString(), "UTF-8"));
xmlStreamWriter.writeEndElement();
Map<String, Set<HierarchicalProperty>> propStats = getPropStat();
16 years, 2 months
exo-jcr SVN: r2352 - in kernel/trunk/exo.kernel.container/src: main/java/org/exoplatform/container/mc and 2 other directories.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-05-06 09:21:54 -0400 (Thu, 06 May 2010)
New Revision: 2352
Added:
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/ConcurrentPicoContainer.java
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/empty-config.xml
Modified:
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/CachingContainer.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/mc/MCIntegrationContainer.java
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestExoContainer.java
Log:
EXOJCR-715: Implementation of a MutablePicoContainer based on java.util.concurrent collections
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/CachingContainer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/CachingContainer.java 2010-05-06 11:53:08 UTC (rev 2351)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/CachingContainer.java 2010-05-06 13:21:54 UTC (rev 2352)
@@ -25,7 +25,6 @@
import org.picocontainer.PicoException;
import org.picocontainer.PicoRegistrationException;
import org.picocontainer.PicoVisitor;
-import org.picocontainer.defaults.AbstractPicoVisitor;
import org.picocontainer.defaults.ComponentAdapterFactory;
import org.picocontainer.defaults.DuplicateComponentKeyRegistrationException;
@@ -146,7 +145,7 @@
return instance;
}
- private static final PicoVisitor invalidator = new AbstractPicoVisitor()
+ private static final PicoVisitor invalidator = new ContainerVisitor()
{
public void visitContainer(PicoContainer pico)
{
@@ -160,14 +159,6 @@
caching.instancesByType.clear();
}
}
-
- public void visitComponentAdapter(ComponentAdapter componentAdapter)
- {
- }
-
- public void visitParameter(Parameter parameter)
- {
- }
};
private void invalidate()
@@ -177,69 +168,65 @@
//
- public synchronized ComponentAdapter registerComponent(ComponentAdapter componentAdapter)
+ public ComponentAdapter registerComponent(ComponentAdapter componentAdapter)
throws DuplicateComponentKeyRegistrationException
{
+ ComponentAdapter adapter = super.registerComponent(componentAdapter);
invalidate();
- return super.registerComponent(componentAdapter);
+ return adapter;
}
- public synchronized ComponentAdapter unregisterComponent(Object componentKey)
+ public ComponentAdapter unregisterComponent(Object componentKey)
{
+ ComponentAdapter adapter = super.unregisterComponent(componentKey);
invalidate();
- return super.unregisterComponent(componentKey);
+ return adapter;
}
- public synchronized ComponentAdapter registerComponentInstance(Object component) throws PicoRegistrationException
+ public ComponentAdapter registerComponentInstance(Object component) throws PicoRegistrationException
{
+ ComponentAdapter adapter = super.registerComponentInstance(component);
invalidate();
- return super.registerComponentInstance(component);
+ return adapter;
}
- public synchronized ComponentAdapter registerComponentInstance(Object componentKey, Object componentInstance)
+ public ComponentAdapter registerComponentInstance(Object componentKey, Object componentInstance)
throws PicoRegistrationException
{
+ ComponentAdapter adapter = super.registerComponentInstance(componentKey, componentInstance);
invalidate();
- return super.registerComponentInstance(componentKey, componentInstance);
+ return adapter;
}
- public synchronized ComponentAdapter registerComponentImplementation(Class componentImplementation)
+ public ComponentAdapter registerComponentImplementation(Class componentImplementation)
throws PicoRegistrationException
{
+ ComponentAdapter adapter = super.registerComponentImplementation(componentImplementation);
invalidate();
- return super.registerComponentImplementation(componentImplementation);
+ return adapter;
}
- public synchronized ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation)
+ public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation)
throws PicoRegistrationException
{
+ ComponentAdapter adapter = super.registerComponentImplementation(componentKey, componentImplementation);
invalidate();
- return super.registerComponentImplementation(componentKey, componentImplementation);
+ return adapter;
}
- public synchronized ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation,
+ public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation,
Parameter[] parameters) throws PicoRegistrationException
{
+ ComponentAdapter adapter = super.registerComponentImplementation(componentKey, componentImplementation, parameters);
invalidate();
- return super.registerComponentImplementation(componentKey, componentImplementation, parameters);
+ return adapter;
}
- public synchronized ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation,
+ public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation,
List parameters) throws PicoRegistrationException
{
+ ComponentAdapter adapter = super.registerComponentImplementation(componentKey, componentImplementation, parameters);
invalidate();
- return super.registerComponentImplementation(componentKey, componentImplementation, parameters);
+ return adapter;
}
-
- public synchronized boolean addChildContainer(PicoContainer child)
- {
- invalidate();
- return super.addChildContainer(child);
- }
-
- public synchronized boolean removeChildContainer(PicoContainer child)
- {
- invalidate();
- return super.removeChildContainer(child);
- }
}
Added: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/ConcurrentPicoContainer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/ConcurrentPicoContainer.java (rev 0)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/ConcurrentPicoContainer.java 2010-05-06 13:21:54 UTC (rev 2352)
@@ -0,0 +1,549 @@
+/*
+ * 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.container;
+
+import org.picocontainer.ComponentAdapter;
+import org.picocontainer.MutablePicoContainer;
+import org.picocontainer.Parameter;
+import org.picocontainer.PicoContainer;
+import org.picocontainer.PicoException;
+import org.picocontainer.PicoRegistrationException;
+import org.picocontainer.PicoVerificationException;
+import org.picocontainer.PicoVisitor;
+import org.picocontainer.alternatives.ImmutablePicoContainer;
+import org.picocontainer.defaults.AbstractPicoVisitor;
+import org.picocontainer.defaults.AmbiguousComponentResolutionException;
+import org.picocontainer.defaults.CachingComponentAdapter;
+import org.picocontainer.defaults.CachingComponentAdapterFactory;
+import org.picocontainer.defaults.ComponentAdapterFactory;
+import org.picocontainer.defaults.DefaultComponentAdapterFactory;
+import org.picocontainer.defaults.DefaultPicoContainer;
+import org.picocontainer.defaults.DuplicateComponentKeyRegistrationException;
+import org.picocontainer.defaults.InstanceComponentAdapter;
+import org.picocontainer.defaults.LifecycleVisitor;
+import org.picocontainer.defaults.VerifyingVisitor;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.CopyOnWriteArraySet;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * This class is aimed to be the ThreadSafe counterpart of {@link DefaultPicoContainer} based on
+ * java.util.concurrent collections.
+ *
+ * Created by The eXo Platform SAS
+ * Author : Nicolas Filotto
+ * nicolas.filotto(a)exoplatform.com
+ * 6 mai 2010
+ * @version $Revision$
+ */
+@SuppressWarnings("unchecked")
+public class ConcurrentPicoContainer implements MutablePicoContainer, Serializable
+{
+
+ /**
+ * The serial version UID
+ */
+ private static final long serialVersionUID = -2275793454555604533L;
+
+ private final ConcurrentMap<Object, ComponentAdapter> componentKeyToAdapterCache =
+ new ConcurrentHashMap<Object, ComponentAdapter>();
+
+ private final ComponentAdapterFactory componentAdapterFactory;
+
+ private final PicoContainer parent;
+
+ private final Set<ComponentAdapter> componentAdapters = new CopyOnWriteArraySet<ComponentAdapter>();
+
+ // Keeps track of instantiation order.
+ private final CopyOnWriteArrayList<ComponentAdapter> orderedComponentAdapters = new CopyOnWriteArrayList<ComponentAdapter>();
+
+ private final AtomicBoolean started = new AtomicBoolean();
+
+ private final AtomicBoolean disposed = new AtomicBoolean();
+
+ private final Set<PicoContainer> children = new CopyOnWriteArraySet<PicoContainer>();
+
+ /**
+ * Creates a new container with a custom ComponentAdapterFactory and a parent container.
+ * <p/>
+ * <em>
+ * Important note about caching: If you intend the components to be cached, you should pass
+ * in a factory that creates {@link CachingComponentAdapter} instances, such as for example
+ * {@link CachingComponentAdapterFactory}. CachingComponentAdapterFactory can delegate to
+ * other ComponentAdapterFactories.
+ * </em>
+ *
+ * @param componentAdapterFactory the factory to use for creation of ComponentAdapters.
+ * @param parent the parent container (used for component dependency lookups).
+ */
+ public ConcurrentPicoContainer(ComponentAdapterFactory componentAdapterFactory, PicoContainer parent)
+ {
+ if (componentAdapterFactory == null)
+ throw new NullPointerException("componentAdapterFactory");
+ this.componentAdapterFactory = componentAdapterFactory;
+ this.parent = parent == null ? null : new ImmutablePicoContainer(parent);
+ }
+
+ /**
+ * Creates a new container with a (caching) {@link DefaultComponentAdapterFactory}
+ * and a parent container.
+ */
+ public ConcurrentPicoContainer(PicoContainer parent)
+ {
+ this(new DefaultComponentAdapterFactory(), parent);
+ }
+
+ /**
+ * Creates a new container with a custom ComponentAdapterFactory and no parent container.
+ *
+ * @param componentAdapterFactory the ComponentAdapterFactory to use.
+ */
+ public ConcurrentPicoContainer(ComponentAdapterFactory componentAdapterFactory)
+ {
+ this(componentAdapterFactory, null);
+ }
+
+ /**
+ * Creates a new container with a (caching) {@link DefaultComponentAdapterFactory} and no parent container.
+ */
+ public ConcurrentPicoContainer()
+ {
+ this(new DefaultComponentAdapterFactory(), null);
+ }
+
+ public Collection getComponentAdapters()
+ {
+ return Collections.unmodifiableSet(componentAdapters);
+ }
+
+ public final ComponentAdapter getComponentAdapter(Object componentKey) throws AmbiguousComponentResolutionException
+ {
+ ComponentAdapter adapter = componentKeyToAdapterCache.get(componentKey);
+ if (adapter == null && parent != null)
+ {
+ adapter = parent.getComponentAdapter(componentKey);
+ }
+ return adapter;
+ }
+
+ public ComponentAdapter getComponentAdapterOfType(Class componentType)
+ {
+ // See http://jira.codehaus.org/secure/ViewIssue.jspa?key=PICO-115
+ ComponentAdapter adapterByKey = getComponentAdapter(componentType);
+ if (adapterByKey != null)
+ {
+ return adapterByKey;
+ }
+
+ List found = getComponentAdaptersOfType(componentType);
+
+ if (found.size() == 1)
+ {
+ return ((ComponentAdapter)found.get(0));
+ }
+ else if (found.size() == 0)
+ {
+ if (parent != null)
+ {
+ return parent.getComponentAdapterOfType(componentType);
+ }
+ else
+ {
+ return null;
+ }
+ }
+ else
+ {
+ Class[] foundClasses = new Class[found.size()];
+ for (int i = 0; i < foundClasses.length; i++)
+ {
+ ComponentAdapter componentAdapter = (ComponentAdapter)found.get(i);
+ foundClasses[i] = componentAdapter.getComponentImplementation();
+ }
+
+ throw new AmbiguousComponentResolutionException(componentType, foundClasses);
+ }
+ }
+
+ public List getComponentAdaptersOfType(Class componentType)
+ {
+ if (componentType == null)
+ {
+ return Collections.EMPTY_LIST;
+ }
+ List<ComponentAdapter> found = new ArrayList<ComponentAdapter>();
+ for (Iterator<ComponentAdapter> iterator = componentAdapters.iterator(); iterator.hasNext();)
+ {
+ ComponentAdapter componentAdapter = iterator.next();
+
+ if (componentType.isAssignableFrom(componentAdapter.getComponentImplementation()))
+ {
+ found.add(componentAdapter);
+ }
+ }
+ return found;
+ }
+
+ /**
+ * {@inheritDoc}
+ * This method can be used to override the ComponentAdapter created by the {@link ComponentAdapterFactory}
+ * passed to the constructor of this container.
+ */
+ public ComponentAdapter registerComponent(ComponentAdapter componentAdapter)
+ throws DuplicateComponentKeyRegistrationException
+ {
+ Object componentKey = componentAdapter.getComponentKey();
+
+ if (componentKeyToAdapterCache.putIfAbsent(componentKey, componentAdapter) != null)
+ {
+ throw new DuplicateComponentKeyRegistrationException(componentKey);
+ }
+ componentAdapters.add(componentAdapter);
+ return componentAdapter;
+ }
+
+ public ComponentAdapter unregisterComponent(Object componentKey)
+ {
+ ComponentAdapter adapter = componentKeyToAdapterCache.remove(componentKey);
+ componentAdapters.remove(adapter);
+ orderedComponentAdapters.remove(adapter);
+ return adapter;
+ }
+
+ /**
+ * {@inheritDoc}
+ * The returned ComponentAdapter will be an {@link InstanceComponentAdapter}.
+ */
+ public ComponentAdapter registerComponentInstance(Object component) throws PicoRegistrationException
+ {
+ return registerComponentInstance(component.getClass(), component);
+ }
+
+ /**
+ * {@inheritDoc}
+ * The returned ComponentAdapter will be an {@link InstanceComponentAdapter}.
+ */
+ public ComponentAdapter registerComponentInstance(Object componentKey, Object componentInstance)
+ throws PicoRegistrationException
+ {
+ if (componentInstance instanceof MutablePicoContainer)
+ {
+ MutablePicoContainer pc = (MutablePicoContainer)componentInstance;
+ Object contrivedKey = new Object();
+ String contrivedComp = "";
+ pc.registerComponentInstance(contrivedKey, contrivedComp);
+ try
+ {
+ if (this.getComponentInstance(contrivedKey) != null)
+ {
+ throw new PicoRegistrationException(
+ "Cannot register a container to itself. The container is already implicitly registered.");
+ }
+ }
+ finally
+ {
+ pc.unregisterComponent(contrivedKey);
+ }
+
+ }
+ ComponentAdapter componentAdapter = new InstanceComponentAdapter(componentKey, componentInstance);
+ registerComponent(componentAdapter);
+ return componentAdapter;
+ }
+
+ /**
+ * {@inheritDoc}
+ * The returned ComponentAdapter will be instantiated by the {@link ComponentAdapterFactory}
+ * passed to the container's constructor.
+ */
+ public ComponentAdapter registerComponentImplementation(Class componentImplementation)
+ throws PicoRegistrationException
+ {
+ return registerComponentImplementation(componentImplementation, componentImplementation);
+ }
+
+ /**
+ * {@inheritDoc}
+ * The returned ComponentAdapter will be instantiated by the {@link ComponentAdapterFactory}
+ * passed to the container's constructor.
+ */
+ public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation)
+ throws PicoRegistrationException
+ {
+ return registerComponentImplementation(componentKey, componentImplementation, (Parameter[])null);
+ }
+
+ /**
+ * {@inheritDoc}
+ * The returned ComponentAdapter will be instantiated by the {@link ComponentAdapterFactory}
+ * passed to the container's constructor.
+ */
+ public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation,
+ Parameter[] parameters) throws PicoRegistrationException
+ {
+ ComponentAdapter componentAdapter =
+ componentAdapterFactory.createComponentAdapter(componentKey, componentImplementation, parameters);
+ registerComponent(componentAdapter);
+ return componentAdapter;
+ }
+
+ /**
+ * Same as {@link #registerComponentImplementation(java.lang.Object, java.lang.Class, org.picocontainer.Parameter[])}
+ * but with parameters as a {@link List}. Makes it possible to use with Groovy arrays (which are actually Lists).
+ */
+ public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation,
+ List parameters) throws PicoRegistrationException
+ {
+ Parameter[] parametersAsArray = (Parameter[])parameters.toArray(new Parameter[parameters.size()]);
+ return registerComponentImplementation(componentKey, componentImplementation, parametersAsArray);
+ }
+
+ private void addOrderedComponentAdapter(ComponentAdapter componentAdapter)
+ {
+ orderedComponentAdapters.addIfAbsent(componentAdapter);
+ }
+
+ public List getComponentInstances() throws PicoException
+ {
+ return getComponentInstancesOfType(Object.class);
+ }
+
+ public List getComponentInstancesOfType(Class componentType) throws PicoException
+ {
+ if (componentType == null)
+ {
+ return Collections.EMPTY_LIST;
+ }
+
+ Map<ComponentAdapter, Object> adapterToInstanceMap = new HashMap<ComponentAdapter, Object>();
+ for (Iterator<ComponentAdapter> iterator = componentAdapters.iterator(); iterator.hasNext();)
+ {
+ ComponentAdapter componentAdapter = iterator.next();
+ if (componentType.isAssignableFrom(componentAdapter.getComponentImplementation()))
+ {
+ Object componentInstance = getInstance(componentAdapter);
+ adapterToInstanceMap.put(componentAdapter, componentInstance);
+
+ // This is to ensure all are added. (Indirect dependencies will be added
+ // from InstantiatingComponentAdapter).
+ addOrderedComponentAdapter(componentAdapter);
+ }
+ }
+ List<Object> result = new ArrayList<Object>();
+ for (Iterator<ComponentAdapter> iterator = orderedComponentAdapters.iterator(); iterator.hasNext();)
+ {
+ Object componentAdapter = iterator.next();
+ final Object componentInstance = adapterToInstanceMap.get(componentAdapter);
+ if (componentInstance != null)
+ {
+ // may be null in the case of the "implicit" adapter
+ // representing "this".
+ result.add(componentInstance);
+ }
+ }
+ return result;
+ }
+
+ public Object getComponentInstance(Object componentKey) throws PicoException
+ {
+ ComponentAdapter componentAdapter = getComponentAdapter(componentKey);
+ if (componentAdapter != null)
+ {
+ return getInstance(componentAdapter);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public Object getComponentInstanceOfType(Class componentType)
+ {
+ final ComponentAdapter componentAdapter = getComponentAdapterOfType(componentType);
+ return componentAdapter == null ? null : getInstance(componentAdapter);
+ }
+
+ private Object getInstance(ComponentAdapter componentAdapter)
+ {
+ // check wether this is our adapter
+ // we need to check this to ensure up-down dependencies cannot be followed
+ final boolean isLocal = componentAdapters.contains(componentAdapter);
+
+ if (isLocal)
+ {
+ Object instance = componentAdapter.getComponentInstance(this);
+
+ addOrderedComponentAdapter(componentAdapter);
+
+ return instance;
+ }
+ else if (parent != null)
+ {
+ return parent.getComponentInstance(componentAdapter.getComponentKey());
+ }
+
+ // TODO: decide .. exception or null?
+ // exceptrion: mx: +1, joehni +1
+ return null;
+ }
+
+ public PicoContainer getParent()
+ {
+ return parent;
+ }
+
+ public ComponentAdapter unregisterComponentByInstance(Object componentInstance)
+ {
+ for (Iterator<ComponentAdapter> iterator = componentAdapters.iterator(); iterator.hasNext();)
+ {
+ ComponentAdapter componentAdapter = iterator.next();
+ if (getInstance(componentAdapter).equals(componentInstance))
+ {
+ return unregisterComponent(componentAdapter.getComponentKey());
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @deprecated since 1.1 - Use new VerifyingVisitor().traverse(this)
+ */
+ public void verify() throws PicoVerificationException
+ {
+ new VerifyingVisitor().traverse(this);
+ }
+
+ /**
+ * Start the components of this PicoContainer and all its logical child containers.
+ * Any component implementing the lifecycle interface {@link org.picocontainer.Startable} will be started.
+ * @see #makeChildContainer()
+ * @see #addChildContainer(PicoContainer)
+ * @see #removeChildContainer(PicoContainer)
+ */
+ public void start()
+ {
+ if (disposed.get())
+ throw new IllegalStateException("Already disposed");
+ if (started.get())
+ throw new IllegalStateException("Already started");
+ LifecycleVisitor.start(this);
+ started.set(true);
+ }
+
+ /**
+ * Stop the components of this PicoContainer and all its logical child containers.
+ * Any component implementing the lifecycle interface {@link org.picocontainer.Startable} will be stopped.
+ * @see #makeChildContainer()
+ * @see #addChildContainer(PicoContainer)
+ * @see #removeChildContainer(PicoContainer)
+ */
+ public void stop()
+ {
+ if (disposed.get())
+ throw new IllegalStateException("Already disposed");
+ if (!started.get())
+ throw new IllegalStateException("Not started");
+ LifecycleVisitor.stop(this);
+ started.set(false);
+ }
+
+ /**
+ * Dispose the components of this PicoContainer and all its logical child containers.
+ * Any component implementing the lifecycle interface {@link org.picocontainer.Disposable} will be disposed.
+ * @see #makeChildContainer()
+ * @see #addChildContainer(PicoContainer)
+ * @see #removeChildContainer(PicoContainer)
+ */
+ public void dispose()
+ {
+ if (disposed.get())
+ throw new IllegalStateException("Already disposed");
+ LifecycleVisitor.dispose(this);
+ disposed.set(true);
+ }
+
+ public MutablePicoContainer makeChildContainer()
+ {
+ DefaultPicoContainer pc = new DefaultPicoContainer(componentAdapterFactory, this);
+ addChildContainer(pc);
+ return pc;
+ }
+
+ public boolean addChildContainer(PicoContainer child)
+ {
+ return children.add(child);
+ }
+
+ public boolean removeChildContainer(PicoContainer child)
+ {
+ return children.remove(child);
+ }
+
+ public void accept(PicoVisitor visitor)
+ {
+ visitor.visitContainer(this);
+ for (Iterator<ComponentAdapter> iterator = componentAdapters.iterator(); iterator.hasNext();)
+ {
+ ComponentAdapter componentAdapter = iterator.next();
+ componentAdapter.accept(visitor);
+ }
+ for (Iterator<PicoContainer> iterator = children.iterator(); iterator.hasNext();)
+ {
+ PicoContainer child = iterator.next();
+ child.accept(visitor);
+ }
+ }
+
+ /**
+ * Accepts a visitor that should visit the child containers only.
+ */
+ protected void accept(ContainerVisitor visitor)
+ {
+ visitor.visitContainer(this);
+ for (Iterator<PicoContainer> iterator = children.iterator(); iterator.hasNext();)
+ {
+ PicoContainer child = iterator.next();
+ child.accept(visitor);
+ }
+ }
+
+ /**
+ * Cans be used to indicate that we only want to visit Containers
+ */
+ protected static abstract class ContainerVisitor extends AbstractPicoVisitor
+ {
+ public final void visitComponentAdapter(ComponentAdapter componentAdapter)
+ {
+ }
+
+ public final void visitParameter(Parameter parameter)
+ {
+ }
+ }
+}
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/mc/MCIntegrationContainer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/mc/MCIntegrationContainer.java 2010-05-06 11:53:08 UTC (rev 2351)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/mc/MCIntegrationContainer.java 2010-05-06 13:21:54 UTC (rev 2352)
@@ -21,19 +21,19 @@
*/
package org.exoplatform.container.mc;
+import org.exoplatform.container.ConcurrentPicoContainer;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.picocontainer.ComponentAdapter;
import org.picocontainer.PicoContainer;
import org.picocontainer.defaults.ComponentAdapterFactory;
-import org.picocontainer.defaults.DefaultPicoContainer;
/**
* Container class that serves as an interception point for MC integration.
*
* @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
*/
-public class MCIntegrationContainer extends DefaultPicoContainer
+public class MCIntegrationContainer extends ConcurrentPicoContainer
{
/**
* Logger
Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestExoContainer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestExoContainer.java 2010-05-06 11:53:08 UTC (rev 2351)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestExoContainer.java 2010-05-06 13:21:54 UTC (rev 2352)
@@ -19,6 +19,7 @@
import org.exoplatform.container.component.BaseComponentPlugin;
import org.exoplatform.container.configuration.ConfigurationManager;
import org.exoplatform.container.jmx.AbstractTestContainer;
+import org.exoplatform.container.support.ContainerBuilder;
import org.exoplatform.container.xml.InitParams;
import org.picocontainer.ComponentAdapter;
import org.picocontainer.PicoContainer;
@@ -27,6 +28,7 @@
import org.picocontainer.PicoVisitor;
import org.picocontainer.defaults.DuplicateComponentKeyRegistrationException;
+import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -72,6 +74,53 @@
assertEquals(value, plugin.myClass_);
}
+ public void testCache()
+ {
+ URL rootURL = getClass().getResource("test-exo-container.xml");
+ URL portalURL = getClass().getResource("empty-config.xml");
+ assertNotNull(rootURL);
+ assertNotNull(portalURL);
+ //
+ new ContainerBuilder().withRoot(rootURL).withPortal(portalURL).build();
+
+ final RootContainer container = RootContainer.getInstance();
+ final ComponentAdapter ca = new ComponentAdapter()
+ {
+
+ public void accept(PicoVisitor paramPicoVisitor)
+ {
+ }
+
+ public Class getComponentImplementation()
+ {
+ return MyClass.class;
+ }
+
+ public Object getComponentInstance(PicoContainer paramPicoContainer)
+ throws PicoInitializationException, PicoIntrospectionException
+ {
+ return new MyClass();
+ }
+
+ public Object getComponentKey()
+ {
+ return "MyKey";
+ }
+
+ public void verify(PicoContainer paramPicoContainer) throws PicoIntrospectionException
+ {
+ }
+
+ };
+ container.registerComponent(ca);
+ final PortalContainer pcontainer = PortalContainer.getInstance();
+ assertEquals(ca, container.getComponentAdapter("MyKey"));
+ assertEquals(ca, pcontainer.getComponentAdapter("MyKey"));
+ container.unregisterComponent("MyKey");
+ assertNull(container.getComponentAdapter("MyKey"));
+ assertNull(pcontainer.getComponentAdapter("MyKey"));
+ }
+
public void testMultiThreading() throws Throwable
{
final RootContainer container = createRootContainer("test-exo-container.xml");
@@ -143,7 +192,7 @@
}
};
- ar.set(container.registerComponent(ca));
+ ar.compareAndSet(null, container.registerComponent(ca));
}
catch (DuplicateComponentKeyRegistrationException e)
{
@@ -167,7 +216,52 @@
container.unregisterComponent("a");
}
});
+
+ testMultiThreading(new Task()
+ {
+ public void execute()
+ {
+ final Object key = new Object();
+ ComponentAdapter ca = new ComponentAdapter()
+ {
+
+ public void accept(PicoVisitor paramPicoVisitor)
+ {
+ }
+
+ public Class getComponentImplementation()
+ {
+ return MyClass.class;
+ }
+
+ public Object getComponentInstance(PicoContainer paramPicoContainer)
+ throws PicoInitializationException, PicoIntrospectionException
+ {
+ return new MyClass();
+ }
+
+ public Object getComponentKey()
+ {
+ return key;
+ }
+
+ public void verify(PicoContainer paramPicoContainer) throws PicoIntrospectionException
+ {
+ }
+
+ };
+ assertNotNull(container.registerComponent(ca));
+ assertNotNull(container.getComponentAdapter(key));
+ assertFalse(container.getComponentAdapters().isEmpty());
+ assertFalse(container.getComponentAdaptersOfType(MyClass.class).isEmpty());
+ assertNotNull(container.getComponentInstance(key));
+ assertNotNull(container.getComponentInstanceOfType(MyClass.class));
+ assertFalse(container.getComponentInstances().isEmpty());
+ assertFalse(container.getComponentInstancesOfType(MyClass.class).isEmpty());
+ assertNotNull(container.unregisterComponent(key));
+ }
+ });
}
private void testMultiThreading(final Task task) throws Throwable
@@ -326,5 +420,5 @@
MyCounter counter = (MyCounter)container.getComponentInstanceOfType(MyCounter.class);
if (counter != null) counter.stop.add(this);
}
- }
+ }
}
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/empty-config.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/empty-config.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/empty-config.xml 2010-05-06 13:21:54 UTC (rev 2352)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+
+</configuration>
\ No newline at end of file
16 years, 2 months
exo-jcr SVN: r2351 - in kernel/trunk/exo.kernel.container/src: main/java/org/exoplatform/container/configuration and 9 other directories.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-05-06 07:53:08 -0400 (Thu, 06 May 2010)
New Revision: 2351
Added:
kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_2.xsd
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_2.java
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-01.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-02.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-03.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-04.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-05.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-06.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-07.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-08.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-09.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-10.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-11.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-12.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-13.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-14.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-15.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-16.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-17.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-18.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-19.xml
Modified:
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/ExoContainer.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/ConfigurationUnmarshaller.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/Namespaces.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/NoKernelNamespaceSAXFilter.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/ProfileDOMFilter.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/util/ContainerUtil.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/xml/Configuration.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/xml/ContainerLifecyclePlugin.java
kernel/trunk/exo.kernel.container/src/main/resources/binding.xml
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestExoContainer.java
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/test-exo-container.xml
Log:
EXOJCR-714: Fix for the issues defined in the description
1. We use know the type as key to register a plugin instead of plugin.getClass().getName() that always returns "org.exoplatform.container.xml.ContainerLifecyclePlugin"
2. All the methods are called now (i.e. initContainer, startContainer, stopContainer and destroyContainer)
3. You can now use a non empty constructor to inject InitParams and/or ConfigurationManager if needed
4. The InitParams are injected thanks to the constructor
5. We can define a name and a description within the configuration file. A new schema version has been created for it 1.2.
6. The execution order is defined thanks to the priority that we can set in the configuration file
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/ExoContainer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/ExoContainer.java 2010-05-05 10:06:50 UTC (rev 2350)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/ExoContainer.java 2010-05-06 11:53:08 UTC (rev 2351)
@@ -113,39 +113,101 @@
return context;
}
+ /**
+ * @return the name of the plugin if it is not empty, the FQN of the plugin otherwise
+ */
+ private static String getPluginName(ContainerLifecyclePlugin plugin)
+ {
+ String name = plugin.getName();
+ if (name == null || name.length() == 0)
+ {
+ name = plugin.getClass().getName();
+ }
+ return name;
+ }
+
public void initContainer() throws Exception
{
ConfigurationManager manager = (ConfigurationManager)getComponentInstanceOfType(ConfigurationManager.class);
ContainerUtil.addContainerLifecyclePlugin(this, manager);
ContainerUtil.addComponentLifecyclePlugin(this, manager);
+ ContainerUtil.addComponents(this, manager);
for (ContainerLifecyclePlugin plugin : containerLifecyclePlugin_)
{
- plugin.initContainer(this);
+ try
+ {
+ plugin.initContainer(this);
+ }
+ catch (Exception e)
+ {
+ log.warn("An error occurs with the ContainerLifecyclePlugin '" + getPluginName(plugin) + "'", e);
+ }
}
- ContainerUtil.addComponents(this, manager);
}
- public void startContainer() throws Exception
+ @Override
+ public void dispose()
{
+ destroyContainer();
+ super.dispose();
+ }
+
+ @Override
+ public void start()
+ {
+ super.start();
+ startContainer();
+ }
+
+ @Override
+ public void stop()
+ {
+ stopContainer();
+ super.stop();
+ }
+
+ public void startContainer()
+ {
for (ContainerLifecyclePlugin plugin : containerLifecyclePlugin_)
{
- plugin.startContainer(this);
+ try
+ {
+ plugin.startContainer(this);
+ }
+ catch (Exception e)
+ {
+ log.warn("An error occurs with the ContainerLifecyclePlugin '" + getPluginName(plugin) + "'", e);
+ }
}
}
- public void stopContainer() throws Exception
+ public void stopContainer()
{
for (ContainerLifecyclePlugin plugin : containerLifecyclePlugin_)
{
- plugin.stopContainer(this);
+ try
+ {
+ plugin.stopContainer(this);
+ }
+ catch (Exception e)
+ {
+ log.warn("An error occurs with the ContainerLifecyclePlugin '" + getPluginName(plugin) + "'", e);
+ }
}
}
- public void destroyContainer() throws Exception
+ public void destroyContainer()
{
for (ContainerLifecyclePlugin plugin : containerLifecyclePlugin_)
{
- plugin.destroyContainer(this);
+ try
+ {
+ plugin.destroyContainer(this);
+ }
+ catch (Exception e)
+ {
+ log.warn("An error occurs with the ContainerLifecyclePlugin '" + getPluginName(plugin) + "'", e);
+ }
}
}
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/ConfigurationUnmarshaller.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/ConfigurationUnmarshaller.java 2010-05-05 10:06:50 UTC (rev 2350)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/ConfigurationUnmarshaller.java 2010-05-06 11:53:08 UTC (rev 2351)
@@ -62,6 +62,11 @@
private static final Log log = ExoLogger.getLogger("exo.kernel.container.ConfigurationUnmarshaller");
+ /**
+ * A private copy of the list of kernel namespaces
+ */
+ private static final String[] KERNEL_NAMESPACES = Namespaces.getKernelNamespaces();
+
private class Reporter implements ErrorHandler
{
@@ -135,10 +140,9 @@
public boolean isValid(URL url) throws NullPointerException, IOException
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- String[] schemas = {Namespaces.KERNEL_1_0_URI, Namespaces.KERNEL_1_1_URI};
factory
.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
- factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource", schemas);
+ factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource", KERNEL_NAMESPACES);
factory.setNamespaceAware(true);
factory.setValidating(true);
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/Namespaces.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/Namespaces.java 2010-05-05 10:06:50 UTC (rev 2350)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/Namespaces.java 2010-05-06 11:53:08 UTC (rev 2351)
@@ -20,8 +20,11 @@
import org.xml.sax.EntityResolver;
+import java.util.Collections;
import java.util.HashMap;
+import java.util.LinkedHashSet;
import java.util.Map;
+import java.util.Set;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
@@ -37,6 +40,23 @@
public static final String KERNEL_1_1_URI = "http://www.exoplaform.org/xml/ns/kernel_1_1.xsd";
/** . */
+ public static final String KERNEL_1_2_URI = "http://www.exoplaform.org/xml/ns/kernel_1_2.xsd";
+
+ /**
+ * All the namespaces related to the kernel
+ */
+ public static final Set<String> KERNEL_NAMESPACES_SET;
+
+ static
+ {
+ Set<String> tmp = new LinkedHashSet<String>();
+ tmp.add(KERNEL_1_0_URI);
+ tmp.add(KERNEL_1_1_URI);
+ tmp.add(KERNEL_1_2_URI);
+ KERNEL_NAMESPACES_SET = Collections.unmodifiableSet(tmp);
+ }
+
+ /** . */
static final EntityResolver resolver;
static
@@ -44,6 +64,25 @@
Map<String, String> resourceMap = new HashMap<String, String>();
resourceMap.put(KERNEL_1_0_URI, "org/exoplatform/container/configuration/kernel-configuration_1_0.xsd");
resourceMap.put(KERNEL_1_1_URI, "org/exoplatform/container/configuration/kernel-configuration_1_1.xsd");
+ resourceMap.put(KERNEL_1_2_URI, "org/exoplatform/container/configuration/kernel-configuration_1_2.xsd");
resolver = new EntityResolverImpl(Namespaces.class.getClassLoader(), resourceMap);
}
+
+ /**
+ * @return A safe copy of the list of kernel namespaces
+ */
+ public static String[] getKernelNamespaces()
+ {
+ return new String[]{KERNEL_1_0_URI, KERNEL_1_1_URI, KERNEL_1_2_URI};
+ }
+
+ /**
+ * Indicates whether the given uri is a kernel namespace or not
+ * @param uri the uri to check
+ * @return <code>true</code> if it is a kernel namespace, <code>false</code> otherwise.
+ */
+ public static boolean isKernelNamespace(String uri)
+ {
+ return KERNEL_NAMESPACES_SET.contains(uri);
+ }
}
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/NoKernelNamespaceSAXFilter.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/NoKernelNamespaceSAXFilter.java 2010-05-05 10:06:50 UTC (rev 2350)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/NoKernelNamespaceSAXFilter.java 2010-05-06 11:53:08 UTC (rev 2351)
@@ -18,9 +18,6 @@
*/
package org.exoplatform.container.configuration;
-import static org.exoplatform.container.configuration.Namespaces.KERNEL_1_0_URI;
-import static org.exoplatform.container.configuration.Namespaces.KERNEL_1_1_URI;
-
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.xml.sax.Attributes;
@@ -78,7 +75,7 @@
public void startPrefixMapping(String prefix, String uri) throws SAXException
{
- if (KERNEL_1_0_URI.equals(uri) || KERNEL_1_1_URI.equals(uri) || XSI_URI.equals(uri))
+ if (Namespaces.isKernelNamespace(uri) || XSI_URI.equals(uri))
{
blackListedPrefixes.add(prefix);
if (log.isTraceEnabled())
@@ -140,7 +137,7 @@
log.trace("Skipping XSI " + attQName + " attribute");
continue;
}
- else if (KERNEL_1_0_URI.equals(attURI) || KERNEL_1_1_URI.equals(attURI))
+ else if (Namespaces.isKernelNamespace(attURI))
{
if (log.isTraceEnabled())
log.trace("Requalifying prefixed attribute " + attQName + " attribute to " + localName);
@@ -154,7 +151,7 @@
}
//
- if (KERNEL_1_0_URI.equals(uri) || KERNEL_1_1_URI.equals(uri))
+ if (Namespaces.isKernelNamespace(uri))
{
if (log.isTraceEnabled())
log.trace("Requalifying active profile " + qName + " start element to " + localName);
@@ -168,7 +165,7 @@
public void endElement(String uri, String localName, String qName) throws SAXException
{
- if (KERNEL_1_0_URI.equals(uri) || KERNEL_1_1_URI.equals(uri))
+ if (Namespaces.isKernelNamespace(uri))
{
if (log.isTraceEnabled())
log.trace("Requalifying " + qName + " end element");
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/ProfileDOMFilter.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/ProfileDOMFilter.java 2010-05-05 10:06:50 UTC (rev 2350)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/ProfileDOMFilter.java 2010-05-06 11:53:08 UTC (rev 2351)
@@ -27,9 +27,9 @@
import java.util.ArrayList;
import java.util.Collections;
+import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
-import static org.exoplatform.container.configuration.Namespaces.*;
/**
* Filters a kernel DOM according to a list of active profiles.
@@ -44,10 +44,17 @@
private static final String PROFILE_ATTRIBUTE = "profiles";
/** . */
- private static final Set<String> kernelURIs = Tools.set(KERNEL_1_0_URI, KERNEL_1_1_URI);
+ private static final Set<String> kernelURIs = Namespaces.KERNEL_NAMESPACES_SET;
/** . */
- private static final Set<String> kernelWithProfileURIs = Tools.set(KERNEL_1_1_URI);
+ private static final Set<String> kernelWithProfileURIs;
+ static
+ {
+ // All the kernel namespaces but KERNEL_1_0_URI
+ Set<String> tmp = new LinkedHashSet<String>(Namespaces.KERNEL_NAMESPACES_SET);
+ tmp.remove(Namespaces.KERNEL_1_0_URI);
+ kernelWithProfileURIs = Collections.unmodifiableSet(tmp);
+ }
/** . */
private final Set<String> activeProfiles;
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/util/ContainerUtil.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/util/ContainerUtil.java 2010-05-05 10:06:50 UTC (rev 2350)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/util/ContainerUtil.java 2010-05-06 11:53:08 UTC (rev 2351)
@@ -34,11 +34,14 @@
import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.net.URL;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
+import java.util.List;
import java.util.Map;
/**
@@ -46,6 +49,7 @@
* @since Oct 28, 2004
* @version $Id: ContainerUtil.java 9894 2006-10-31 02:52:41Z tuan08 $
*/
+@SuppressWarnings("unchecked")
public class ContainerUtil
{
/** The logger. */
@@ -86,7 +90,7 @@
// in the class path. It cause the configuration run twice
int index1 = key.lastIndexOf("exo-");
int index2 = key.lastIndexOf("exo.");
- int index = index1 < index2 ? index2 : index1;
+ int index = index1 < index2 ? index2 : index1;
if (index >= 0)
key = key.substring(index);
map.put(key, url);
@@ -102,24 +106,49 @@
static public void addContainerLifecyclePlugin(ExoContainer container, ConfigurationManager conf)
{
- Collection plugins = conf.getConfiguration().getContainerLifecyclePlugins();
+ List plugins = new ArrayList(conf.getConfiguration().getContainerLifecyclePlugins());
+ Collections.sort(plugins, COMPARATOR_CONTAINER_PLUGIN);
Iterator i = plugins.iterator();
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
while (i.hasNext())
{
ContainerLifecyclePlugin plugin = (ContainerLifecyclePlugin)i.next();
- try
+ addContainerLifecyclePlugin(container, plugin);
+ }
+ }
+
+ private static final Comparator<org.exoplatform.container.xml.ContainerLifecyclePlugin> COMPARATOR_CONTAINER_PLUGIN =
+ new Comparator<org.exoplatform.container.xml.ContainerLifecyclePlugin>()
+ {
+
+ public int compare(org.exoplatform.container.xml.ContainerLifecyclePlugin o1,
+ org.exoplatform.container.xml.ContainerLifecyclePlugin o2)
{
- Class classType = loader.loadClass(plugin.getType());
- org.exoplatform.container.ContainerLifecyclePlugin instance =
- (org.exoplatform.container.ContainerLifecyclePlugin)classType.newInstance();
- container.addContainerLifecylePlugin(instance);
+ return getPriority(o1) - getPriority(o2);
}
- catch (Exception ex)
+
+ private int getPriority(org.exoplatform.container.xml.ContainerLifecyclePlugin p)
{
- ex.printStackTrace();
+ return p.getPriority() == null ? 0 : Integer.parseInt(p.getPriority());
}
+
+ };
+
+ private static void addContainerLifecyclePlugin(ExoContainer container, ContainerLifecyclePlugin plugin)
+ {
+ try
+ {
+ Class clazz = Class.forName(plugin.getType());
+ org.exoplatform.container.ContainerLifecyclePlugin cplugin =
+ (org.exoplatform.container.ContainerLifecyclePlugin)container
+ .createComponent(clazz, plugin.getInitParams());
+ cplugin.setName(plugin.getName());
+ cplugin.setDescription(plugin.getDescription());
+ container.addContainerLifecylePlugin(cplugin);
}
+ catch (Exception ex)
+ {
+ log.error("Failed to instanciate plugin " + plugin.getType() + ": " + ex.getMessage(), ex);
+ }
}
static public void addComponentLifecyclePlugin(ExoContainer container, ConfigurationManager conf)
@@ -139,7 +168,7 @@
}
catch (Exception ex)
{
- ex.printStackTrace();
+ log.error("Failed to instanciate plugin " + plugin.getType() + ": " + ex.getMessage(), ex);
}
}
}
@@ -166,7 +195,7 @@
if (component.isMultiInstance())
{
container.registerComponent(new ConstructorInjectionComponentAdapter(classType, classType));
- System.out.println("===>>> Thread local component " + classType.getName() + " registered.");
+ log.debug("===>>> Thread local component " + classType.getName() + " registered.");
}
else
{
@@ -181,7 +210,7 @@
if (component.isMultiInstance())
{
container.registerComponent(new ConstructorInjectionComponentAdapter(keyType, classType));
- System.out.println("===>>> Thread local component " + classType.getName() + " registered.");
+ log.debug("===>>> Thread local component " + classType.getName() + " registered.");
}
else
{
@@ -196,11 +225,11 @@
}
catch (ClassNotFoundException ex)
{
- ex.printStackTrace();
+ log.error("Cannot register the component corresponding to key = '" + key + "' and type = '" + type + "'", ex);
}
}
}
-
+
/**
* Loads the properties file corresponding to the given url
* @param url the url of the properties file
@@ -210,7 +239,7 @@
{
return loadProperties(url, true);
}
-
+
/**
* Loads the properties file corresponding to the given url
* @param url the url of the properties file
@@ -237,7 +266,7 @@
String fileName = url.getFile();
if (Tools.endsWithIgnoreCase(path, ".properties"))
{
- if (log.isDebugEnabled())
+ if (log.isDebugEnabled())
log.debug("Attempt to load property file " + path);
props = PropertiesLoader.load(in);
}
@@ -254,7 +283,7 @@
if (props != null && resolveVariables)
{
// Those properties are used for variables resolution
- final Map<String, Object> currentProps = new HashMap<String, Object>();
+ final Map<String, Object> currentProps = new HashMap<String, Object>();
for (Map.Entry<String, String> entry : props.entrySet())
{
String propertyName = entry.getKey();
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/xml/Configuration.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/xml/Configuration.java 2010-05-05 10:06:50 UTC (rev 2350)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/xml/Configuration.java 2010-05-06 11:53:08 UTC (rev 2351)
@@ -60,7 +60,7 @@
public void addContainerLifecyclePlugin(Object object)
{
ContainerLifecyclePlugin plugin = (ContainerLifecyclePlugin)object;
- String key = plugin.getClass().getName();
+ String key = plugin.getType();
containerLifecyclePlugin_.put(key, plugin);
}
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/xml/ContainerLifecyclePlugin.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/xml/ContainerLifecyclePlugin.java 2010-05-05 10:06:50 UTC (rev 2350)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/xml/ContainerLifecyclePlugin.java 2010-05-06 11:53:08 UTC (rev 2351)
@@ -24,10 +24,26 @@
*/
public class ContainerLifecyclePlugin
{
+ private String name;
+
private String type;
+
+ private String description;
+
+ private String priority;
private InitParams initParams;
+
+ public String getName()
+ {
+ return name;
+ }
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
public String getType()
{
return type;
@@ -38,6 +54,26 @@
this.type = type;
}
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(String desc)
+ {
+ this.description = desc;
+ }
+
+ public String getPriority()
+ {
+ return priority;
+ }
+
+ public void setPriority(String priority)
+ {
+ this.priority = priority;
+ }
+
public InitParams getInitParams()
{
return initParams;
Modified: kernel/trunk/exo.kernel.container/src/main/resources/binding.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/resources/binding.xml 2010-05-05 10:06:50 UTC (rev 2350)
+++ kernel/trunk/exo.kernel.container/src/main/resources/binding.xml 2010-05-06 11:53:08 UTC (rev 2351)
@@ -153,7 +153,10 @@
</mapping>
<mapping name="container-lifecycle-plugin" class="org.exoplatform.container.xml.ContainerLifecyclePlugin">
+ <value name="name" field="name" usage="optional" />
<value name="type" field="type" />
+ <value name="description" field="description" usage="optional" />
+ <value name="priority" field="priority" usage="optional" />
<structure map-as="org.exoplatform.container.xml.InitParams" usage="optional"
get-method="getInitParams" set-method="setInitParams"/>
</mapping>
Added: kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_2.xsd
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_2.xsd (rev 0)
+++ kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_2.xsd 2010-05-06 11:53:08 UTC (rev 2351)
@@ -0,0 +1,239 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema
+ targetNamespace="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ version="1.0">
+
+ <xsd:element name="configuration" type="configurationType"/>
+
+ <xsd:complexType abstract="true" name="profilesdElementType">
+ <xsd:attribute name="profiles" type="xsd:string"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="baseObjectType">
+ <xsd:choice>
+ <xsd:element name="string" type="xsd:string"/>
+ <xsd:element name="int" type="xsd:int"/>
+ <xsd:element name="long" type="xsd:long"/>
+ <xsd:element name="boolean" type="xsd:boolean"/>
+ <xsd:element name="date" type="xsd:date"/>
+ <xsd:element name="double" type="xsd:double"/>
+ <xsd:element name="map" type="mapType"/>
+ <xsd:element name="collection" type="collectionType"/>
+ <xsd:element name="native-array" type="nativeArraytype"/>
+ <xsd:element name="object" type="objectType"/>
+ </xsd:choice>
+ </xsd:complexType>
+
+ <xsd:complexType name="entryType">
+ <xsd:sequence>
+ <xsd:element name="key" type="baseObjectType" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="value" type="baseObjectType" minOccurs="1" maxOccurs="1"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="mapType">
+ <xsd:sequence>
+ <xsd:element name="entry" type="entryType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="type" type="xsd:string" use="required"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="collectionType">
+ <xsd:sequence>
+ <xsd:element name="value" minOccurs="0" maxOccurs="unbounded">
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="baseObjectType">
+ <xsd:attribute name="profiles" type="xsd:string"/>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="type" type="xsd:string" use="required"/>
+ <xsd:attribute name="item-type" type="xsd:string"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="nativeArraytype">
+ <xsd:complexContent>
+ <xsd:extension base="baseObjectType">
+ <xsd:sequence>
+ <xsd:element name="type" type="xsd:string" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="array" type="xsd:string" minOccurs="1" maxOccurs="1"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:complexType name="fieldType">
+ <xsd:complexContent >
+ <xsd:extension base="baseObjectType">
+ <xsd:attribute name="name" type="xsd:string"/>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:complexType name="objectType">
+ <xsd:sequence>
+ <xsd:element name="field" minOccurs="0" maxOccurs="unbounded">
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="fieldType">
+ <xsd:attribute name="profiles" type="xsd:string"/>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="type" type="xsd:string"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="propertyType">
+ <xsd:attribute name="name" type="xsd:string"/>
+ <xsd:attribute name="value" type="xsd:string"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="paramType" abstract="true">
+ <xsd:sequence>
+ <xsd:element name="name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ </xsd:sequence>
+ <xsd:attribute name="profiles" type="xsd:string"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="valueParamType">
+ <xsd:complexContent>
+ <xsd:extension base="paramType">
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="1" maxOccurs="1"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:complexType name="valuesParamType">
+ <xsd:complexContent>
+ <xsd:extension base="paramType">
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:complexType name="propertiesParamType">
+ <xsd:complexContent>
+ <xsd:extension base="paramType">
+ <xsd:sequence>
+ <xsd:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:complexType name="objectParamType">
+ <xsd:complexContent>
+ <xsd:extension base="paramType">
+ <xsd:sequence>
+ <xsd:element name="object" type="objectType" minOccurs="1" maxOccurs="1"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:complexType name="initParamsType">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="object-param" type="objectParamType"/>
+ <xsd:element name="properties-param" type="propertiesParamType"/>
+ <xsd:element name="value-param" type="valueParamType"/>
+ <xsd:element name="values-param" type="valuesParamType"/>
+ </xsd:choice>
+ </xsd:complexType>
+
+ <xsd:complexType name="componentPluginType">
+ <xsd:sequence>
+ <xsd:element name="name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="set-method" type="xsd:string" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="type" type="xsd:string" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="priority" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="init-params" type="initParamsType" minOccurs="0" maxOccurs="1"/>
+ </xsd:sequence>
+ <xsd:attribute name="profiles" type="xsd:string"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="externalComponentPluginType">
+ <xsd:sequence>
+ <xsd:element name="target-component" type="xsd:string" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="component-plugin" type="componentPluginType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="containerLifecyclePluginType">
+ <xsd:sequence>
+ <xsd:element name="name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="type" type="xsd:string" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="priority" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="init-params" type="initParamsType" minOccurs="0" maxOccurs="1"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="manageableComponentsType">
+ <xsd:sequence>
+ <xsd:element name="component-type" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="componentLifecyclePluginType">
+ <xsd:sequence>
+ <xsd:element name="type" type="xsd:string" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="manageable-components" type="manageableComponentsType" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="init-params" type="initParamsType" minOccurs="0" maxOccurs="1"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="componentType">
+ <xsd:sequence>
+ <xsd:element name="key" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="jmx-name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="type" type="xsd:string" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="show-deploy-info" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="multi-instance" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="component-plugins" minOccurs="0" maxOccurs="1">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="component-plugin" type="componentPluginType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="init-params" type="initParamsType" minOccurs="0" maxOccurs="1"/>
+ </xsd:sequence>
+ <xsd:attribute name="profiles" type="xsd:string"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="configurationType">
+ <xsd:sequence>
+ <xsd:element name="container-lifecycle-plugin" type="containerLifecyclePluginType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="component-lifecycle-plugin" type="componentLifecyclePluginType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="component" type="componentType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="external-component-plugins" type="externalComponentPluginType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="import" type="importType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="remove-configuration" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="importType">
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string">
+ <xsd:attribute name="profiles" type="xsd:string"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+</xsd:schema>
\ No newline at end of file
Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestExoContainer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestExoContainer.java 2010-05-05 10:06:50 UTC (rev 2350)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestExoContainer.java 2010-05-06 11:53:08 UTC (rev 2351)
@@ -19,6 +19,7 @@
import org.exoplatform.container.component.BaseComponentPlugin;
import org.exoplatform.container.configuration.ConfigurationManager;
import org.exoplatform.container.jmx.AbstractTestContainer;
+import org.exoplatform.container.xml.InitParams;
import org.picocontainer.ComponentAdapter;
import org.picocontainer.PicoContainer;
import org.picocontainer.PicoInitializationException;
@@ -41,6 +42,25 @@
public class TestExoContainer extends AbstractTestContainer
{
+ public void testContainerLifecyclePlugin()
+ {
+ final RootContainer container = createRootContainer("test-exo-container.xml");
+ MyCounter counter = (MyCounter)container.getComponentInstanceOfType(MyCounter.class);
+ assertNotNull(counter);
+ assertEquals(2, counter.init.size());
+ assertEquals(2, counter.start.size());
+ container.stop();
+ assertEquals(2, counter.stop.size());
+ container.dispose();
+ assertEquals(2, counter.destroy.size());
+ // Check order
+ assertTrue(counter.init.get(0) instanceof MyContainerLifecyclePlugin2);
+ MyContainerLifecyclePlugin2 plugin = (MyContainerLifecyclePlugin2)counter.init.get(0);
+ assertNotNull(plugin.getName());
+ assertNotNull(plugin.getDescription());
+ assertNotNull(plugin.param);
+ }
+
public void testStackOverFlow()
{
final RootContainer container = createRootContainer("test-exo-container.xml");
@@ -224,4 +244,87 @@
this.myClass_ = myClass;
}
}
+
+ public static class MyCounter
+ {
+ public final List<BaseContainerLifecyclePlugin> init = new ArrayList<BaseContainerLifecyclePlugin>();
+ public final List<BaseContainerLifecyclePlugin> start = new ArrayList<BaseContainerLifecyclePlugin>();
+ public final List<BaseContainerLifecyclePlugin> stop = new ArrayList<BaseContainerLifecyclePlugin>();
+ public final List<BaseContainerLifecyclePlugin> destroy = new ArrayList<BaseContainerLifecyclePlugin>();
+ }
+
+ public static class MyContainerLifecyclePlugin1 extends BaseContainerLifecyclePlugin
+ {
+
+ public MyContainerLifecyclePlugin1()
+ {
+ }
+
+ @Override
+ public void destroyContainer(ExoContainer container) throws Exception
+ {
+ MyCounter counter = (MyCounter)container.getComponentInstanceOfType(MyCounter.class);
+ if (counter != null) counter.destroy.add(this);
+ }
+
+ @Override
+ public void initContainer(ExoContainer container) throws Exception
+ {
+ MyCounter counter = (MyCounter)container.getComponentInstanceOfType(MyCounter.class);
+ if (counter != null) counter.init.add(this);
+ }
+
+ @Override
+ public void startContainer(ExoContainer container) throws Exception
+ {
+ MyCounter counter = (MyCounter)container.getComponentInstanceOfType(MyCounter.class);
+ if (counter != null) counter.start.add(this);
+ }
+
+ @Override
+ public void stopContainer(ExoContainer container) throws Exception
+ {
+ MyCounter counter = (MyCounter)container.getComponentInstanceOfType(MyCounter.class);
+ if (counter != null) counter.stop.add(this);
+ }
+
+ }
+
+ public static class MyContainerLifecyclePlugin2 extends BaseContainerLifecyclePlugin
+ {
+ public final String param;
+
+ public MyContainerLifecyclePlugin2(InitParams params)
+ {
+ this.param = params != null ? params.getValueParam("param").getValue() : null;
+ }
+
+ @Override
+ public void destroyContainer(ExoContainer container) throws Exception
+ {
+ MyCounter counter = (MyCounter)container.getComponentInstanceOfType(MyCounter.class);
+ if (counter != null) counter.destroy.add(this);
+ }
+
+ @Override
+ public void initContainer(ExoContainer container) throws Exception
+ {
+ MyCounter counter = (MyCounter)container.getComponentInstanceOfType(MyCounter.class);
+ if (counter != null) counter.init.add(this);
+ }
+
+ @Override
+ public void startContainer(ExoContainer container) throws Exception
+ {
+ MyCounter counter = (MyCounter)container.getComponentInstanceOfType(MyCounter.class);
+ if (counter != null) counter.start.add(this);
+ }
+
+ @Override
+ public void stopContainer(ExoContainer container) throws Exception
+ {
+ MyCounter counter = (MyCounter)container.getComponentInstanceOfType(MyCounter.class);
+ if (counter != null) counter.stop.add(this);
+ }
+ }
}
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_2.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_2.java (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_2.java 2010-05-06 11:53:08 UTC (rev 2351)
@@ -0,0 +1,62 @@
+/*
+ * 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.container.configuration;
+
+import org.exoplatform.test.BasicTestCase;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+/**
+ * @author <a href="mailto:nicolas.filotto@exoplatform.com">Nicolas Filotto</a>
+ * @version $Revision$
+ */
+public class TestXSD_1_2 extends BasicTestCase
+{
+
+ public void testValidation() throws Exception
+ {
+ ConfigurationUnmarshaller unmarshaller = new ConfigurationUnmarshaller();
+ String baseDirPath = System.getProperty("basedir");
+ File baseDir = new File(baseDirPath + "/src/test/resources/xsd_1_2");
+ int count = 0;
+ for (File f : baseDir.listFiles(new FileFilter()
+ {
+ public boolean accept(File pathname)
+ {
+ return pathname.getName().endsWith(".xml");
+ }
+ }))
+ {
+ count++;
+ try
+ {
+ URL url = f.toURI().toURL();
+ assertTrue("XML configuration file " + url + " is not valid", unmarshaller.isValid(url));
+ }
+ catch (MalformedURLException e)
+ {
+ fail("Was not expecting such exception " + e.getMessage());
+ }
+ }
+ assertEquals(19, count);
+ }
+}
\ No newline at end of file
Modified: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/test-exo-container.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/test-exo-container.xml 2010-05-05 10:06:50 UTC (rev 2350)
+++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/test-exo-container.xml 2010-05-06 11:53:08 UTC (rev 2351)
@@ -7,9 +7,28 @@
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.
-->
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
- xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
+ <container-lifecycle-plugin>
+ <type>org.exoplatform.container.TestExoContainer$MyContainerLifecyclePlugin1</type>
+ </container-lifecycle-plugin>
+ <container-lifecycle-plugin>
+ <name>MyContainerLifecyclePlugin2</name>
+ <type>org.exoplatform.container.TestExoContainer$MyContainerLifecyclePlugin2</type>
+ <description>The description of the plugin</description>
+ <priority>-10</priority>
+ <init-params>
+ <value-param>
+ <name>param</name>
+ <description>a test parameter</description>
+ <value>value</value>
+ </value-param>
+ </init-params>
+ </container-lifecycle-plugin>
<component>
+ <type>org.exoplatform.container.TestExoContainer$MyCounter</type>
+ </component>
+ <component>
<type>org.exoplatform.container.TestExoContainer$MyMTClass</type>
</component>
<component>
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-01.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-01.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-01.xml 2010-05-06 11:53:08 UTC (rev 2351)
@@ -0,0 +1,224 @@
+<?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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
+
+ <component>
+ <key>org.exoplatform.portal.config.DataStorage</key>
+ <type>org.exoplatform.portal.config.jcr.DataStorageImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.portal.application.UserGadgetStorage</key>
+ <type>org.exoplatform.portal.application.jcr.UserGadgetStorageImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.portal.layout.PortalLayoutService</key>
+ <type>org.exoplatform.portal.layout.jcr.PortalLayoutServiceImpl</type>
+ <init-params>
+ <value-param>
+ <name>template.location</name>
+ <description>Location of container templates</description>
+ <value>war:/conf/portal/template/containers</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.portal.config.UserACL</key>
+ <type>org.exoplatform.portal.config.UserACL</type>
+ <init-params>
+ <value-param>
+ <name>super.user</name>
+ <description>administrator</description>
+ <value>root</value>
+ </value-param>
+
+ <value-param>
+ <name>portal.creator.groups</name>
+ <description>groups with membership type have permission to manage portal</description>
+ <value>*:/platform/administrators,*:/organization/management/executive-board</value>
+ </value-param>
+
+ <value-param>
+ <name>navigation.creator.membership.type</name>
+ <description>specific membership type have full permission with group navigation</description>
+ <value>manager</value>
+ </value-param>
+ <value-param>
+ <name>guests.group</name>
+ <description>guests group</description>
+ <value>/platform/guests</value>
+ </value-param>
+ <value-param>
+ <name>access.control.workspace</name>
+ <description>groups with memberships that have the right to access the User Control Workspace</description>
+ <value>*:/platform/administrators,*:/organization/management/executive-board</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.portal.config.UserPortalConfigService</key>
+ <type>org.exoplatform.portal.config.UserPortalConfigService</type>
+ <component-plugins>
+ <component-plugin>
+ <name>new.portal.config.user.listener</name>
+ <set-method>initListener</set-method>
+ <type>org.exoplatform.portal.config.NewPortalConfigListener</type>
+ <description>this listener init the portal configuration</description>
+ <init-params>
+ <value-param>
+ <name>default.portal</name>
+ <description>The default portal for checking db is empty or not</description>
+ <value>classic</value>
+ </value-param>
+ <object-param>
+ <name>portal.configuration</name>
+ <description>description</description>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value><string>classic</string></value>
+ </collection>
+ </field>
+ <field name="ownerType"><string>portal</string></field>
+ <field name="templateLocation"><string>war:/conf/portal</string></field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>group.configuration</name>
+ <description>description</description>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value><string>platform/administrators</string></value>
+ <value><string>platform/users</string></value>
+ <value><string>platform/guests</string></value>
+ <value><string>organization/management/executive-board</string></value>
+ </collection>
+ </field>
+ <field name="ownerType"><string>group</string></field>
+ <field name="templateLocation"><string>war:/conf/portal</string></field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>user.configuration</name>
+ <description>description</description>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value><string>root</string></value>
+ <value><string>john</string></value>
+ <value><string>marry</string></value>
+ <value><string>demo</string></value>
+ </collection>
+ </field>
+ <field name="ownerType"><string>user</string></field>
+ <field name="templateLocation"><string>war:/conf/portal</string></field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>page.templates</name>
+ <description>List of page templates</description>
+ <object type="org.exoplatform.portal.config.PageTemplateConfig">
+ <field name="templates">
+ <collection type="java.util.ArrayList"></collection>
+ </field>
+ <field name="location"><string>war:/conf/portal/template/pages</string></field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </component-plugins>
+
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.organization.OrganizationService</target-component>
+
+ <component-plugin>
+ <name>user.portal.config.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.portal.config.UserPortalConfigListener</type>
+ </component-plugin>
+
+ <component-plugin>
+ <name>group.portal.config.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.portal.config.GroupPortalConfigListener</type>
+ </component-plugin>
+
+ <component-plugin>
+ <name>ecm.new.user.event.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.services.jcr.ext.hierarchy.impl.NewUserListener</type>
+ <description>description</description>
+ <init-params>
+ <object-param>
+ <name>configuration</name>
+ <description>description</description>
+ <object type="org.exoplatform.services.jcr.ext.hierarchy.impl.HierarchyConfig">
+ <field name="repository"><string>repository</string></field>
+ <field name="workspaces">
+ <collection type="java.util.ArrayList">
+ <value><string>collaboration</string></value>
+ </collection>
+ </field>
+ <field name="jcrPaths">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.jcr.ext.hierarchy.impl.HierarchyConfig$JcrPath">
+ <field name="alias"><string>userApplicationData</string></field>
+ <field name="path"><string>ApplicationData</string></field>
+ <field name="nodeType"><string>nt:unstructured</string></field>
+ <field name="permissions">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.jcr.ext.hierarchy.impl.HierarchyConfig$Permission">
+ <field name="identity"><string>*:/platform/administrators</string></field>
+ <field name="read"><string>true</string></field>
+ <field name="addNode"><string>true</string></field>
+ <field name="setProperty"><string>true</string></field>
+ <field name="remove"><string>true</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ <field name="mixinTypes">
+ <collection type="java.util.ArrayList">
+ </collection>
+ </field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-02.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-02.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-02.xml 2010-05-06 11:53:08 UTC (rev 2351)
@@ -0,0 +1,241 @@
+<?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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
+
+ <component>
+ <key>org.exoplatform.application.gadget.GadgetRegistryService</key>
+ <type>org.exoplatform.application.gadget.jcr.GadgetRegistryServiceImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.application.gadget.SourceStorage</key>
+ <type>org.exoplatform.application.gadget.jcr.SourceStorageImpl</type>
+ <init-params>
+ <properties-param>
+ <name>location</name>
+ <description>The location store source of gadgets</description>
+ <property name="repository" value="repository"></property>
+ <property name="workspace" value="gadgets"></property>
+ <property name="store.path" value="/"></property>
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.application.registry.ApplicationRegistryService</key>
+ <type>org.exoplatform.application.registry.jcr.ApplicationRegistryServiceImpl</type>
+ <component-plugins>
+ <component-plugin>
+ <name>new.portal.portlets.registry</name>
+ <set-method>initListener</set-method>
+ <type>org.exoplatform.application.registry.ApplicationCategoriesPlugins</type>
+ <description>this listener init the portlets are registered in PortletRegister</description>
+ <init-params>
+ <object-param>
+ <name>administration</name>
+ <description>description</description>
+ <object type="org.exoplatform.application.registry.ApplicationCategory">
+ <field name="name"><string>administration</string></field>
+ <field name="displayName"><string>Administration</string></field>
+ <field name="description"><string>application for administration</string></field>
+ <field name="accessPermissions">
+ <collection type="java.util.ArrayList" item-type="java.lang.String">
+ <value><string>*:/platform/administrators</string></value>
+ <value><string>*:/organization/management/executive-board</string></value>
+ </collection>
+ </field>
+ <field name="applications">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.application.registry.Application">
+ <field name="applicationName"><string>ApplicationRegistryPortlet</string></field>
+ <field name="categoryName"><string>administration</string></field>
+ <field name="displayName"><string>Application Registry</string></field>
+ <field name="description"><string>Application Registry</string></field>
+ <field name="applicationType"><string>portlet</string></field>
+ <field name="applicationGroup"><string>exoadmin</string></field>
+ <field name="accessPermissions">
+ <collection type="java.util.ArrayList" item-type="java.lang.String">
+ <value><string>*:/platform/administrators</string></value>
+ <value><string>*:/organization/management/executive-board</string></value>
+ </collection>
+ </field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.application.registry.Application">
+ <field name="applicationName"><string>OrganizationPortlet</string></field>
+ <field name="categoryName"><string>administration</string></field>
+ <field name="displayName"><string>Organization Management</string></field>
+ <field name="description"><string>Organization Management</string></field>
+ <field name="applicationType"><string>portlet</string></field>
+ <field name="applicationGroup"><string>exoadmin</string></field>
+ <field name="accessPermissions">
+ <collection type="java.util.ArrayList" item-type="java.lang.String">
+ <value><string>*:/platform/administrators</string></value>
+ <value><string>*:/organization/management/executive-board</string></value>
+ </collection>
+ </field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.application.registry.Application">
+ <field name="applicationName"><string>AccountPortlet</string></field>
+ <field name="categoryName"><string>administration</string></field>
+ <field name="displayName"><string>New Account</string></field>
+ <field name="description"><string>New Account</string></field>
+ <field name="applicationType"><string>portlet</string></field>
+ <field name="applicationGroup"><string>exoadmin</string></field>
+ <field name="accessPermissions">
+ <collection type="java.util.ArrayList" item-type="java.lang.String">
+ <value><string>*:/platform/administrators</string></value>
+ <value><string>*:/organization/management/executive-board</string></value>
+ </collection>
+ </field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+
+ <object-param>
+ <name>web</name>
+ <description>description</description>
+ <object type="org.exoplatform.application.registry.ApplicationCategory">
+ <field name="name"><string>web</string></field>
+ <field name="displayName"><string>web</string></field>
+ <field name="description"><string>BasicPortlets</string></field>
+ <field name="accessPermissions">
+ <collection type="java.util.ArrayList" item-type="java.lang.String">
+ <value><string>*:/platform/users</string></value>
+ </collection>
+ </field>
+ <field name="applications">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.application.registry.Application">
+ <field name="categoryName"><string>web</string></field>
+ <field name="applicationName"><string>IFramePortlet</string></field>
+ <field name="displayName"><string>IFrame</string></field>
+ <field name="description"><string>IFrame</string></field>
+ <field name="applicationType"><string>portlet</string></field>
+ <field name="applicationGroup"><string>web</string></field>
+ <field name="accessPermissions">
+ <collection type="java.util.ArrayList" item-type="java.lang.String">
+ <value><string>*:/platform/users</string></value>
+ </collection>
+ </field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.application.registry.Application">
+ <field name="categoryName"><string>web</string></field>
+ <field name="applicationName"><string>SiteMapPortlet</string></field>
+ <field name="displayName"><string>SiteMap</string></field>
+ <field name="description"><string>SiteMap</string></field>
+ <field name="applicationType"><string>portlet</string></field>
+ <field name="applicationGroup"><string>web</string></field>
+ <field name="accessPermissions">
+ <collection type="java.util.ArrayList" item-type="java.lang.String">
+ <value><string>*:/platform/users</string></value>
+ </collection>
+ </field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.application.registry.Application">
+ <field name="categoryName"><string>web</string></field>
+ <field name="applicationName"><string>BrowserPortlet</string></field>
+ <field name="displayName"><string>Web Explorer</string></field>
+ <field name="description"><string>Web Explorer</string></field>
+ <field name="applicationType"><string>portlet</string></field>
+ <field name="applicationGroup"><string>web</string></field>
+ <field name="accessPermissions">
+ <collection type="java.util.ArrayList" item-type="java.lang.String">
+ <value><string>*:/platform/users</string></value>
+ </collection>
+ </field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+
+ <object-param>
+ <name>dashboard</name>
+ <description>description</description>
+ <object type="org.exoplatform.application.registry.ApplicationCategory">
+ <field name="name"><string>dashboard</string></field>
+ <field name="displayName"><string>Dashboard</string></field>
+ <field name="description"><string>Dashboard</string></field>
+ <field name="accessPermissions">
+ <collection type="java.util.ArrayList" item-type="java.lang.String">
+ <value><string>*:/platform/users</string></value>
+ </collection>
+ </field>
+ <field name="applications">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.application.registry.Application">
+ <field name="categoryName"><string>dashboard</string></field>
+ <field name="applicationName"><string>DashboardPortlet</string></field>
+ <field name="displayName"><string>Dashboard Portlet</string></field>
+ <field name="description"><string>Dashboard Portlet</string></field>
+ <field name="applicationType"><string>portlet</string></field>
+ <field name="applicationGroup"><string>dashboard</string></field>
+ <field name="accessPermissions">
+ <collection type="java.util.ArrayList" item-type="java.lang.String">
+ <value><string>*:/platform/users</string></value>
+ </collection>
+ </field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.application.registry.Application">
+ <field name="categoryName"><string>dashboard</string></field>
+ <field name="applicationName"><string>GadgetPortlet</string></field>
+ <field name="displayName"><string>Gadget Wrapper Portlet</string></field>
+ <field name="description"><string>Gadget Wrapper Portlet</string></field>
+ <field name="applicationType"><string>portlet</string></field>
+ <field name="applicationGroup"><string>dashboard</string></field>
+ <field name="accessPermissions">
+ <collection type="java.util.ArrayList" item-type="java.lang.String">
+ <value><string>*:/platform/users</string></value>
+ </collection>
+ </field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </component-plugins>
+ </component>
+
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-03.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-03.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-03.xml 2010-05-06 11:53:08 UTC (rev 2351)
@@ -0,0 +1,304 @@
+<?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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.organization.OrganizationService</target-component>
+ <component-plugin>
+ <name>init.service.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.services.organization.OrganizationDatabaseInitializer</type>
+ <description>this listener populate organization data for the first launch</description>
+ <init-params>
+ <value-param>
+ <name>checkDatabaseAlgorithm</name>
+ <description>check database</description>
+ <value>entry</value>
+ </value-param>
+ <value-param>
+ <name>printInformation</name>
+ <description>Print information init database</description>
+ <value>false</value>
+ </value-param>
+ <object-param>
+ <name>configuration</name>
+ <description>description</description>
+ <object type="org.exoplatform.services.organization.OrganizationConfig">
+ <field name="membershipType">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
+ <field name="type"><string>manager</string></field>
+ <field name="description"><string>manager membership type</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
+ <field name="type"><string>member</string></field>
+ <field name="description"><string>member membership type</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
+ <field name="type"><string>validator</string></field>
+ <field name="description"><string>validator membership type</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+
+ <field name="group">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>platform</string></field>
+ <field name="parentId"><string></string></field>
+ <field name="description"><string>the /platform group</string></field>
+ <field name="label"><string>Platform</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>administrators</string></field>
+ <field name="parentId"><string>/platform</string></field>
+ <field name="description"><string>the /platform/administrators group</string></field>
+ <field name="label"><string>Administrators</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>users</string></field>
+ <field name="parentId"><string>/platform</string></field>
+ <field name="description"><string>the /platform/users group</string></field>
+ <field name="label"><string>Users</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>guests</string></field>
+ <field name="parentId"><string>/platform</string></field>
+ <field name="description"><string>the /platform/guests group</string></field>
+ <field name="label"><string>Guests</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>organization</string></field>
+ <field name="parentId"><string></string></field>
+ <field name="description"><string>the organization group</string></field>
+ <field name="label"><string>Organization</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>management</string></field>
+ <field name="parentId"><string>/organization</string></field>
+ <field name="description"><string>the /organization/management group</string></field>
+ <field name="label"><string>Management</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>executive-board</string></field>
+ <field name="parentId"><string>/organization/management</string></field>
+ <field name="description"><string>the /organization/management/executive-board group</string></field>
+ <field name="label"><string>Executive Board</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>human-resources</string></field>
+ <field name="parentId"><string>/organization/management</string></field>
+ <field name="description"><string>the /organization/management/human-resource group</string></field>
+ <field name="label"><string>Human Resources</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>communication</string></field>
+ <field name="parentId"><string>/organization</string></field>
+ <field name="description"><string>the /organization/communication group</string></field>
+ <field name="label"><string>Communication</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>marketing</string></field>
+ <field name="parentId"><string>/organization/communication</string></field>
+ <field name="description"><string>the /organization/communication/marketing group</string></field>
+ <field name="label"><string>Marketing</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>press-and-media</string></field>
+ <field name="parentId"><string>/organization/communication</string></field>
+ <field name="description"><string>the /organization/communication/press-and-media group</string></field>
+ <field name="label"><string>Press and Media</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>operations</string></field>
+ <field name="parentId"><string>/organization</string></field>
+ <field name="description"><string>the /organization/operations and media group</string></field>
+ <field name="label"><string>Operations</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>sales</string></field>
+ <field name="parentId"><string>/organization/operations</string></field>
+ <field name="description"><string>the /organization/operations/sales group</string></field>
+ <field name="label"><string>Sales</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>finances</string></field>
+ <field name="parentId"><string>/organization/operations</string></field>
+ <field name="description"><string>the /organization/operations/finances group</string></field>
+ <field name="label"><string>Finances</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>customers</string></field>
+ <field name="parentId"><string></string></field>
+ <field name="description"><string>the /customers group</string></field>
+ <field name="label"><string>Customers</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>partners</string></field>
+ <field name="parentId"><string></string></field>
+ <field name="description"><string>the /partners group</string></field>
+ <field name="label"><string>Partners</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+
+ <field name="user">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>root</string></field>
+ <field name="password"><string>exo</string></field>
+ <field name="firstName"><string>Root</string></field>
+ <field name="lastName"><string>Root</string></field>
+ <field name="email"><string>root@localhost</string></field>
+ <field name="groups">
+ <string>
+ manager:/platform/administrators,member:/platform/users,
+ member:/organization/management/executive-board
+ </string>
+ </field>
+ </object>
+ </value>
+
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>john</string></field>
+ <field name="password"><string>exo</string></field>
+ <field name="firstName"><string>John</string></field>
+ <field name="lastName"><string>Anthony</string></field>
+ <field name="email"><string>john@localhost</string></field>
+ <field name="groups">
+ <string>
+ member:/platform/administrators,member:/platform/users,
+ manager:/organization/management/executive-board
+ </string>
+ </field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>marry</string></field>
+ <field name="password"><string>exo</string></field>
+ <field name="firstName"><string>Marry</string></field>
+ <field name="lastName"><string>Kelly</string></field>
+ <field name="email"><string>marry@localhost</string></field>
+ <field name="groups">
+ <string>member:/platform/users</string>
+ </field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>demo</string></field>
+ <field name="password"><string>exo</string></field>
+ <field name="firstName"><string>Demo</string></field>
+ <field name="lastName"><string>exo</string></field>
+ <field name="email"><string>demo@localhost</string></field>
+ <field name="groups">
+ <string>member:/platform/guests,member:/platform/users</string>
+ </field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+
+ <component-plugin>
+ <name>new.user.event.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.services.organization.impl.NewUserEventListener</type>
+ <description>this listener assign group and membership to a new created user</description>
+ <init-params>
+ <object-param>
+ <name>configuration</name>
+ <description>description</description>
+ <object type="org.exoplatform.services.organization.impl.NewUserConfig">
+ <field name="group">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.impl.NewUserConfig$JoinGroup">
+ <field name="groupId"><string>/platform/users</string></field>
+ <field name="membership"><string>member</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ <field name="ignoredUser">
+ <collection type="java.util.HashSet">
+ <value><string>root</string></value>
+ <value><string>john</string></value>
+ <value><string>marry</string></value>
+ <value><string>demo</string></value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+
+ </external-component-plugins>
+
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-04.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-04.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-04.xml 2010-05-06 11:53:08 UTC (rev 2351)
@@ -0,0 +1,134 @@
+<?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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
+
+ <component>
+ <key>org.exoplatform.services.ldap.LDAPService</key>
+ <type>org.exoplatform.services.ldap.impl.LDAPServiceImpl</type>
+ <init-params>
+ <object-param>
+ <name>ldap.config</name>
+ <description>Default ldap config</description>
+ <object type="org.exoplatform.services.ldap.impl.LDAPConnectionConfig">
+ <!-- for multiple ldap servers, use comma seperated list of host:port (Ex. ldap://127.0.0.1:389,10.0.0.1:389) -->
+ <!-- whether or not to enable ssl, if ssl is used ensure that the javax.net.ssl.keyStore & java.net.ssl.keyStorePassword properties are set -->
+ <!-- exo portal default installed javax.net.ssl.trustStore with file is java.home/lib/security/cacerts-->
+ <!-- ldap service will check protocol, if protocol is ldaps, ssl is enable (Ex. for enable ssl: ldaps://10.0.0.3:636 ;for disable ssl: ldap://10.0.0.3:389 ) -->
+ <!-- when enable ssl, ensure server name is *.directory and port (Ex. active.directory) -->
+ <field name="providerURL"><string>ldaps://10.0.0.3:636</string></field>
+ <field name="rootdn"><string>CN=Administrator,CN=Users, DC=exoplatform,DC=org</string></field>
+ <field name="password"><string>site</string></field>
+
+ <field name="version"><string>3</string></field>
+
+ <field name="minConnection"><int>5</int></field>
+
+ <field name="maxConnection"><int>10</int></field>
+
+ <field name="referralMode"><string>ignore</string></field>
+
+ <field name="serverName"><string>active.directory</string></field>
+
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.organization.OrganizationService</key>
+ <type>org.exoplatform.services.organization.ldap.OrganizationServiceImpl</type>
+ <component-plugins>
+ <component-plugin>
+ <name>init.service.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.services.organization.ldap.OrganizationLdapInitializer</type>
+ <description>this listener populate organization ldap service create default dn</description>
+ </component-plugin>
+ </component-plugins>
+ <init-params>
+ <object-param>
+ <name>ldap.attribute.mapping</name>
+ <description>ldap attribute mapping</description>
+ <object type="org.exoplatform.services.organization.ldap.LDAPAttributeMapping">
+ <field name="userLDAPClasses"><string>top,person,organizationalPerson,user</string></field>
+ <field name="profileLDAPClasses"><string>top,organizationalPerson</string></field>
+ <field name="groupLDAPClasses"><string>top,organizationalUnit</string></field>
+ <field name="membershipTypeLDAPClasses"><string>top,group</string></field>
+ <field name="membershipLDAPClasses"><string>top,group</string></field>
+
+ <field name="baseURL"><string>dc=exoplatform,dc=org</string></field>
+ <field name="groupsURL"><string>ou=groups,ou=portal,dc=exoplatform,dc=org</string></field>
+ <field name="membershipTypeURL"><string>ou=memberships,ou=portal,dc=exoplatform,dc=org</string></field>
+ <field name="userURL"><string>ou=users,ou=portal,dc=exoplatform,dc=org</string></field>
+ <field name="profileURL"><string>ou=profiles,ou=portal,dc=exoplatform,dc=org</string></field>
+
+ <field name="userAuthenticationAttr"><string>mail</string></field>
+ <field name="userUsernameAttr"><string>sAMAccountName</string></field>
+ <field name="userPassword"><string>unicodePwd</string></field>
+ <!--unicodePwd-->
+ <field name="userFirstNameAttr"><string>givenName</string></field>
+ <field name="userLastNameAttr"><string>sn</string></field>
+ <field name="userDisplayNameAttr"><string>displayName</string></field>
+ <field name="userMailAttr"><string>mail</string></field>
+ <field name="userObjectClassFilter"><string>objectClass=user</string></field>
+
+ <field name="membershipTypeMemberValue"><string>member</string></field>
+ <field name="membershipTypeRoleNameAttr"><string>cn</string></field>
+ <field name="membershipTypeNameAttr"><string>cn</string></field>
+ <field name="membershipTypeObjectClassFilter"><string>objectClass=group</string></field>
+ <field name="membershiptypeObjectClass"><string>group</string></field>
+
+ <field name="groupObjectClass"><string>organizationalUnit</string></field>
+ <field name="groupObjectClassFilter"><string>objectClass=organizationalUnit</string></field>
+
+ <field name="membershipObjectClass"><string>group</string></field>
+ <field name="membershipObjectClassFilter"><string>objectClass=group</string></field>
+
+ <field name="ldapCreatedTimeStampAttr"><string>createdTimeStamp</string></field>
+ <field name="ldapModifiedTimeStampAttr"><string>modifiedTimeStamp</string></field>
+ <field name="ldapDescriptionAttr"><string>description</string></field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+
+ <!--external-component-plugins>
+ <target-component>org.exoplatform.services.database.HibernateService</target-component>
+ <component-plugin>
+ <name>add.hibernate.mapping</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
+ <init-params>
+ <values-param>
+ <name>hibernate.mapping</name>
+ <value>org/exoplatform/services/organization/impl/UserProfileData.hbm.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins-->
+
+ <import>classpath:/conf/portal/organization-configuration.xml</import>
+
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-05.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-05.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-05.xml 2010-05-06 11:53:08 UTC (rev 2351)
@@ -0,0 +1,168 @@
+<?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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
+
+ <component>
+ <key>org.exoplatform.services.ldap.LDAPService</key>
+ <type>org.exoplatform.services.ldap.impl.LDAPServiceImpl</type>
+ <init-params>
+ <object-param>
+ <name>ldap.config</name>
+ <description>Default ldap config</description>
+ <object type="org.exoplatform.services.ldap.impl.LDAPConnectionConfig">
+
+ <!-- for multiple ldap servers, use comma seperated list of host:port (Ex. ldap://127.0.0.1:389,10.0.0.1:389) -->
+ <field name="providerURL"><string>ldap://127.0.0.1:389,10.0.0.1:389</string></field>
+
+ <field name="rootdn"><string>CN=Manager,DC=exoplatform,DC=org</string></field>
+
+ <field name="password"><string>secret</string></field>
+
+ <field name="version"><string>3</string></field>
+
+ <field name="minConnection"><int>5</int></field>
+
+ <field name="maxConnection"><int>10</int></field>
+
+ <field name="referralMode"><string>follow</string></field>
+
+<!--
+ <field name="referralMode"><string>ignore</string></field>
+-->
+
+ <field name="serverName"><string>default</string></field>
+
+<!--
+ LDAP server names : default,
+ active.directory,
+ open.ldap,
+ netscape.directory,
+ redhat.directory;
+-->
+
+
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.organization.OrganizationService</key>
+ <type>org.exoplatform.services.organization.ldap.OrganizationServiceImpl</type>
+ <component-plugins>
+ <component-plugin>
+ <name>init.service.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.services.organization.ldap.OrganizationLdapInitializer</type>
+ <description>this listener populate organization ldap service create default dn</description>
+ </component-plugin>
+ </component-plugins>
+ <init-params>
+ <value-param>
+ <name>ldap.userDN.key</name>
+ <description>The key used to compose user DN</description>
+ <value>cn</value>
+ </value-param>
+
+ <object-param>
+ <name>ldap.attribute.mapping</name>
+ <description>ldap attribute mapping</description>
+ <object type="org.exoplatform.services.organization.ldap.LDAPAttributeMapping">
+ <field name="userLDAPClasses"><string>top,person,organizationalPerson,inetOrgPerson</string></field>
+ <field name="profileLDAPClasses"><string>top,organizationalPerson</string></field>
+ <field name="groupLDAPClasses"><string>top,organizationalUnit</string></field>
+ <field name="membershipTypeLDAPClasses"><string>top,organizationalRole</string></field>
+ <field name="membershipLDAPClasses"><string>top,groupOfNames</string></field>
+
+ <field name="baseURL"><string>dc=exoplatform,dc=org</string></field>
+ <field name="groupsURL"><string>ou=groups,ou=portal,dc=exoplatform,dc=org</string></field>
+ <field name="membershipTypeURL"><string>ou=memberships,ou=portal,dc=exoplatform,dc=org</string></field>
+ <field name="userURL"><string>ou=users,ou=portal,dc=exoplatform,dc=org</string></field>
+ <field name="profileURL"><string>ou=profiles,ou=portal,dc=exoplatform,dc=org</string></field>
+
+ <field name="userUsernameAttr"><string>uid</string></field>
+ <field name="userPassword"><string>userPassword</string></field>
+ <field name="userFirstNameAttr"><string>givenName</string></field>
+ <field name="userLastNameAttr"><string>sn</string></field>
+ <field name="userDisplayNameAttr"><string>displayName</string></field>
+ <field name="userMailAttr"><string>mail</string></field>
+ <field name="userObjectClassFilter"><string>objectClass=person</string></field>
+
+ <field name="membershipTypeMemberValue"><string>member</string></field>
+ <field name="membershipTypeRoleNameAttr"><string>cn</string></field>
+ <field name="membershipTypeNameAttr"><string>cn</string></field>
+ <field name="membershipTypeObjectClassFilter"><string>objectClass=organizationalRole</string></field>
+ <field name="membershiptypeObjectClass"><string>organizationalRole</string></field>
+
+ <field name="groupObjectClass"><string>organizationalUnit</string></field>
+ <field name="groupObjectClassFilter"><string>objectClass=organizationalUnit</string></field>
+
+ <field name="membershipObjectClass"><string>groupOfNames</string></field>
+ <field name="membershipObjectClassFilter"><string>objectClass=groupOfNames</string></field>
+
+ <field name="ldapCreatedTimeStampAttr"><string>createdTimeStamp</string></field>
+ <field name="ldapModifiedTimeStampAttr"><string>modifiedTimeStamp</string></field>
+ <field name="ldapDescriptionAttr"><string>description</string></field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.database.HibernateService</target-component>
+ <component-plugin>
+ <name>add.hibernate.mapping</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
+ <init-params>
+ <values-param>
+ <name>hibernate.mapping</name>
+ <value>org/exoplatform/services/organization/impl/UserProfileData.hbm.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+ <!-- for ldap clean database
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.ldap.LDAPService</target-component>
+ <component-plugin>
+ <name>delete.object</name>
+ <set-method>addDeleteObject</set-method>
+ <type>org.exoplatform.services.ldap.DeleteObjectCommand</type>
+ <init-params>
+ <values-param>
+ <name>objects.to.delete</name>
+ <value>cn=demo,ou=users,ou=portal,dc=exoplatform,dc=org</value>
+ <value>cn=test,ou=users,ou=portal,dc=exoplatform,dc=org</value>
+ <value>cn=Benj,ou=users,ou=portal,dc=exoplatform,dc=org</value>
+ <value>cn=tuan,ou=users,ou=portal,dc=exoplatform,dc=org</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+ -->
+
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-06.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-06.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-06.xml 2010-05-06 11:53:08 UTC (rev 2351)
@@ -0,0 +1,85 @@
+<?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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
+
+ <component>
+ <key>org.exoplatform.services.organization.OrganizationService</key>
+ <type>org.exoplatform.services.organization.jdbc.OrganizationServiceImpl</type>
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.listener.ListenerService</target-component>
+
+ <component-plugin>
+ <name>organization.user.preDelete</name>
+ <set-method>addListener</set-method>
+ <type>org.exoplatform.services.organization.jdbc.listeners.RemoveUserProfileListener</type>
+ </component-plugin>
+
+ <component-plugin>
+ <name>organization.user.postCreate</name>
+ <set-method>addListener</set-method>
+ <type>org.exoplatform.services.organization.jdbc.listeners.CreateUserListener</type>
+ </component-plugin>
+
+ <component-plugin>
+ <name>organization.user.preDelete</name>
+ <set-method>addListener</set-method>
+ <type>org.exoplatform.services.organization.jdbc.listeners.RemoveMembershipListener</type>
+ </component-plugin>
+
+ <component-plugin>
+ <name>organization.user.preDelete</name>
+ <set-method>addListener</set-method>
+ <type>org.exoplatform.portal.config.RemoveUserPortalConfigListener</type>
+ </component-plugin>
+
+ <component-plugin>
+ <name>organization.membershipType.preDelete</name>
+ <set-method>addListener</set-method>
+ <type>org.exoplatform.services.organization.jdbc.listeners.RemoveMembershipListener</type>
+ </component-plugin>
+
+ <component-plugin>
+ <name>organization.group.preDelete</name>
+ <set-method>addListener</set-method>
+ <type>org.exoplatform.services.organization.jdbc.listeners.RemoveMembershipListener</type>
+ </component-plugin>
+
+ <component-plugin>
+ <name>organization.group.preDelete</name>
+ <set-method>addListener</set-method>
+ <type>org.exoplatform.portal.config.RemoveGroupPortalConfigListener</type>
+ </component-plugin>
+
+ <component-plugin>
+ <name>organization.group.preDelete</name>
+ <set-method>addListener</set-method>
+ <type>org.exoplatform.services.organization.jdbc.listeners.RemoveGroupListener</type>
+ </component-plugin>
+
+ </external-component-plugins>
+
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-07.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-07.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-07.xml 2010-05-06 11:53:08 UTC (rev 2351)
@@ -0,0 +1,56 @@
+<?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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
+
+ <component>
+ <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+ <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>war:/conf/jcr/repository-configuration.xml</value>
+ </value-param>
+ <properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="persister-class-name" value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
+ <property name="source-name" value="jdbcexo"/>
+ <property name="dialect" value="hsqldb"/>
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.registry.RegistryService</type>
+ <init-params>
+ <properties-param>
+ <name>locations</name>
+ <property name="repository" value="system"/>
+ </properties-param>
+ </init-params>
+ </component>
+
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-08.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-08.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-08.xml 2010-05-06 11:53:08 UTC (rev 2351)
@@ -0,0 +1,47 @@
+<?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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
+
+ <component>
+ <key>org.exoplatform.services.mail.MailService</key>
+ <type>org.exoplatform.services.mail.impl.MailServiceImpl</type>
+ <init-params>
+ <properties-param>
+ <name>config</name>
+ <property name="mail.smtp.auth.username" value="exoservice(a)gmail.com" />
+ <property name="mail.smtp.auth.password" value="exoadmin" />
+ <property name="mail.smtp.host" value="smtp.gmail.com" />
+ <property name="mail.smtp.port" value="465" />
+ <property name="mail.smtp.starttls.enable" value="true" />
+ <property name="mail.smtp.auth" value="true" />
+ <property name="mail.smtp.debug" value="false" />
+ <property name="mail.smtp.socketFactory.port" value="465" />
+ <property name="mail.smtp.socketFactory.class" value="javax.net.ssl.SSLSocketFactory" />
+ <property name="mail.smtp.socketFactory.fallback" value="false" />
+ </properties-param>
+ </init-params>
+ </component>
+
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-09.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-09.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-09.xml 2010-05-06 11:53:08 UTC (rev 2351)
@@ -0,0 +1,82 @@
+<?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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator</target-component>
+ <component-plugin>
+ <name>addPaths</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.ext.hierarchy.impl.AddPathPlugin</type>
+ <init-params>
+ <object-param>
+ <name>cms.configuration</name>
+ <description>configuration for the cms path</description>
+ <object type="org.exoplatform.services.jcr.ext.hierarchy.impl.HierarchyConfig">
+ <field name="repository"><string>repository</string></field>
+ <field name="workspaces">
+ <collection type="java.util.ArrayList">
+ <value><string>collaboration</string></value>
+ </collection>
+ </field>
+ <field name="jcrPaths">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.jcr.ext.hierarchy.impl.HierarchyConfig$JcrPath">
+ <field name="alias"><string>usersPath</string></field>
+ <field name="path"><string>/Users</string></field>
+ <field name="permissions">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.jcr.ext.hierarchy.impl.HierarchyConfig$Permission">
+ <field name="identity"><string>*:/platform/administrators</string></field>
+ <field name="read"><string>true</string></field>
+ <field name="addNode"><string>true</string></field>
+ <field name="setProperty"><string>true</string></field>
+ <field name="remove"><string>true</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.jcr.ext.hierarchy.impl.HierarchyConfig$Permission">
+ <field name="identity"><string>*:/platform/users</string></field>
+ <field name="read"><string>true</string></field>
+ <field name="addNode"><string>false</string></field>
+ <field name="setProperty"><string>true</string></field>
+ <field name="remove"><string>false</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-10.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-10.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-10.xml 2010-05-06 11:53:08 UTC (rev 2351)
@@ -0,0 +1,56 @@
+<?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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
+
+ <component>
+ <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+ <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>war:/conf/jcr/repository-configuration.xml</value>
+ </value-param>
+ <properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="persister-class-name" value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
+ <property name="source-name" value="jdbcexo"/>
+ <property name="dialect" value="hsqldb"/>
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.registry.RegistryService</type>
+ <init-params>
+ <properties-param>
+ <name>locations</name>
+ <property name="repository" value="system"/>
+ </properties-param>
+ </init-params>
+ </component>
+
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-11.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-11.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-11.xml 2010-05-06 11:53:08 UTC (rev 2351)
@@ -0,0 +1,101 @@
+<?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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
+
+ <component>
+ <key>org.exoplatform.services.database.HibernateService</key>
+ <jmx-name>database:type=HibernateService</jmx-name>
+ <type>org.exoplatform.services.database.impl.HibernateServiceImpl</type>
+ <init-params>
+ <properties-param>
+ <name>hibernate.properties</name>
+ <description>Default Hibernate Service</description>
+ <property name="hibernate.show_sql" value="false"/>
+ <property name="hibernate.cglib.use_reflection_optimizer" value="true"/>
+ <property name="hibernate.connection.url" value="jdbc:hsqldb:file:../temp/data/exodb"/>
+ <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
+ <property name="hibernate.connection.autocommit" value="true"/>
+ <property name="hibernate.connection.username" value="sa"/>
+ <property name="hibernate.connection.password" value=""/>
+ <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
+ <property name="hibernate.c3p0.min_size" value="5"/>
+ <property name="hibernate.c3p0.max_size" value="20"/>
+ <property name="hibernate.c3p0.timeout" value="1800"/>
+ <property name="hibernate.c3p0.max_statements" value="50"/>
+ </properties-param>
+ </init-params>
+ </component>
+
+ <!--
+ <component>
+ <key>org.exoplatform.services.database.DatabaseService</key>
+ <type>org.exoplatform.services.database.impl.XAPoolTxSupportDatabaseService</type>
+ <init-params>
+ <properties-param>
+ <name>default</name>
+ <description>Connection configuration</description>
+ <property name='connection.driver' value='org.hsqldb.jdbcDriver'/>
+ <property name='connection.url' value='jdbc:hsqldb:file:../temp/data/exodb'/>
+ <property name='connection.login' value='sa'/>
+ <property name='connection.password' value=''/>
+ <property name='connection.min-size' value='3'/>
+ <property name='connection.max-size' value='5'/>
+ </properties-param>
+ </init-params>
+ </component>
+ -->
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcexo</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:file:../temp/data/exodb"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-12.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-12.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-12.xml 2010-05-06 11:53:08 UTC (rev 2351)
@@ -0,0 +1,154 @@
+<?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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
+
+ <component>
+ <type>org.exoplatform.services.portletcontainer.PortletContainerConf</type>
+ <init-params>
+ <object-param>
+ <name>conf</name>
+ <object type="org.exoplatform.services.portletcontainer.PortletContainer">
+ <field name="global">
+ <object type="org.exoplatform.services.portletcontainer.config.Global">
+ <field name="name"><string>ExoPortletContainer</string></field>
+ <field name="description">
+ <string>A JSR 286 compliant portlet container </string>
+ </field>
+ <field name="majorVersion"><int>2</int></field>
+ <field name="minorVersion"><int>0</int></field>
+ </object>
+ </field>
+ <field name="bundle">
+ <object type="org.exoplatform.services.portletcontainer.config.DelegatedBundle">
+ <field name="enable"><string>true</string></field>
+ </object>
+ </field>
+ <field name="cache">
+ <object type="org.exoplatform.services.portletcontainer.config.Cache">
+ <field name="enable"><string>true</string></field>
+ </object>
+ </field>
+ <field name="supportedContent">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.portletcontainer.config.SupportedContent">
+ <field name="name"><string>text/html</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.portletcontainer.config.SupportedContent">
+ <field name="name"> <string>text/wml</string> </field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.portletcontainer.config.SupportedContent">
+ <field name="name"> <string>audio/x-mpeg</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.portletcontainer.config.SupportedContent">
+ <field name="name"> <string>image/bmp</string> </field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.portletcontainer.config.SupportedContent">
+ <field name="name"> <string>image/jpg</string> </field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.portletcontainer.config.SupportedContent">
+ <field name="name"> <string>image/jpeg</string> </field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.portletcontainer.config.SupportedContent">
+ <field name="name"> <string>image/gif</string> </field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ <field name="customMode">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.portletcontainer.config.CustomMode">
+ <field name="name"> <string>config</string> </field>
+ <field name="description">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.portletcontainer.config.Description">
+ <field name="lang"> <string>en</string></field>
+ <field name="description"><string>to let admin config portlets </string> </field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.portletcontainer.config.Description">
+ <field
+ name="lang">
+ <string>
+ fr
+ </string>
+ </field>
+ <field
+ name="description">
+ <string>
+ permet de
+ configurer
+ les portlets
+ </string>
+ </field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ <field name="properties">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object
+ type="org.exoplatform.services.portletcontainer.config.Properties">
+ <field name="description">
+ <string>
+ a testing property
+ </string>
+ </field>
+ <field name="name">
+ <string>test</string>
+ </field>
+ <field name="value">
+ <string>test_value</string>
+ </field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-13.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-13.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-13.xml 2010-05-06 11:53:08 UTC (rev 2351)
@@ -0,0 +1,53 @@
+<?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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
+
+ <import>war:/conf/common/common-configuration.xml</import>
+ <import>war:/conf/common/logs-configuration.xml</import>
+ <import>war:/conf/database/database-configuration.xml</import>
+ <import>war:/conf/jcr/jcr-configuration.xml</import>
+ <import>war:/conf/common/portlet-container-configuration.xml</import>
+
+ <!--if organization service is database, import hibernate-organization-configuration.xml-->
+ <import>war:/conf/organization/hibernate-configuration.xml</import>
+
+ <!-- <import>war:/conf/jdbc-configuration.xml</import> -->
+ <!--for organization service used active directory which is user lookup server -->
+ <!--
+ <import>war:/conf/activedirectory-configuration.xml</import>
+ -->
+
+ <!--for organization service used ldap server which is user lookup server -->
+ <!--
+ <import>war:/conf/ldap-configuration.xml</import>
+ -->
+ <!-- <import>war:/conf/security-configuration.xml</import> -->
+ <import>war:/conf/organization/organization-configuration.xml</import>
+ <import>war:/conf/jcr/component-plugins-configuration.xml</import>
+ <import>war:/conf/mail/portal-mail-configuration.xml</import>
+ <import>war:/conf/portal/portal-configuration.xml</import>
+ <import>war:/conf/portal/application-registry-configuration.xml</import>
+
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-14.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-14.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-14.xml 2010-05-06 11:53:08 UTC (rev 2351)
@@ -0,0 +1,42 @@
+<?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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
+
+ <component>
+ <key>org.exoplatform.services.security.SecurityService</key>
+ <type>org.exoplatform.services.security.impl.SecurityServiceImpl</type>
+ <init-params>
+ <value-param>
+ <name>security.authentication</name>
+ <value>sso</value>
+ </value-param>
+ <value-param>
+ <name>security.sso-authentication</name>
+ <value>cas</value>
+ </value-param>
+ </init-params>
+ </component>
+
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-15.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-15.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-15.xml 2010-05-06 11:53:08 UTC (rev 2351)
@@ -0,0 +1,68 @@
+<?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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
+
+ <component>
+ <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
+ <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
+ <init-params>
+
+ <!-- JDK -->
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Jdk14Configurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>jdk1.4 Logger properties</description>
+ <property name="handlers" value="java.util.logging.ConsoleHandler"/>
+ <property name=".level" value="FINE"/>
+ <property name="java.util.logging.ConsoleHandler.level" value="FINE"/>
+ </properties-param>
+ <!-- end JDK -->
+ <!-- Log4J -->
+ <!--
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>Log4J properties</description>
+ <property name="log4j.rootLogger" value="DEBUG, stdout, file"/>
+ <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender"/>
+ <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout"/>
+ <property name="log4j.appender.stdout.layout.ConversionPattern" value="%d {dd.MM.yyyy HH:mm:ss} %c {1}: %m (%F, line %L) %n"/>
+ <property name="log4j.appender.file" value="org.apache.log4j.FileAppender"/>
+ <property name="log4j.appender.file.File" value="jcr.log"/>
+ <property name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout"/>
+ <property name="log4j.appender.file.layout.ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} %m (%F, line %L) %n"/>
+ </properties-param>
+ -->
+ <!-- end Log4J-->
+ </init-params>
+ </component>
+
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-16.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-16.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-16.xml 2010-05-06 11:53:08 UTC (rev 2351)
@@ -0,0 +1,105 @@
+<?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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
+
+ <component>
+ <key>org.exoplatform.services.naming.InitialContextInitializer</key>
+ <type>org.exoplatform.services.naming.InitialContextInitializer</type>
+ <init-params>
+ <properties-param>
+ <name>default-properties</name>
+ <description>Default initial context properties</description>
+ <!--
+ <property name="java.naming.factory.initial" value="org.exoplatform.services.naming.SimpleContextFactory"/>
+ -->
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.resources.LocaleConfigService</key>
+ <type>org.exoplatform.services.resources.impl.LocaleConfigServiceImpl</type>
+ <init-params>
+ <value-param>
+ <name>locale.config.file</name>
+ <value>war:/conf/common/locales-config.xml</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.resources.ResourceBundleService</key>
+ <type>org.exoplatform.services.resources.jcr.ResourceBundleServiceImpl</type>
+ <init-params>
+ <values-param>
+ <name>classpath.resources</name>
+ <description>The resources that start with the following package name should be load from file system</description>
+ <value>locale.portlet</value>
+ </values-param>
+ <values-param>
+ <name>init.resources</name>
+ <description>Store the following resources into the db for the first launch </description>
+ <value>locale.portal.expression</value>
+ <value>locale.portal.services</value>
+ <value>locale.portal.webui</value>
+ <value>locale.portal.custom</value>
+ <value>locale.navigation.portal.classic</value>
+ <value>locale.navigation.group.platform.administrators</value>
+ <value>locale.navigation.group.platform.users</value>
+ <value>locale.navigation.group.platform.guests</value>
+ <value>locale.navigation.group.organization.management.executive-board</value>
+ </values-param>
+ <values-param>
+ <name>portal.resource.names</name>
+ <description>The properties files of the portal , those file will be merged
+ into one ResoruceBundle properties </description>
+ <value>locale.portal.expression</value>
+ <value>locale.portal.services</value>
+ <value>locale.portal.webui</value>
+ <value>locale.portal.custom</value>
+ </values-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.cache.CacheService</key>
+ <jmx-name>cache:type=CacheService</jmx-name>
+ <type>org.exoplatform.services.cache.impl.CacheServiceImpl</type>
+ <init-params>
+ <object-param>
+ <name>cache.config.default</name>
+ <description>The default cache configuration</description>
+ <object type="org.exoplatform.services.cache.ExoCacheConfig">
+ <field name="name"><string>default</string></field>
+ <field name="maxSize"><int>300</int></field>
+ <field name="liveTime"><long>-1</long></field>
+ <field name="distributed"><boolean>false</boolean></field>
+ <field name="implementation"><string>org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache</string></field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-17.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-17.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-17.xml 2010-05-06 11:53:08 UTC (rev 2351)
@@ -0,0 +1,87 @@
+<?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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
+
+ <component>
+ <key>org.exoplatform.services.naming.InitialContextInitializer</key>
+ <type>org.exoplatform.services.naming.InitialContextInitializer</type>
+ <init-params>
+ <object-param>
+ <name>configuration</name>
+ <object type="org.exoplatform.services.organization.idm.Config">
+ <field name="typeMappings">
+ <map type="java">
+ <entry>
+ <key><string>/</string></key>
+ <value><string>root</string></value>
+ </entry>
+ </map>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+</component>
+
+<component>
+<key>org.exoplatform.services.naming.InitialContextInitializer</key>
+<type>org.exoplatform.services.naming.InitialContextInitializer</type>
+<init-params>
+ <object-param>
+ <name>configuration</name>
+ <object type="package.name">
+ <field name="string"><string>This is a string</string></field>
+ <field name="int"><int>1234</int></field>
+ <field name="long"><long>123456</long></field>
+ <field name="double"><double>1.1234</double></field>
+ <field name="boolean"><boolean>true</boolean></field>
+ <field name="name">
+ <object type="package.name">
+ <field name="nested 1"><string>value</string></field>
+ <field name="nested 2"><int>1234</int></field>
+ </object>
+ </field>
+ <field name="map">
+ <map type="java.util.HashMap">
+ <entry>
+ <key><string>akey</string></key>
+ <value><string>a value</string></value>
+ </entry>
+ <entry>
+ <key><int>1234</int></key>
+ <value><string>a value</string></value>
+ </entry>
+ </map>
+ </field>
+ <field name="list">
+ <collection type="java.util.ArrayList">
+ <value><string>a value</string></value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+</init-params>
+</component>
+
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-18.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-18.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-18.xml 2010-05-06 11:53:08 UTC (rev 2351)
@@ -0,0 +1,95 @@
+<?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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
+
+ <component>
+ <key>org.exoplatform.services.naming.InitialContextInitializer</key>
+ <type>org.exoplatform.services.naming.InitialContextInitializer</type>
+ </component>
+
+ <component profiles="a">
+ <key>org.exoplatform.services.naming.InitialContextInitializer</key>
+ <type>org.exoplatform.services.naming.InitialContextInitializer</type>
+ </component>
+
+ <component profiles="a,b">
+ <key>org.exoplatform.services.naming.InitialContextInitializer</key>
+ <type>org.exoplatform.services.naming.InitialContextInitializer</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.naming.InitialContextInitializer</key>
+ <type>org.exoplatform.services.naming.InitialContextInitializer</type>
+ <init-params>
+ <object-param>
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
+ <object-param profiles="a">
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
+ <object-param profiles="a,b">
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
+ <properties-param>
+ <name>properties</name>
+ </properties-param>
+ <properties-param profiles="a">
+ <name>properties</name>
+ </properties-param>
+ <properties-param profiles="a,b">
+ <name>properties</name>
+ </properties-param>
+ <value-param>
+ <name>value</name>
+ <value>value</value>
+ </value-param>
+ <value-param profiles="a">
+ <name>value</name>
+ <value>value</value>
+ </value-param>
+ <value-param profiles="a,b">
+ <name>value</name>
+ <value>value</value>
+ </value-param>
+ <values-param>
+ <name>values</name>
+ </values-param>
+ <values-param profiles="a">
+ <name>values</name>
+ </values-param>
+ <values-param profiles="a,b">
+ <name>values</name>
+ </values-param>
+ </init-params>
+ </component>
+
+ <import>import_1</import>
+ <import profiles="a">import_1</import>
+ <import profiles="a,b">import_1</import>
+
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-19.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-19.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-19.xml 2010-05-06 11:53:08 UTC (rev 2351)
@@ -0,0 +1,29 @@
+<?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.
+ -->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
+ <container-lifecycle-plugin>
+ <type>org.exoplatform.container.TestExoContainer$MyContainerLifecyclePlugin1</type>
+ </container-lifecycle-plugin>
+ <container-lifecycle-plugin>
+ <name>MyContainerLifecyclePlugin2</name>
+ <type>org.exoplatform.container.TestExoContainer$MyContainerLifecyclePlugin2</type>
+ <description>The description of the plugin</description>
+ <priority>10</priority>
+ <init-params>
+ <value-param>
+ <name>param</name>
+ <description>a test parameter</description>
+ <value>value</value>
+ </value-param>
+ </init-params>
+ </container-lifecycle-plugin>
+
+</configuration>
\ No newline at end of file
16 years, 2 months
exo-jcr SVN: r2350 - in jcr/branches/1.12-LIC-701: applications and 24 other directories.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2010-05-05 06:06:50 -0400 (Wed, 05 May 2010)
New Revision: 2350
Modified:
jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.backupconsole/bin/jcrbackup.cmd
jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.backupconsole/bin/jcrbackup.sh
jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.backupconsole/pom.xml
jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.browser/pom.xml
jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.config/pom.xml
jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.fckeditor/pom.xml
jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.rest/pom.xml
jcr/branches/1.12-LIC-701/applications/exo.jcr.cluster.testclient/pom.xml
jcr/branches/1.12-LIC-701/applications/exo.jcr.ear/pom.xml
jcr/branches/1.12-LIC-701/applications/pom.xml
jcr/branches/1.12-LIC-701/applications/product-exo-jcr-as-jboss-ear.xml
jcr/branches/1.12-LIC-701/applications/product-exo-jcr-as-jonas-ear.xml
jcr/branches/1.12-LIC-701/applications/product-exo-jcr-as-tomcat6.xml
jcr/branches/1.12-LIC-701/docs/pom.xml
jcr/branches/1.12-LIC-701/docs/reference/en/pom.xml
jcr/branches/1.12-LIC-701/docs/reference/pom.xml
jcr/branches/1.12-LIC-701/docs/userguide/en/pom.xml
jcr/branches/1.12-LIC-701/docs/userguide/pom.xml
jcr/branches/1.12-LIC-701/exo.jcr.component.core/pom.xml
jcr/branches/1.12-LIC-701/exo.jcr.component.ext/pom.xml
jcr/branches/1.12-LIC-701/exo.jcr.component.ftp/pom.xml
jcr/branches/1.12-LIC-701/exo.jcr.component.statistics/pom.xml
jcr/branches/1.12-LIC-701/exo.jcr.component.webdav/pom.xml
jcr/branches/1.12-LIC-701/exo.jcr.connectors.localadapter/pom.xml
jcr/branches/1.12-LIC-701/exo.jcr.connectors.localadapter/src/main/rar/META-INF/ra.xml
jcr/branches/1.12-LIC-701/exo.jcr.framework.command/pom.xml
jcr/branches/1.12-LIC-701/exo.jcr.framework.ftpclient/pom.xml
jcr/branches/1.12-LIC-701/exo.jcr.framework.web/pom.xml
jcr/branches/1.12-LIC-701/packaging/module/pom.xml
jcr/branches/1.12-LIC-701/pom.xml
Log:
EXOJCR-701 versions in branch files
Modified: jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.backupconsole/bin/jcrbackup.cmd
===================================================================
--- jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.backupconsole/bin/jcrbackup.cmd 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.backupconsole/bin/jcrbackup.cmd 2010-05-05 10:06:50 UTC (rev 2350)
@@ -1 +1 @@
-java -jar exo.jcr.applications.backupconsole-1.12.1-GA-SNAPSHOT.jar %*
+java -jar exo.jcr.applications.backupconsole-1.12-LIC-701-SNAPSHOT.jar %*
Modified: jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.backupconsole/bin/jcrbackup.sh
===================================================================
--- jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.backupconsole/bin/jcrbackup.sh 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.backupconsole/bin/jcrbackup.sh 2010-05-05 10:06:50 UTC (rev 2350)
@@ -1,3 +1,3 @@
#!/bin/sh
-java -jar exo.jcr.applications.backupconsole-1.12.1-GA-SNAPSHOT.jar $*
+java -jar exo.jcr.applications.backupconsole-1.12-LIC-701-SNAPSHOT.jar $*
Modified: jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.backupconsole/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.backupconsole/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.backupconsole/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-applications-parent</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.applications.backupconsole</artifactId>
<name>eXo JCR :: Applications :: Backup Console</name>
Modified: jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.browser/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.browser/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.browser/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-applications-parent</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.applications.browser</artifactId>
<packaging>war</packaging>
Modified: jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.config/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.config/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.config/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-applications-parent</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.applications.config</artifactId>
<packaging>pom</packaging>
Modified: jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.fckeditor/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.fckeditor/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.fckeditor/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-applications-parent</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.applications.fckeditor</artifactId>
<packaging>war</packaging>
Modified: jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.rest/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.rest/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/applications/exo.jcr.applications.rest/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-applications-parent</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.applications.rest</artifactId>
<packaging>war</packaging>
Modified: jcr/branches/1.12-LIC-701/applications/exo.jcr.cluster.testclient/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/applications/exo.jcr.cluster.testclient/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/applications/exo.jcr.cluster.testclient/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-applications-parent</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.cluster.testclient</artifactId>
<name>eXo JCR :: Cluster :: Test Client</name>
Modified: jcr/branches/1.12-LIC-701/applications/exo.jcr.ear/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/applications/exo.jcr.ear/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/applications/exo.jcr.ear/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-applications-parent</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.ear</artifactId>
<packaging>ear</packaging>
Modified: jcr/branches/1.12-LIC-701/applications/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/applications/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/applications/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -22,12 +22,12 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jcr-applications-parent</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
<name>eXo JCR :: Applications :: Reactor</name>
<packaging>pom</packaging>
Modified: jcr/branches/1.12-LIC-701/applications/product-exo-jcr-as-jboss-ear.xml
===================================================================
--- jcr/branches/1.12-LIC-701/applications/product-exo-jcr-as-jboss-ear.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/applications/product-exo-jcr-as-jboss-ear.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.applications.config</artifactId>
- <version>1.12.1-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -40,7 +40,7 @@
<dependency>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.ear</artifactId>
- <version>1.12.1-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
<type>ear</type>
<scope>runtime</scope>
</dependency>
Modified: jcr/branches/1.12-LIC-701/applications/product-exo-jcr-as-jonas-ear.xml
===================================================================
--- jcr/branches/1.12-LIC-701/applications/product-exo-jcr-as-jonas-ear.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/applications/product-exo-jcr-as-jonas-ear.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.applications.config</artifactId>
- <version>1.12.1-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -40,7 +40,7 @@
<dependency>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.ear</artifactId>
- <version>1.12.1-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
<type>ear</type>
<scope>runtime</scope>
</dependency>
Modified: jcr/branches/1.12-LIC-701/applications/product-exo-jcr-as-tomcat6.xml
===================================================================
--- jcr/branches/1.12-LIC-701/applications/product-exo-jcr-as-tomcat6.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/applications/product-exo-jcr-as-tomcat6.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.applications.config</artifactId>
- <version>1.12.1-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
<relativePath>exo.jcr.applications.config</relativePath>
</parent>
Modified: jcr/branches/1.12-LIC-701/docs/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/docs/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/docs/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: jcr/branches/1.12-LIC-701/docs/reference/en/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/docs/reference/en/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/docs/reference/en/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>reference-docs</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: jcr/branches/1.12-LIC-701/docs/reference/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/docs/reference/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/docs/reference/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>docs</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: jcr/branches/1.12-LIC-701/docs/userguide/en/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/docs/userguide/en/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/docs/userguide/en/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>userguide-docs</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: jcr/branches/1.12-LIC-701/docs/userguide/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/docs/userguide/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/docs/userguide/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>docs</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: jcr/branches/1.12-LIC-701/exo.jcr.component.core/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/exo.jcr.component.core/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/exo.jcr.component.core/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.component.core</artifactId>
<name>eXo JCR :: Component :: Core Service</name>
Modified: jcr/branches/1.12-LIC-701/exo.jcr.component.ext/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/exo.jcr.component.ext/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/exo.jcr.component.ext/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.component.ext</artifactId>
<name>eXo JCR :: Component :: Extension Service</name>
Modified: jcr/branches/1.12-LIC-701/exo.jcr.component.ftp/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/exo.jcr.component.ftp/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/exo.jcr.component.ftp/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.component.ftp</artifactId>
<name>eXo JCR :: Component :: FTP Service</name>
Modified: jcr/branches/1.12-LIC-701/exo.jcr.component.statistics/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/exo.jcr.component.statistics/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/exo.jcr.component.statistics/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.component.statistics</artifactId>
<name>eXo JCR :: Component :: Statistics Provider</name>
Modified: jcr/branches/1.12-LIC-701/exo.jcr.component.webdav/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/exo.jcr.component.webdav/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/exo.jcr.component.webdav/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.component.webdav</artifactId>
<name>eXo JCR :: Component :: Webdav Service</name>
Modified: jcr/branches/1.12-LIC-701/exo.jcr.connectors.localadapter/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/exo.jcr.connectors.localadapter/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/exo.jcr.connectors.localadapter/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.connectors.localadapter</artifactId>
<packaging>rar</packaging>
Modified: jcr/branches/1.12-LIC-701/exo.jcr.connectors.localadapter/src/main/rar/META-INF/ra.xml
===================================================================
--- jcr/branches/1.12-LIC-701/exo.jcr.connectors.localadapter/src/main/rar/META-INF/ra.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/exo.jcr.connectors.localadapter/src/main/rar/META-INF/ra.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -25,7 +25,7 @@
<display-name>JCR repository</display-name>
<vendor-name>exoplatform</vendor-name>
<eis-type />
- <resourceadapter-version>1.12.1-GA-SNAPSHOT</resourceadapter-version>
+ <resourceadapter-version>1.12-LIC-701-SNAPSHOT</resourceadapter-version>
<license>
<license-required>false</license-required>
</license>
Modified: jcr/branches/1.12-LIC-701/exo.jcr.framework.command/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/exo.jcr.framework.command/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/exo.jcr.framework.command/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -12,7 +12,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.framework.command</artifactId>
<name>eXo JCR :: Framework :: Command</name>
Modified: jcr/branches/1.12-LIC-701/exo.jcr.framework.ftpclient/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/exo.jcr.framework.ftpclient/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/exo.jcr.framework.ftpclient/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.framework.ftpclient</artifactId>
<name>eXo JCR :: Framework :: FTP Client</name>
Modified: jcr/branches/1.12-LIC-701/exo.jcr.framework.web/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/exo.jcr.framework.web/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/exo.jcr.framework.web/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<artifactId>exo.jcr.framework.web</artifactId>
<name>eXo JCR :: Framework :: Web</name>
Modified: jcr/branches/1.12-LIC-701/packaging/module/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/packaging/module/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/packaging/module/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
</parent>
<artifactId>jcr.packaging.module</artifactId>
<packaging>pom</packaging>
Modified: jcr/branches/1.12-LIC-701/pom.xml
===================================================================
--- jcr/branches/1.12-LIC-701/pom.xml 2010-05-05 09:54:30 UTC (rev 2349)
+++ jcr/branches/1.12-LIC-701/pom.xml 2010-05-05 10:06:50 UTC (rev 2350)
@@ -29,7 +29,7 @@
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
- <version>1.12.2-GA-SNAPSHOT</version>
+ <version>1.12-LIC-701-SNAPSHOT</version>
<packaging>pom</packaging>
<name>eXo JCR</name>
16 years, 2 months
exo-jcr SVN: r2349 - in jcr/trunk: applications/exo.jcr.applications.backupconsole/bin and 1 other directories.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2010-05-05 05:54:30 -0400 (Wed, 05 May 2010)
New Revision: 2349
Modified:
jcr/trunk/applications/exo.jcr.applications.backupconsole/bin/jcrbackup.cmd
jcr/trunk/applications/exo.jcr.applications.backupconsole/bin/jcrbackup.sh
jcr/trunk/applications/product-exo-jcr-as-jboss-ear.xml
jcr/trunk/applications/product-exo-jcr-as-jonas-ear.xml
jcr/trunk/applications/product-exo-jcr-as-tomcat6.xml
jcr/trunk/exo.jcr.connectors.localadapter/src/main/rar/META-INF/ra.xml
Log:
EXOJCR-682 versions in files
Modified: jcr/trunk/applications/exo.jcr.applications.backupconsole/bin/jcrbackup.cmd
===================================================================
--- jcr/trunk/applications/exo.jcr.applications.backupconsole/bin/jcrbackup.cmd 2010-05-04 17:28:47 UTC (rev 2348)
+++ jcr/trunk/applications/exo.jcr.applications.backupconsole/bin/jcrbackup.cmd 2010-05-05 09:54:30 UTC (rev 2349)
@@ -1 +1 @@
-java -jar exo.jcr.applications.backupconsole-1.12.1-GA-SNAPSHOT.jar %*
+java -jar exo.jcr.applications.backupconsole-1.12.2-GA-SNAPSHOT.jar %*
Modified: jcr/trunk/applications/exo.jcr.applications.backupconsole/bin/jcrbackup.sh
===================================================================
--- jcr/trunk/applications/exo.jcr.applications.backupconsole/bin/jcrbackup.sh 2010-05-04 17:28:47 UTC (rev 2348)
+++ jcr/trunk/applications/exo.jcr.applications.backupconsole/bin/jcrbackup.sh 2010-05-05 09:54:30 UTC (rev 2349)
@@ -1,3 +1,3 @@
#!/bin/sh
-java -jar exo.jcr.applications.backupconsole-1.12.1-GA-SNAPSHOT.jar $*
+java -jar exo.jcr.applications.backupconsole-1.12.2-GA-SNAPSHOT.jar $*
Modified: jcr/trunk/applications/product-exo-jcr-as-jboss-ear.xml
===================================================================
--- jcr/trunk/applications/product-exo-jcr-as-jboss-ear.xml 2010-05-04 17:28:47 UTC (rev 2348)
+++ jcr/trunk/applications/product-exo-jcr-as-jboss-ear.xml 2010-05-05 09:54:30 UTC (rev 2349)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.applications.config</artifactId>
- <version>1.12.1-GA-SNAPSHOT</version>
+ <version>1.12.2-GA-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -40,7 +40,7 @@
<dependency>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.ear</artifactId>
- <version>1.12.1-GA-SNAPSHOT</version>
+ <version>1.12.2-GA-SNAPSHOT</version>
<type>ear</type>
<scope>runtime</scope>
</dependency>
Modified: jcr/trunk/applications/product-exo-jcr-as-jonas-ear.xml
===================================================================
--- jcr/trunk/applications/product-exo-jcr-as-jonas-ear.xml 2010-05-04 17:28:47 UTC (rev 2348)
+++ jcr/trunk/applications/product-exo-jcr-as-jonas-ear.xml 2010-05-05 09:54:30 UTC (rev 2349)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.applications.config</artifactId>
- <version>1.12.1-GA-SNAPSHOT</version>
+ <version>1.12.2-GA-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -40,7 +40,7 @@
<dependency>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.ear</artifactId>
- <version>1.12.1-GA-SNAPSHOT</version>
+ <version>1.12.2-GA-SNAPSHOT</version>
<type>ear</type>
<scope>runtime</scope>
</dependency>
Modified: jcr/trunk/applications/product-exo-jcr-as-tomcat6.xml
===================================================================
--- jcr/trunk/applications/product-exo-jcr-as-tomcat6.xml 2010-05-04 17:28:47 UTC (rev 2348)
+++ jcr/trunk/applications/product-exo-jcr-as-tomcat6.xml 2010-05-05 09:54:30 UTC (rev 2349)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.applications.config</artifactId>
- <version>1.12.1-GA-SNAPSHOT</version>
+ <version>1.12.2-GA-SNAPSHOT</version>
<relativePath>exo.jcr.applications.config</relativePath>
</parent>
Modified: jcr/trunk/exo.jcr.connectors.localadapter/src/main/rar/META-INF/ra.xml
===================================================================
--- jcr/trunk/exo.jcr.connectors.localadapter/src/main/rar/META-INF/ra.xml 2010-05-04 17:28:47 UTC (rev 2348)
+++ jcr/trunk/exo.jcr.connectors.localadapter/src/main/rar/META-INF/ra.xml 2010-05-05 09:54:30 UTC (rev 2349)
@@ -25,7 +25,7 @@
<display-name>JCR repository</display-name>
<vendor-name>exoplatform</vendor-name>
<eis-type />
- <resourceadapter-version>1.12.1-GA-SNAPSHOT</resourceadapter-version>
+ <resourceadapter-version>1.12.2-GA-SNAPSHOT</resourceadapter-version>
<license>
<license-required>false</license-required>
</license>
16 years, 2 months
exo-jcr SVN: r2348 - in kernel/trunk/exo.kernel.container/src: main/java/org/exoplatform/container/jmx and 2 other directories.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-05-04 13:28:47 -0400 (Tue, 04 May 2010)
New Revision: 2348
Added:
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestExoContainer.java
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/test-exo-container.xml
Modified:
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/CachingContainer.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/jmx/MX4JComponentAdapter.java
Log:
EXOJCR-712:
1. CachingContainer: Make all the write methods Thread Safe to prevent race conditions and thread safety issues
2. MX4JComponentAdapter: Ensure that only one instance is created per adapter
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/CachingContainer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/CachingContainer.java 2010-04-30 18:16:15 UTC (rev 2347)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/CachingContainer.java 2010-05-04 17:28:47 UTC (rev 2348)
@@ -37,9 +37,15 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
+@SuppressWarnings("unchecked")
public class CachingContainer extends MCIntegrationContainer
{
+ /**
+ * Serial Version UID
+ */
+ private static final long serialVersionUID = 316388590860241305L;
+
private final ConcurrentMap<Class, ComponentAdapter> adapterByType =
new ConcurrentHashMap<Class, ComponentAdapter>();
@@ -171,67 +177,67 @@
//
- public ComponentAdapter registerComponent(ComponentAdapter componentAdapter)
+ public synchronized ComponentAdapter registerComponent(ComponentAdapter componentAdapter)
throws DuplicateComponentKeyRegistrationException
{
invalidate();
return super.registerComponent(componentAdapter);
}
- public ComponentAdapter unregisterComponent(Object componentKey)
+ public synchronized ComponentAdapter unregisterComponent(Object componentKey)
{
invalidate();
return super.unregisterComponent(componentKey);
}
- public ComponentAdapter registerComponentInstance(Object component) throws PicoRegistrationException
+ public synchronized ComponentAdapter registerComponentInstance(Object component) throws PicoRegistrationException
{
invalidate();
return super.registerComponentInstance(component);
}
- public ComponentAdapter registerComponentInstance(Object componentKey, Object componentInstance)
+ public synchronized ComponentAdapter registerComponentInstance(Object componentKey, Object componentInstance)
throws PicoRegistrationException
{
invalidate();
return super.registerComponentInstance(componentKey, componentInstance);
}
- public ComponentAdapter registerComponentImplementation(Class componentImplementation)
+ public synchronized ComponentAdapter registerComponentImplementation(Class componentImplementation)
throws PicoRegistrationException
{
invalidate();
return super.registerComponentImplementation(componentImplementation);
}
- public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation)
+ public synchronized ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation)
throws PicoRegistrationException
{
invalidate();
return super.registerComponentImplementation(componentKey, componentImplementation);
}
- public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation,
+ public synchronized ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation,
Parameter[] parameters) throws PicoRegistrationException
{
invalidate();
return super.registerComponentImplementation(componentKey, componentImplementation, parameters);
}
- public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation,
+ public synchronized ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation,
List parameters) throws PicoRegistrationException
{
invalidate();
return super.registerComponentImplementation(componentKey, componentImplementation, parameters);
}
- public boolean addChildContainer(PicoContainer child)
+ public synchronized boolean addChildContainer(PicoContainer child)
{
invalidate();
return super.addChildContainer(child);
}
- public boolean removeChildContainer(PicoContainer child)
+ public synchronized boolean removeChildContainer(PicoContainer child)
{
invalidate();
return super.removeChildContainer(child);
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/jmx/MX4JComponentAdapter.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/jmx/MX4JComponentAdapter.java 2010-04-30 18:16:15 UTC (rev 2347)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/jmx/MX4JComponentAdapter.java 2010-05-04 17:28:47 UTC (rev 2348)
@@ -42,10 +42,16 @@
* @author Benjamin Mestrallet
* @version $Revision: 1.5 $
*/
+@SuppressWarnings("unchecked")
public class MX4JComponentAdapter extends AbstractComponentAdapter
{
- private Object instance_;
+ /**
+ * Serial Version ID
+ */
+ private static final long serialVersionUID = -9001193588034229411L;
+ private volatile Object instance_;
+
private Log log = ExoLogger.getLogger("exo.kernel.container.MX4JComponentAdapter");
public MX4JComponentAdapter(Object key, Class implementation)
@@ -58,31 +64,38 @@
if (instance_ != null)
return instance_;
- // Get the component
+ //
ExoContainer exocontainer = (ExoContainer)container;
- Object key = getComponentKey();
+ Component component = null;
+ ConfigurationManager manager;
String componentKey;
- if (key instanceof String)
- componentKey = (String)key;
- else
- componentKey = ((Class)key).getName();
- ConfigurationManager manager =
- (ConfigurationManager)exocontainer.getComponentInstanceOfType(ConfigurationManager.class);
- Component component = manager.getComponent(componentKey);
-
- //
try
{
InitParams params = null;
boolean debug = false;
- if (component != null)
+ synchronized (this)
{
- params = component.getInitParams();
- debug = component.getShowDeployInfo();
+ // Avoid to create duplicate instances if it is called at the same time by several threads
+ if (instance_ != null)
+ return instance_;
+ // Get the component
+ Object key = getComponentKey();
+ if (key instanceof String)
+ componentKey = (String)key;
+ else
+ componentKey = ((Class)key).getName();
+ manager = (ConfigurationManager)exocontainer.getComponentInstanceOfType(ConfigurationManager.class);
+ component = manager.getComponent(componentKey);
+ if (component != null)
+ {
+ params = component.getInitParams();
+ debug = component.getShowDeployInfo();
+ }
+ // Please note that we cannot fully initialize the Object "instance_" before releasing other
+ // threads because it could cause StackOverflowError due to recursive calls
+ instance_ = exocontainer.createComponent(getComponentImplementation(), params);
}
- instance_ = exocontainer.createComponent(getComponentImplementation(), params);
-
if (debug)
log.debug("==> create component : " + instance_);
if (component != null && component.getComponentPlugins() != null)
@@ -112,6 +125,7 @@
}
throw new RuntimeException(msg, ex);
}
+
return instance_;
}
Added: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestExoContainer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestExoContainer.java (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestExoContainer.java 2010-05-04 17:28:47 UTC (rev 2348)
@@ -0,0 +1,227 @@
+/*
+ * 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.container;
+
+import org.exoplatform.container.component.BaseComponentPlugin;
+import org.exoplatform.container.configuration.ConfigurationManager;
+import org.exoplatform.container.jmx.AbstractTestContainer;
+import org.picocontainer.ComponentAdapter;
+import org.picocontainer.PicoContainer;
+import org.picocontainer.PicoInitializationException;
+import org.picocontainer.PicoIntrospectionException;
+import org.picocontainer.PicoVisitor;
+import org.picocontainer.defaults.DuplicateComponentKeyRegistrationException;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicReference;
+
+/**
+ * Created by The eXo Platform SAS
+ * Author : Nicolas Filotto
+ * nicolas.filotto(a)exoplatform.com
+ * 3 mai 2010
+ */
+public class TestExoContainer extends AbstractTestContainer
+{
+
+ public void testStackOverFlow()
+ {
+ final RootContainer container = createRootContainer("test-exo-container.xml");
+ MyClass value = (MyClass)container.getComponentInstanceOfType(MyClass.class);
+ assertNotNull(value);
+ MyClassPlugin plugin = value.plugin_;
+ assertNotNull(plugin);
+ assertNotNull(plugin.cmanager_);
+ assertEquals(value, plugin.myClass_);
+ }
+
+ public void testMultiThreading() throws Throwable
+ {
+ final RootContainer container = createRootContainer("test-exo-container.xml");
+ final AtomicReference<MyMTClass> currentMyClass = new AtomicReference<MyMTClass>();
+ testMultiThreading(new Task()
+ {
+
+ public void execute()
+ {
+ MyMTClass value = (MyMTClass)container.getComponentInstance(MyMTClass.class);
+ synchronized (currentMyClass)
+ {
+ if (currentMyClass.get() == null)
+ {
+ currentMyClass.set(value);
+ }
+ }
+ assertEquals(currentMyClass.get(), container.getComponentInstance(MyMTClass.class));
+ }
+ });
+ testMultiThreading(new Task()
+ {
+
+ public void execute()
+ {
+ MyMTClass value = (MyMTClass)container.getComponentInstanceOfType(MyMTClass.class);
+ synchronized (currentMyClass)
+ {
+ if (currentMyClass.get() == null)
+ {
+ currentMyClass.set(value);
+ }
+ }
+ assertEquals(currentMyClass.get(), container.getComponentInstanceOfType(MyMTClass.class));
+ }
+ });
+ final AtomicReference<ComponentAdapter> ar = new AtomicReference<ComponentAdapter>();
+ testMultiThreading(new Task()
+ {
+ public void execute()
+ {
+ try
+ {
+ ComponentAdapter ca = new ComponentAdapter()
+ {
+
+ public void accept(PicoVisitor paramPicoVisitor)
+ {
+ }
+
+ public Class getComponentImplementation()
+ {
+ return MyClass.class;
+ }
+
+ public Object getComponentInstance(PicoContainer paramPicoContainer)
+ throws PicoInitializationException, PicoIntrospectionException
+ {
+ return new MyClass();
+ }
+
+ public Object getComponentKey()
+ {
+ return "a";
+ }
+
+ public void verify(PicoContainer paramPicoContainer) throws PicoIntrospectionException
+ {
+ }
+
+ };
+ ar.set(container.registerComponent(ca));
+ }
+ catch (DuplicateComponentKeyRegistrationException e)
+ {
+ // ignore expected behavior
+ }
+ }
+ });
+ testMultiThreading(new Task()
+ {
+
+ public void execute()
+ {
+ assertEquals(ar.get(), container.getComponentAdapter("a"));
+ }
+ });
+ testMultiThreading(new Task()
+ {
+
+ public void execute()
+ {
+ container.unregisterComponent("a");
+ }
+ });
+
+ }
+
+ private void testMultiThreading(final Task task) throws Throwable
+ {
+ int threads = 50;
+ final CountDownLatch startSignal = new CountDownLatch(1);
+ final CountDownLatch doneSignal = new CountDownLatch(threads);
+ final List<Throwable> errors = Collections.synchronizedList(new ArrayList<Throwable>());
+ for (int i = 0; i < threads; i++)
+ {
+ Thread thread = new Thread()
+ {
+ public void run()
+ {
+ try
+ {
+ startSignal.await();
+ task.execute();
+ }
+ catch (Throwable e)
+ {
+ errors.add(e);
+ }
+ finally
+ {
+ doneSignal.countDown();
+ }
+ }
+ };
+ thread.start();
+ }
+ startSignal.countDown();
+ doneSignal.await();
+ if (!errors.isEmpty())
+ {
+ for (Throwable e : errors)
+ {
+ e.printStackTrace();
+ }
+ throw errors.get(0);
+ }
+ }
+
+ public interface Task
+ {
+ public void execute();
+ }
+
+ public static class MyMTClass
+ {
+ public MyMTClass() throws InterruptedException
+ {
+ // Make the thread wait to ensure that the thread safety issue is properly solved
+ Thread.sleep(10);
+ }
+ }
+
+ public static class MyClass
+ {
+ public MyClassPlugin plugin_;
+ public void add(MyClassPlugin plugin)
+ {
+ this.plugin_ = plugin;
+ }
+ }
+
+ public static class MyClassPlugin extends BaseComponentPlugin
+ {
+ public ConfigurationManager cmanager_;
+ public MyClass myClass_;
+ public MyClassPlugin(ConfigurationManager cmanager, MyClass myClass)
+ {
+ this.cmanager_ = cmanager;
+ this.myClass_ = myClass;
+ }
+ }
+}
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/test-exo-container.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/test-exo-container.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/test-exo-container.xml 2010-05-04 17:28:47 UTC (rev 2348)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ 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.
+ -->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+ <component>
+ <type>org.exoplatform.container.TestExoContainer$MyMTClass</type>
+ </component>
+ <component>
+ <type>org.exoplatform.container.TestExoContainer$MyClass</type>
+ <component-plugins>
+ <component-plugin>
+ <name>stackoverflow-test-plugin</name>
+ <set-method>add</set-method>
+ <type>org.exoplatform.container.TestExoContainer$MyClassPlugin</type>
+ </component-plugin>
+ </component-plugins>
+ </component>
+</configuration>
\ No newline at end of file
16 years, 2 months