exo-jcr SVN: r5527 - in core/branches/2.5.x: exo.core.component.security.core/src/main/java/org/exoplatform/services/security/j2ee and 1 other directory.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-01-26 09:42:57 -0500 (Thu, 26 Jan 2012)
New Revision: 5527
Modified:
core/branches/2.5.x/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/diff/DeltaImpl.java
core/branches/2.5.x/exo.core.component.security.core/src/main/java/org/exoplatform/services/security/j2ee/JbossLoginModule.java
Log:
EXOJCR-1725: Fixed the Blocker/Critical violations and the easiest Major ones raised by eXo Quality Level 1.2
Modified: core/branches/2.5.x/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/diff/DeltaImpl.java
===================================================================
--- core/branches/2.5.x/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/diff/DeltaImpl.java 2012-01-26 13:41:10 UTC (rev 5526)
+++ core/branches/2.5.x/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/diff/DeltaImpl.java 2012-01-26 14:42:57 UTC (rev 5527)
@@ -75,10 +75,18 @@
}
catch (InstantiationException e)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
return null;
}
catch (IllegalAccessException e)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
return null;
}
result.init(orig, rev);
Modified: core/branches/2.5.x/exo.core.component.security.core/src/main/java/org/exoplatform/services/security/j2ee/JbossLoginModule.java
===================================================================
--- core/branches/2.5.x/exo.core.component.security.core/src/main/java/org/exoplatform/services/security/j2ee/JbossLoginModule.java 2012-01-26 13:41:10 UTC (rev 5526)
+++ core/branches/2.5.x/exo.core.component.security.core/src/main/java/org/exoplatform/services/security/j2ee/JbossLoginModule.java 2012-01-26 14:42:57 UTC (rev 5527)
@@ -47,7 +47,7 @@
public class JbossLoginModule extends DefaultLoginModule
{
/** . */
- protected static final Log LOG = ExoLogger.getLogger("exo.core.component.security.core.JbossLoginModule.class");
+ protected static final Log LOG = ExoLogger.getLogger("exo.core.component.security.core.JbossLoginModule");
/**
* {@inheritDoc}
12 years, 3 months
exo-jcr SVN: r5526 - in ws/trunk: exo.ws.rest.core/src/test/java/org/exoplatform/services/rest/impl/header and 3 other directories.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-01-26 08:41:10 -0500 (Thu, 26 Jan 2012)
New Revision: 5526
Modified:
ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/InputHeadersMap.java
ws/trunk/exo.ws.rest.core/src/test/java/org/exoplatform/services/rest/impl/header/InputHeadersMapTest.java
ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/ResourceKey.java
ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/RestResource.java
ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/invocation/SimpleMethodInvoker.java
ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/provider/XSLTStreamingOutput.java
Log:
EXOJCR-1725: Fixed the Blocker/Critical violations and the easiest Major ones raised by eXo Quality Level 1.2
Modified: ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/InputHeadersMap.java
===================================================================
--- ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/InputHeadersMap.java 2012-01-26 13:37:19 UTC (rev 5525)
+++ ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/InputHeadersMap.java 2012-01-26 13:41:10 UTC (rev 5526)
@@ -71,7 +71,7 @@
{
if (m == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("parameter \"m\" cannot be null");
}
this.m = new HashMap<String, List<String>>(m.size());
for (Map.Entry<String, List<String>> e : m.entrySet())
Modified: ws/trunk/exo.ws.rest.core/src/test/java/org/exoplatform/services/rest/impl/header/InputHeadersMapTest.java
===================================================================
--- ws/trunk/exo.ws.rest.core/src/test/java/org/exoplatform/services/rest/impl/header/InputHeadersMapTest.java 2012-01-26 13:37:19 UTC (rev 5525)
+++ ws/trunk/exo.ws.rest.core/src/test/java/org/exoplatform/services/rest/impl/header/InputHeadersMapTest.java 2012-01-26 13:41:10 UTC (rev 5526)
@@ -43,7 +43,7 @@
try
{
um = new InputHeadersMap(null);
- fail("NullPointerException should be here");
+ fail("IllegalArgumentException should be here");
}
catch (IllegalArgumentException e)
{
Modified: ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/ResourceKey.java
===================================================================
--- ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/ResourceKey.java 2012-01-26 13:37:19 UTC (rev 5525)
+++ ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/ResourceKey.java 2012-01-26 13:41:10 UTC (rev 5526)
@@ -33,7 +33,7 @@
{
if (name == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("parameter name cannot be null");
}
this.name = name;
}
Modified: ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/RestResource.java
===================================================================
--- ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/RestResource.java 2012-01-26 13:37:19 UTC (rev 5525)
+++ ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/RestResource.java 2012-01-26 13:41:10 UTC (rev 5526)
@@ -242,7 +242,7 @@
}
catch (Exception e)
{
- LOG.error(e.getMessage());
+ LOG.error("An exception occured: " + e.getMessage());
return Response.serverError();
}
finally
Modified: ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/invocation/SimpleMethodInvoker.java
===================================================================
--- ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/invocation/SimpleMethodInvoker.java 2012-01-26 13:37:19 UTC (rev 5525)
+++ ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/invocation/SimpleMethodInvoker.java 2012-01-26 13:41:10 UTC (rev 5526)
@@ -38,7 +38,7 @@
{
if (method == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The method cannot be null");
}
//
Modified: ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/provider/XSLTStreamingOutput.java
===================================================================
--- ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/provider/XSLTStreamingOutput.java 2012-01-26 13:37:19 UTC (rev 5525)
+++ ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/provider/XSLTStreamingOutput.java 2012-01-26 13:41:10 UTC (rev 5526)
@@ -109,8 +109,7 @@
}
else
{
- String msg = "XSLT scheme name is null.";
- throw new IllegalArgumentException(msg);
+ throw new IllegalArgumentException("XSLT scheme name is null.");
}
transformer.initResult(new StreamResult(outStream));
if (xsltParams != null)
12 years, 3 months
exo-jcr SVN: r5525 - in ws/branches/2.3.x: exo.ws.rest.core/src/test/java/org/exoplatform/services/rest/impl/header and 3 other directories.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-01-26 08:37:19 -0500 (Thu, 26 Jan 2012)
New Revision: 5525
Modified:
ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/InputHeadersMap.java
ws/branches/2.3.x/exo.ws.rest.core/src/test/java/org/exoplatform/services/rest/impl/header/InputHeadersMapTest.java
ws/branches/2.3.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/ResourceKey.java
ws/branches/2.3.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/RestResource.java
ws/branches/2.3.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/invocation/SimpleMethodInvoker.java
ws/branches/2.3.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/provider/XSLTStreamingOutput.java
Log:
EXOJCR-1725: Fixed the Blocker/Critical violations and the easiest Major ones raised by eXo Quality Level 1.2
Modified: ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/InputHeadersMap.java
===================================================================
--- ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/InputHeadersMap.java 2012-01-26 13:35:42 UTC (rev 5524)
+++ ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/InputHeadersMap.java 2012-01-26 13:37:19 UTC (rev 5525)
@@ -71,7 +71,7 @@
{
if (m == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("parameter \"m\" cannot be null");
}
this.m = new HashMap<String, List<String>>(m.size());
for (Map.Entry<String, List<String>> e : m.entrySet())
Modified: ws/branches/2.3.x/exo.ws.rest.core/src/test/java/org/exoplatform/services/rest/impl/header/InputHeadersMapTest.java
===================================================================
--- ws/branches/2.3.x/exo.ws.rest.core/src/test/java/org/exoplatform/services/rest/impl/header/InputHeadersMapTest.java 2012-01-26 13:35:42 UTC (rev 5524)
+++ ws/branches/2.3.x/exo.ws.rest.core/src/test/java/org/exoplatform/services/rest/impl/header/InputHeadersMapTest.java 2012-01-26 13:37:19 UTC (rev 5525)
@@ -43,7 +43,7 @@
try
{
um = new InputHeadersMap(null);
- fail("NullPointerException should be here");
+ fail("IllegalArgumentException should be here");
}
catch (IllegalArgumentException e)
{
Modified: ws/branches/2.3.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/ResourceKey.java
===================================================================
--- ws/branches/2.3.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/ResourceKey.java 2012-01-26 13:35:42 UTC (rev 5524)
+++ ws/branches/2.3.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/ResourceKey.java 2012-01-26 13:37:19 UTC (rev 5525)
@@ -33,7 +33,7 @@
{
if (name == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("parameter name cannot be null");
}
this.name = name;
}
Modified: ws/branches/2.3.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/RestResource.java
===================================================================
--- ws/branches/2.3.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/RestResource.java 2012-01-26 13:35:42 UTC (rev 5524)
+++ ws/branches/2.3.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/RestResource.java 2012-01-26 13:37:19 UTC (rev 5525)
@@ -242,7 +242,7 @@
}
catch (Exception e)
{
- LOG.error(e.getMessage());
+ LOG.error("An exception occured: " + e.getMessage());
return Response.serverError();
}
finally
Modified: ws/branches/2.3.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/invocation/SimpleMethodInvoker.java
===================================================================
--- ws/branches/2.3.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/invocation/SimpleMethodInvoker.java 2012-01-26 13:35:42 UTC (rev 5524)
+++ ws/branches/2.3.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/management/invocation/SimpleMethodInvoker.java 2012-01-26 13:37:19 UTC (rev 5525)
@@ -38,7 +38,7 @@
{
if (method == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The method cannot be null");
}
//
Modified: ws/branches/2.3.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/provider/XSLTStreamingOutput.java
===================================================================
--- ws/branches/2.3.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/provider/XSLTStreamingOutput.java 2012-01-26 13:35:42 UTC (rev 5524)
+++ ws/branches/2.3.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/provider/XSLTStreamingOutput.java 2012-01-26 13:37:19 UTC (rev 5525)
@@ -109,8 +109,7 @@
}
else
{
- String msg = "XSLT scheme name is null.";
- throw new IllegalArgumentException(msg);
+ throw new IllegalArgumentException("XSLT scheme name is null.");
}
transformer.initResult(new StreamResult(outStream));
if (xsltParams != null)
12 years, 3 months
exo-jcr SVN: r5524 - in core/trunk: exo.core.component.security.core/src/main/java/org/exoplatform/services/security/j2ee and 1 other directory.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-01-26 08:35:42 -0500 (Thu, 26 Jan 2012)
New Revision: 5524
Modified:
core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/diff/DeltaImpl.java
core/trunk/exo.core.component.security.core/src/main/java/org/exoplatform/services/security/j2ee/JbossLoginModule.java
Log:
EXOJCR-1725: Fixed the Blocker/Critical violations and the easiest Major ones raised by eXo Quality Level 1.2
Modified: core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/diff/DeltaImpl.java
===================================================================
--- core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/diff/DeltaImpl.java 2012-01-26 13:31:24 UTC (rev 5523)
+++ core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/diff/DeltaImpl.java 2012-01-26 13:35:42 UTC (rev 5524)
@@ -75,10 +75,18 @@
}
catch (InstantiationException e)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
return null;
}
catch (IllegalAccessException e)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
return null;
}
result.init(orig, rev);
Modified: core/trunk/exo.core.component.security.core/src/main/java/org/exoplatform/services/security/j2ee/JbossLoginModule.java
===================================================================
--- core/trunk/exo.core.component.security.core/src/main/java/org/exoplatform/services/security/j2ee/JbossLoginModule.java 2012-01-26 13:31:24 UTC (rev 5523)
+++ core/trunk/exo.core.component.security.core/src/main/java/org/exoplatform/services/security/j2ee/JbossLoginModule.java 2012-01-26 13:35:42 UTC (rev 5524)
@@ -47,7 +47,7 @@
public class JbossLoginModule extends DefaultLoginModule
{
/** . */
- protected static final Log LOG = ExoLogger.getLogger("exo.core.component.security.core.JbossLoginModule.class");
+ protected static final Log LOG = ExoLogger.getLogger("exo.core.component.security.core.JbossLoginModule");
/**
* {@inheritDoc}
12 years, 3 months
exo-jcr SVN: r5523 - in kernel/trunk: exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/concurrent and 9 other directories.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-01-26 08:31:24 -0500 (Thu, 26 Jan 2012)
New Revision: 5523
Modified:
kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/AbstractExoLogFactory.java
kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/LocationAwareSLF4JExoLog.java
kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/SLF4JExoLog.java
kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/concurrent/ConcurrentFIFOExoCache.java
kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/invalidation/InvalidationExoCache.java
kernel/trunk/exo.kernel.component.cache/src/test/java/org/exoplatform/services/cache/test/TestConcurrentCache.java
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/AbstractExoCache.java
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/distributed/DistributedExoCache.java
kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/AbstractExoCache.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/component/RequestLifeCycle.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/ManagementContextImpl.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/MetaDataBuilder.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedMethodMetaData.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedTypeMetaData.java
Log:
EXOJCR-1725: Fixed the Blocker/Critical violations and the easiest Major ones raised by eXo Quality Level 1.2
Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/AbstractExoLogFactory.java
===================================================================
--- kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/AbstractExoLogFactory.java 2012-01-26 13:19:39 UTC (rev 5522)
+++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/AbstractExoLogFactory.java 2012-01-26 13:31:24 UTC (rev 5523)
@@ -52,7 +52,7 @@
{
if (name == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The logger name cannot be null");
}
Log exoLogger = loggers.get(name);
if (exoLogger == null)
@@ -74,7 +74,7 @@
{
if (clazz == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The logger class cannot be null");
}
return getExoLogger(clazz.getName());
}
Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/LocationAwareSLF4JExoLog.java
===================================================================
--- kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/LocationAwareSLF4JExoLog.java 2012-01-26 13:19:39 UTC (rev 5522)
+++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/LocationAwareSLF4JExoLog.java 2012-01-26 13:31:24 UTC (rev 5523)
@@ -46,7 +46,7 @@
{
if (logger == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The logger cannot be null");
}
this.logger = new DynamicLocationAwareLogger(logger);
}
Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/SLF4JExoLog.java
===================================================================
--- kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/SLF4JExoLog.java 2012-01-26 13:19:39 UTC (rev 5522)
+++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/SLF4JExoLog.java 2012-01-26 13:31:24 UTC (rev 5523)
@@ -43,7 +43,7 @@
{
if (logger == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The logger cannot be null");
}
this.logger = logger;
Modified: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/concurrent/ConcurrentFIFOExoCache.java
===================================================================
--- kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/concurrent/ConcurrentFIFOExoCache.java 2012-01-26 13:19:39 UTC (rev 5522)
+++ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/concurrent/ConcurrentFIFOExoCache.java 2012-01-26 13:31:24 UTC (rev 5523)
@@ -281,7 +281,7 @@
{
if (listener == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The listener cannot be null");
}
listeners.add(new ListenerContext<K, V>(listener, this));
}
Modified: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/invalidation/InvalidationExoCache.java
===================================================================
--- kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/invalidation/InvalidationExoCache.java 2012-01-26 13:19:39 UTC (rev 5522)
+++ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/invalidation/InvalidationExoCache.java 2012-01-26 13:31:24 UTC (rev 5523)
@@ -312,7 +312,7 @@
{
if (listener == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The listener cannot be null");
}
listeners.add(listener);
}
Modified: kernel/trunk/exo.kernel.component.cache/src/test/java/org/exoplatform/services/cache/test/TestConcurrentCache.java
===================================================================
--- kernel/trunk/exo.kernel.component.cache/src/test/java/org/exoplatform/services/cache/test/TestConcurrentCache.java 2012-01-26 13:19:39 UTC (rev 5522)
+++ kernel/trunk/exo.kernel.component.cache/src/test/java/org/exoplatform/services/cache/test/TestConcurrentCache.java 2012-01-26 13:31:24 UTC (rev 5523)
@@ -55,7 +55,7 @@
try
{
cache.put(null, new Object());
- fail();
+ fail("Was expecting an IllegalArgumentException");
}
catch (IllegalArgumentException ignore)
{
@@ -65,7 +65,7 @@
try
{
cache.remove(null);
- fail();
+ fail("Was expecting an IllegalArgumentException");
}
catch (IllegalArgumentException ignore)
{
@@ -75,7 +75,7 @@
try
{
cache.putMap(null);
- fail();
+ fail("Was expecting an IllegalArgumentException");
}
catch (IllegalArgumentException ignore)
{
@@ -88,7 +88,7 @@
tmp.put("a", "a");
tmp.put(null, "a");
cache.putMap(tmp);
- fail();
+ fail("Was expecting an IllegalArgumentException");
}
catch (IllegalArgumentException ignore)
{
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/AbstractExoCache.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/AbstractExoCache.java 2012-01-26 13:19:39 UTC (rev 5522)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/AbstractExoCache.java 2012-01-26 13:31:24 UTC (rev 5523)
@@ -101,7 +101,7 @@
{
if (listener == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The listener cannot be null");
}
listeners.add(new ListenerContext<K, V>(listener, this));
}
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/distributed/DistributedExoCache.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/distributed/DistributedExoCache.java 2012-01-26 13:19:39 UTC (rev 5522)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/distributed/DistributedExoCache.java 2012-01-26 13:31:24 UTC (rev 5523)
@@ -136,7 +136,7 @@
{
if (listener == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The listener cannot be null");
}
List<ListenerContext> lListeners = getListeners(fullName);
if (lListeners == null)
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/AbstractExoCache.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/AbstractExoCache.java 2012-01-26 13:19:39 UTC (rev 5522)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/AbstractExoCache.java 2012-01-26 13:31:24 UTC (rev 5523)
@@ -107,7 +107,7 @@
{
if (listener == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The listener cannot be null");
}
listeners.add(new ListenerContext<K, V>(listener, this));
}
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/component/RequestLifeCycle.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/component/RequestLifeCycle.java 2012-01-26 13:19:39 UTC (rev 5522)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/component/RequestLifeCycle.java 2012-01-26 13:31:24 UTC (rev 5523)
@@ -96,7 +96,7 @@
{
if (container == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The container cannot be null");
}
RequestLifeCycleStack lf = current.get();
if (lf == null)
@@ -118,7 +118,7 @@
{
if (lifeCycle == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The lifeCycle cannot be null");
}
RequestLifeCycleStack lf = current.get();
if (lf == null)
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/ManagementContextImpl.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/ManagementContextImpl.java 2012-01-26 13:19:39 UTC (rev 5522)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/ManagementContextImpl.java 2012-01-26 13:31:24 UTC (rev 5523)
@@ -75,7 +75,7 @@
{
if (container == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The container cannot be null");
}
//
@@ -102,11 +102,11 @@
{
if (parent == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The parent cannot be null");
}
if (container == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The container cannot be null");
}
//
@@ -133,7 +133,7 @@
{
if (parent == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The parent cannot be null");
}
if ((resource != null && typeMD == null) && (resource == null && typeMD != null))
{
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/MetaDataBuilder.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/MetaDataBuilder.java 2012-01-26 13:19:39 UTC (rev 5522)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/MetaDataBuilder.java 2012-01-26 13:31:24 UTC (rev 5523)
@@ -91,7 +91,7 @@
{
if (clazz == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The clazz cannot be null");
}
//
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.java 2012-01-26 13:19:39 UTC (rev 5522)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.java 2012-01-26 13:31:24 UTC (rev 5523)
@@ -116,6 +116,13 @@
LOG.trace("An exception occurred: " + e.getMessage());
}
}
+ catch (IllegalArgumentException e)
+ {
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
+ }
}
//
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedMethodMetaData.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedMethodMetaData.java 2012-01-26 13:19:39 UTC (rev 5522)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedMethodMetaData.java 2012-01-26 13:31:24 UTC (rev 5523)
@@ -55,11 +55,11 @@
{
if (method == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The method cannot be null");
}
if (impactType == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The impactType cannot be null");
}
//
@@ -87,7 +87,7 @@
{
if (parameter == null)
{
- throw new NullPointerException("No null parameter accepted");
+ throw new IllegalArgumentException("No null parameter accepted");
}
parameters.put(parameter.getIndex(), parameter);
}
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedTypeMetaData.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedTypeMetaData.java 2012-01-26 13:19:39 UTC (rev 5522)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedTypeMetaData.java 2012-01-26 13:31:24 UTC (rev 5523)
@@ -47,7 +47,7 @@
{
if (type == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The type cannot be null");
}
//
12 years, 3 months
exo-jcr SVN: r5522 - in kernel/branches/2.4.x: exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/concurrent and 9 other directories.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-01-26 08:19:39 -0500 (Thu, 26 Jan 2012)
New Revision: 5522
Modified:
kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/AbstractExoLogFactory.java
kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/LocationAwareSLF4JExoLog.java
kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/SLF4JExoLog.java
kernel/branches/2.4.x/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/concurrent/ConcurrentFIFOExoCache.java
kernel/branches/2.4.x/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/invalidation/InvalidationExoCache.java
kernel/branches/2.4.x/exo.kernel.component.cache/src/test/java/org/exoplatform/services/cache/test/TestConcurrentCache.java
kernel/branches/2.4.x/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/AbstractExoCache.java
kernel/branches/2.4.x/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/distributed/DistributedExoCache.java
kernel/branches/2.4.x/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/AbstractExoCache.java
kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/component/RequestLifeCycle.java
kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/management/ManagementContextImpl.java
kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/management/MetaDataBuilder.java
kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.java
kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedMethodMetaData.java
kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedTypeMetaData.java
Log:
EXOJCR-1725: Fixed the Blocker/Critical violations and the easiest Major ones raised by eXo Quality Level 1.2
Modified: kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/AbstractExoLogFactory.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/AbstractExoLogFactory.java 2012-01-26 10:23:07 UTC (rev 5521)
+++ kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/AbstractExoLogFactory.java 2012-01-26 13:19:39 UTC (rev 5522)
@@ -52,7 +52,7 @@
{
if (name == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The logger name cannot be null");
}
Log exoLogger = loggers.get(name);
if (exoLogger == null)
@@ -74,7 +74,7 @@
{
if (clazz == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The logger class cannot be null");
}
return getExoLogger(clazz.getName());
}
Modified: kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/LocationAwareSLF4JExoLog.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/LocationAwareSLF4JExoLog.java 2012-01-26 10:23:07 UTC (rev 5521)
+++ kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/LocationAwareSLF4JExoLog.java 2012-01-26 13:19:39 UTC (rev 5522)
@@ -46,7 +46,7 @@
{
if (logger == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The logger cannot be null");
}
this.logger = new DynamicLocationAwareLogger(logger);
}
Modified: kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/SLF4JExoLog.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/SLF4JExoLog.java 2012-01-26 10:23:07 UTC (rev 5521)
+++ kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/SLF4JExoLog.java 2012-01-26 13:19:39 UTC (rev 5522)
@@ -43,7 +43,7 @@
{
if (logger == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The logger cannot be null");
}
this.logger = logger;
Modified: kernel/branches/2.4.x/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/concurrent/ConcurrentFIFOExoCache.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/concurrent/ConcurrentFIFOExoCache.java 2012-01-26 10:23:07 UTC (rev 5521)
+++ kernel/branches/2.4.x/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/concurrent/ConcurrentFIFOExoCache.java 2012-01-26 13:19:39 UTC (rev 5522)
@@ -281,7 +281,7 @@
{
if (listener == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The listener cannot be null");
}
listeners.add(new ListenerContext<K, V>(listener, this));
}
Modified: kernel/branches/2.4.x/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/invalidation/InvalidationExoCache.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/invalidation/InvalidationExoCache.java 2012-01-26 10:23:07 UTC (rev 5521)
+++ kernel/branches/2.4.x/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/invalidation/InvalidationExoCache.java 2012-01-26 13:19:39 UTC (rev 5522)
@@ -312,7 +312,7 @@
{
if (listener == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The listener cannot be null");
}
listeners.add(listener);
}
Modified: kernel/branches/2.4.x/exo.kernel.component.cache/src/test/java/org/exoplatform/services/cache/test/TestConcurrentCache.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.component.cache/src/test/java/org/exoplatform/services/cache/test/TestConcurrentCache.java 2012-01-26 10:23:07 UTC (rev 5521)
+++ kernel/branches/2.4.x/exo.kernel.component.cache/src/test/java/org/exoplatform/services/cache/test/TestConcurrentCache.java 2012-01-26 13:19:39 UTC (rev 5522)
@@ -55,7 +55,7 @@
try
{
cache.put(null, new Object());
- fail();
+ fail("Was expecting an IllegalArgumentException");
}
catch (IllegalArgumentException ignore)
{
@@ -65,7 +65,7 @@
try
{
cache.remove(null);
- fail();
+ fail("Was expecting an IllegalArgumentException");
}
catch (IllegalArgumentException ignore)
{
@@ -75,7 +75,7 @@
try
{
cache.putMap(null);
- fail();
+ fail("Was expecting an IllegalArgumentException");
}
catch (IllegalArgumentException ignore)
{
@@ -88,7 +88,7 @@
tmp.put("a", "a");
tmp.put(null, "a");
cache.putMap(tmp);
- fail();
+ fail("Was expecting an IllegalArgumentException");
}
catch (IllegalArgumentException ignore)
{
Modified: kernel/branches/2.4.x/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/AbstractExoCache.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/AbstractExoCache.java 2012-01-26 10:23:07 UTC (rev 5521)
+++ kernel/branches/2.4.x/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/AbstractExoCache.java 2012-01-26 13:19:39 UTC (rev 5522)
@@ -101,7 +101,7 @@
{
if (listener == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The listener cannot be null");
}
listeners.add(new ListenerContext<K, V>(listener, this));
}
Modified: kernel/branches/2.4.x/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/distributed/DistributedExoCache.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/distributed/DistributedExoCache.java 2012-01-26 10:23:07 UTC (rev 5521)
+++ kernel/branches/2.4.x/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/distributed/DistributedExoCache.java 2012-01-26 13:19:39 UTC (rev 5522)
@@ -132,7 +132,7 @@
{
if (listener == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The listener cannot be null");
}
List<ListenerContext> lListeners = getListeners(fullName);
if (lListeners == null)
Modified: kernel/branches/2.4.x/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/AbstractExoCache.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/AbstractExoCache.java 2012-01-26 10:23:07 UTC (rev 5521)
+++ kernel/branches/2.4.x/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/AbstractExoCache.java 2012-01-26 13:19:39 UTC (rev 5522)
@@ -107,7 +107,7 @@
{
if (listener == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The listener cannot be null");
}
listeners.add(new ListenerContext<K, V>(listener, this));
}
Modified: kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/component/RequestLifeCycle.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/component/RequestLifeCycle.java 2012-01-26 10:23:07 UTC (rev 5521)
+++ kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/component/RequestLifeCycle.java 2012-01-26 13:19:39 UTC (rev 5522)
@@ -96,7 +96,7 @@
{
if (container == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The container cannot be null");
}
RequestLifeCycleStack lf = current.get();
if (lf == null)
@@ -118,7 +118,7 @@
{
if (lifeCycle == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The lifeCycle cannot be null");
}
RequestLifeCycleStack lf = current.get();
if (lf == null)
Modified: kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/management/ManagementContextImpl.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/management/ManagementContextImpl.java 2012-01-26 10:23:07 UTC (rev 5521)
+++ kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/management/ManagementContextImpl.java 2012-01-26 13:19:39 UTC (rev 5522)
@@ -75,7 +75,7 @@
{
if (container == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The container cannot be null");
}
//
@@ -102,11 +102,11 @@
{
if (parent == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The parent cannot be null");
}
if (container == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The container cannot be null");
}
//
@@ -133,7 +133,7 @@
{
if (parent == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The parent cannot be null");
}
if ((resource != null && typeMD == null) && (resource == null && typeMD != null))
{
Modified: kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/management/MetaDataBuilder.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/management/MetaDataBuilder.java 2012-01-26 10:23:07 UTC (rev 5521)
+++ kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/management/MetaDataBuilder.java 2012-01-26 13:19:39 UTC (rev 5522)
@@ -91,7 +91,7 @@
{
if (clazz == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The clazz cannot be null");
}
//
Modified: kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.java 2012-01-26 10:23:07 UTC (rev 5521)
+++ kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.java 2012-01-26 13:19:39 UTC (rev 5522)
@@ -118,6 +118,13 @@
LOG.trace("An exception occurred: " + e.getMessage());
}
}
+ catch (IllegalArgumentException e)
+ {
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
+ }
}
else
{
Modified: kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedMethodMetaData.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedMethodMetaData.java 2012-01-26 10:23:07 UTC (rev 5521)
+++ kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedMethodMetaData.java 2012-01-26 13:19:39 UTC (rev 5522)
@@ -55,11 +55,11 @@
{
if (method == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The method cannot be null");
}
if (impactType == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The impactType cannot be null");
}
//
@@ -87,7 +87,7 @@
{
if (parameter == null)
{
- throw new NullPointerException("No null parameter accepted");
+ throw new IllegalArgumentException("No null parameter accepted");
}
parameters.put(parameter.getIndex(), parameter);
}
Modified: kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedTypeMetaData.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedTypeMetaData.java 2012-01-26 10:23:07 UTC (rev 5521)
+++ kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedTypeMetaData.java 2012-01-26 13:19:39 UTC (rev 5522)
@@ -47,7 +47,7 @@
{
if (type == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("The type cannot be null");
}
//
12 years, 3 months
exo-jcr SVN: r5521 - in kernel/trunk: exo.kernel.commons/src/main/java/org/exoplatform/commons/utils and 18 other directories.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-01-26 05:23:07 -0500 (Thu, 26 Jan 2012)
New Revision: 5521
Modified:
kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/reflect/AnnotationIntrospector.java
kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/ExpressionUtil.java
kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/IOUtil.java
kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/Tools.java
kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/ExoLogger.java
kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/AbstractExoLogFactory.java
kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/LocationAwareSLF4JExoLog.java
kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/SLF4JExoLog.java
kernel/trunk/exo.kernel.commons/src/test/java/org/exoplatform/commons/utils/TestIOUtil.java
kernel/trunk/exo.kernel.commons/src/test/java/org/exoplatform/commons/utils/TestTools.java
kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/concurrent/ConcurrentFIFOExoCache.java
kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/concurrent/ListenerContext.java
kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/impl/CacheServiceImpl.java
kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/impl/CacheServiceManaged.java
kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/invalidation/InvalidationExoCache.java
kernel/trunk/exo.kernel.component.cache/src/test/java/org/exoplatform/services/cache/test/TestConcurrentCache.java
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/AbstractExoCache.java
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/ExoCacheFactoryImpl.java
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/distributed/DistributedExoCache.java
kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/AbstractExoCache.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/ConcurrentPicoContainer.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/StandaloneContainer.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/component/RequestLifeCycle.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/management/ManageableContainer.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/ManagementContextImpl.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/MetaDataBuilder.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.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/util/TemplateConfigurationHelper.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/ObjectParam.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedMethodMetaData.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedPropertyMetaData.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedTypeMetaData.java
Log:
EXOJCR-1725: Fixed the Blocker/Critical violations and the easiest Major ones raised by eXo Quality Level 1.2
Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/reflect/AnnotationIntrospector.java
===================================================================
--- kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/reflect/AnnotationIntrospector.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/reflect/AnnotationIntrospector.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -43,18 +43,18 @@
* @param classAnnotation the annotation to lookup
* @param <A> the annotation class
* @return the annotation
- * @throws NullPointerException if any argument is null
+ * @throws IllegalArgumentException if any argument is null
*/
public static <A extends Annotation> A resolveClassAnnotations(Class<?> clazz, Class<A> classAnnotation)
- throws NullPointerException
+ throws IllegalArgumentException
{
if (clazz == null)
{
- throw new NullPointerException("No null class");
+ throw new IllegalArgumentException("No null class");
}
if (classAnnotation == null)
{
- throw new NullPointerException("No null annotation");
+ throw new IllegalArgumentException("No null annotation");
}
//
@@ -92,11 +92,11 @@
{
if (clazz == null)
{
- throw new NullPointerException("No null class");
+ throw new IllegalArgumentException("No null class");
}
if (methodAnnotation == null)
{
- throw new NullPointerException("No null annotation");
+ throw new IllegalArgumentException("No null annotation");
}
//
Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/ExpressionUtil.java
===================================================================
--- kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/ExpressionUtil.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/ExpressionUtil.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -18,6 +18,9 @@
*/
package org.exoplatform.commons.utils;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
import java.util.ResourceBundle;
/**
@@ -29,6 +32,9 @@
*/
public class ExpressionUtil
{
+
+ private static final Log LOG = ExoLogger.getLogger("exo.kernel.commons.ExpressionUtil");
+
static public String getExpressionValue(ResourceBundle res, String key)
{
if (res == null)
@@ -43,6 +49,10 @@
}
catch (java.util.MissingResourceException ex)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + ex.getMessage());
+ }
}
return value;
}
@@ -66,6 +76,10 @@
}
catch (java.util.MissingResourceException ex)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + ex.getMessage());
+ }
}
return key;
}
Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/IOUtil.java
===================================================================
--- kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/IOUtil.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/IOUtil.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -18,6 +18,9 @@
*/
package org.exoplatform.commons.utils;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
@@ -37,6 +40,8 @@
public class IOUtil
{
+ private static final Log LOG = ExoLogger.getLogger("exo.kernel.commons.IOUtil");
+
/** The buffer size for reading input streams. */
private static final int DEFAULT_BUFFER_SIZE = 256;
@@ -46,9 +51,9 @@
* @param file the file
* @return the content
* @throws IOException any io exception
- * @throws NullPointerException if any argument is null
+ * @throws IllegalArgumentException if any argument is null
*/
- static public String getFileContentAsString(File file) throws IOException, NullPointerException
+ static public String getFileContentAsString(File file) throws IOException, IllegalArgumentException
{
return getFileContentAsString(file, "UTF-8");
}
@@ -60,13 +65,13 @@
* @param charset the charset
* @return the content
* @throws IOException any io exception
- * @throws NullPointerException if any argument is null
+ * @throws IllegalArgumentException if any argument is null
*/
- static public String getFileContentAsString(File file, String charset) throws IOException, NullPointerException
+ static public String getFileContentAsString(File file, String charset) throws IOException, IllegalArgumentException
{
if (file == null)
{
- throw new NullPointerException("No null file accepted");
+ throw new IllegalArgumentException("No null file accepted");
}
FileInputStream is = new FileInputStream(file);
return new String(getStreamContentAsBytes(is), charset);
@@ -79,14 +84,14 @@
* @param charset the charset
* @return the content
* @throws IOException any io exception
- * @throws NullPointerException if any argument is null
+ * @throws IllegalArgumentException if any argument is null
*/
static public String getFileContentAsString(String fileName, String charset) throws IOException,
- NullPointerException
+ IllegalArgumentException
{
if (fileName == null)
{
- throw new NullPointerException("No null file name accepted");
+ throw new IllegalArgumentException("No null file name accepted");
}
return getFileContentAsString(new File(fileName), charset);
}
@@ -97,9 +102,9 @@
* @param fileName the file name
* @return the content
* @throws IOException any io exception
- * @throws NullPointerException if any argument is null
+ * @throws IllegalArgumentException if any argument is null
*/
- static public String getFileContentAsString(String fileName) throws IOException, NullPointerException
+ static public String getFileContentAsString(String fileName) throws IOException, IllegalArgumentException
{
return getFileContentAsString(fileName, "UTF-8");
}
@@ -110,9 +115,9 @@
* @param is the stream
* @return the content
* @throws IOException any io exception
- * @throws NullPointerException if the specified stream is null
+ * @throws IllegalArgumentException if the specified stream is null
*/
- static public String getStreamContentAsString(InputStream is) throws IOException, NullPointerException
+ static public String getStreamContentAsString(InputStream is) throws IOException, IllegalArgumentException
{
byte buf[] = getStreamContentAsBytes(is);
return new String(buf, "UTF-8");
@@ -124,13 +129,13 @@
* @param fileName the file name
* @return the content
* @throws IOException any io exception
- * @throws NullPointerException if the specified file name is null
+ * @throws IllegalArgumentException if the specified file name is null
*/
- static public byte[] getFileContentAsBytes(String fileName) throws IOException, NullPointerException
+ static public byte[] getFileContentAsBytes(String fileName) throws IOException, IllegalArgumentException
{
if (fileName == null)
{
- throw new NullPointerException("No null file name accepted");
+ throw new IllegalArgumentException("No null file name accepted");
}
FileInputStream is = new FileInputStream(fileName);
return getStreamContentAsBytes(is);
@@ -144,13 +149,13 @@
* @param is the input stream
* @return the data read from the input stream its end
* @throws IOException if any IOException occurs during a read
- * @throws NullPointerException if the provided input stream is null
+ * @throws IllegalArgumentException if the provided input stream is null
*/
- static public byte[] getStreamContentAsBytes(InputStream is) throws IOException, NullPointerException
+ static public byte[] getStreamContentAsBytes(InputStream is) throws IOException, IllegalArgumentException
{
if (is == null)
{
- throw new NullPointerException("No null input stream accepted");
+ throw new IllegalArgumentException("No null input stream accepted");
}
try
{
@@ -173,9 +178,17 @@
}
catch (IOException ignore)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + ignore.getMessage());
+ }
}
catch (RuntimeException ignore)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + ignore.getMessage());
+ }
}
}
}
@@ -189,7 +202,7 @@
*
* @param resource the resource name
* @return the resource content
- * @throws NullPointerException if the specified argument is null or the loaded resource does not exist
+ * @throws IllegalArgumentException if the specified argument is null or the loaded resource does not exist
* @throws IOException thrown by accessing the resource
*/
static public String getResourceAsString(String resource) throws IOException
@@ -205,20 +218,21 @@
*
* @param resource the resource name
* @return the resource content
- * @throws NullPointerException if the specified argument is null or the loaded resource does not exist
+ * @throws IllegalArgumentException if the specified argument is null or the loaded resource does not exist
* @throws IOException thrown by accessing the resource
*/
static public byte[] getResourceAsBytes(String resource) throws IOException
{
if (resource == null)
{
- throw new NullPointerException("Cannot provide null resource values");
+ throw new IllegalArgumentException("Cannot provide null resource values");
}
ClassLoader cl = Thread.currentThread().getContextClassLoader();
URL url = cl.getResource(resource);
if (url == null)
{
- throw new NullPointerException("The resource " + resource + " was not found in the thread context classloader");
+ throw new IllegalArgumentException("The resource " + resource
+ + " was not found in the thread context classloader");
}
InputStream is = url.openStream();
return getStreamContentAsBytes(is);
Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/Tools.java
===================================================================
--- kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/Tools.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/Tools.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -35,20 +35,20 @@
* All the time zones already registered
*/
private static volatile Map<String, TimeZone> TIME_ZONES = new HashMap<String, TimeZone>();
-
+
/**
* Instantiates a {@link HashSet} object and fills it with the provided element array.
*
* @param elements the list of elements to add
* @param <E> the element type
* @return the set of elements
- * @throws NullPointerException if the element array is null
+ * @throws IllegalArgumentException if the element array is null
*/
- public static <E> Set<E> set(E... elements) throws NullPointerException
+ public static <E> Set<E> set(E... elements) throws IllegalArgumentException
{
if (elements == null)
{
- throw new NullPointerException("No null element array accepted");
+ throw new IllegalArgumentException("No null element array accepted");
}
HashSet<E> set = new HashSet<E>();
if (elements.length > 0)
@@ -69,13 +69,13 @@
*
* @param s the list to parse
* @return the set of string found in the list
- * @throws NullPointerException if the string argument is null
+ * @throws IllegalArgumentException if the string argument is null
*/
- public static Set<String> parseCommaList(String s) throws NullPointerException
+ public static Set<String> parseCommaList(String s) throws IllegalArgumentException
{
if (s == null)
{
- throw new NullPointerException("No null string list accepted");
+ throw new IllegalArgumentException("No null string list accepted");
}
Set<String> set = new HashSet<String>();
for (String v : s.split(","))
@@ -94,13 +94,13 @@
*
* @param map the map to copy
* @return the properties copy
- * @throws NullPointerException if the map argument is null
+ * @throws IllegalArgumentException if the map argument is null
*/
- public static Properties asProperties(Map<String, String> map) throws NullPointerException
+ public static Properties asProperties(Map<String, String> map) throws IllegalArgumentException
{
if (map == null)
{
- throw new NullPointerException("No null map accepted");
+ throw new IllegalArgumentException("No null map accepted");
}
Properties props = new Properties();
for (Map.Entry<String, String> entry : map.entrySet())
@@ -116,13 +116,13 @@
*
* @param props the properties object to copy
* @return the properties copy as a map
- * @throws NullPointerException if the props argument is null
+ * @throws IllegalArgumentException if the props argument is null
*/
- public static Map<String, String> asMap(Properties props) throws NullPointerException
+ public static Map<String, String> asMap(Properties props) throws IllegalArgumentException
{
if (props == null)
{
- throw new NullPointerException("No null properties accepted");
+ throw new IllegalArgumentException("No null properties accepted");
}
Map<String, String> map = new HashMap<String, String>();
for (Object key : props.keySet())
@@ -141,17 +141,17 @@
* @param s the string to test
* @param end the string suffix
* @return true if the string s ends with the end string ignoring the case
- * @throws NullPointerException if any string is null
+ * @throws IllegalArgumentException if any string is null
*/
- public static boolean endsWithIgnoreCase(String s, String end) throws NullPointerException
+ public static boolean endsWithIgnoreCase(String s, String end) throws IllegalArgumentException
{
if (s == null)
{
- throw new NullPointerException();
+ throw new IllegalArgumentException();
}
if (end == null)
{
- throw new NullPointerException();
+ throw new IllegalArgumentException();
}
if (s.length() < end.length())
{
@@ -168,7 +168,7 @@
{
if (ID == null)
{
- throw new NullPointerException("ID of the timezone cannot be null");
+ throw new IllegalArgumentException("ID of the timezone cannot be null");
}
if (ID.length() == 0)
{
Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/ExoLogger.java
===================================================================
--- kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/ExoLogger.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/ExoLogger.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -75,13 +75,13 @@
* to replace the current static instance.
*
* @param factory ExoLogFactory, the new factory
- * @throws NullPointerException when the factory is null
+ * @throws IllegalArgumentException when the factory is null
*/
- public static void setFactory(ExoLogFactory factory) throws NullPointerException
+ public static void setFactory(ExoLogFactory factory) throws IllegalArgumentException
{
if (factory == null)
{
- throw new NullPointerException("Cannot set a null logger factory");
+ throw new IllegalArgumentException("Cannot set a null logger factory");
}
loggerFactory = factory;
}
@@ -113,13 +113,13 @@
*
* @param name the logger name
* @return the logger
- * @throws NullPointerException if the name is null
+ * @throws IllegalArgumentException if the name is null
*/
- public static Log getExoLogger(String name) throws NullPointerException
+ public static Log getExoLogger(String name) throws IllegalArgumentException
{
if (name == null)
{
- throw new NullPointerException("No null name accepted");
+ throw new IllegalArgumentException("No null name accepted");
}
try
{
@@ -139,13 +139,13 @@
*
* @param name the logger name
* @return the logger
- * @throws NullPointerException if the name is null
+ * @throws IllegalArgumentException if the name is null
*/
- public static Log getExoLogger(Class name) throws NullPointerException
+ public static Log getExoLogger(Class name) throws IllegalArgumentException
{
if (name == null)
{
- throw new NullPointerException("No null name accepted");
+ throw new IllegalArgumentException("No null name accepted");
}
try
{
Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/AbstractExoLogFactory.java
===================================================================
--- kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/AbstractExoLogFactory.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/AbstractExoLogFactory.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -52,7 +52,7 @@
{
if (name == null)
{
- throw new NullPointerException();
+ throw new IllegalArgumentException();
}
Log exoLogger = loggers.get(name);
if (exoLogger == null)
@@ -74,7 +74,7 @@
{
if (clazz == null)
{
- throw new NullPointerException();
+ throw new IllegalArgumentException();
}
return getExoLogger(clazz.getName());
}
Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/LocationAwareSLF4JExoLog.java
===================================================================
--- kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/LocationAwareSLF4JExoLog.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/LocationAwareSLF4JExoLog.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -40,13 +40,13 @@
* Create a new instance.
*
* @param logger the logger
- * @throws NullPointerException if the logger is null
+ * @throws IllegalArgumentException if the logger is null
*/
public LocationAwareSLF4JExoLog(LocationAwareLogger logger)
{
if (logger == null)
{
- throw new NullPointerException();
+ throw new IllegalArgumentException();
}
this.logger = new DynamicLocationAwareLogger(logger);
}
Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/SLF4JExoLog.java
===================================================================
--- kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/SLF4JExoLog.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/SLF4JExoLog.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -37,12 +37,14 @@
* Create a new instance.
*
* @param logger Logger
- * @throws NullPointerException if the logger is null
+ * @throws IllegalArgumentException if the logger is null
*/
- public SLF4JExoLog(Logger logger) throws NullPointerException
+ public SLF4JExoLog(Logger logger) throws IllegalArgumentException
{
if (logger == null)
- throw new NullPointerException();
+ {
+ throw new IllegalArgumentException();
+ }
this.logger = logger;
}
Modified: kernel/trunk/exo.kernel.commons/src/test/java/org/exoplatform/commons/utils/TestIOUtil.java
===================================================================
--- kernel/trunk/exo.kernel.commons/src/test/java/org/exoplatform/commons/utils/TestIOUtil.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.commons/src/test/java/org/exoplatform/commons/utils/TestIOUtil.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -33,50 +33,50 @@
public class TestIOUtil extends TestCase
{
- public void testGetFileContentAsStringThrowsNPE() throws IOException
+ public void testGetFileContentAsStringThrowsIllegalArgumentException() throws IOException
{
try
{
IOUtil.getFileContentAsString((File)null);
- fail("Was expecting an NPE");
+ fail("Was expecting an IllegalArgumentException");
}
- catch (NullPointerException e)
+ catch (IllegalArgumentException e)
{
}
try
{
IOUtil.getFileContentAsString((String)null);
- fail("Was expecting an NPE");
+ fail("Was expecting an IllegalArgumentException");
}
- catch (NullPointerException e)
+ catch (IllegalArgumentException e)
{
}
try
{
IOUtil.getFileContentAsString((File)null, "UTF-8");
- fail("Was expecting an NPE");
+ fail("Was expecting an IllegalArgumentException");
}
- catch (NullPointerException e)
+ catch (IllegalArgumentException e)
{
}
try
{
IOUtil.getFileContentAsString((String)null, "UTF-8");
- fail("Was expecting an NPE");
+ fail("Was expecting an IllegalArgumentException");
}
- catch (NullPointerException e)
+ catch (IllegalArgumentException e)
{
}
}
- public void testStreamContentAsStringThrowsNPE() throws IOException
+ public void testStreamContentAsStringThrowsIllegalArgumentException() throws IOException
{
try
{
IOUtil.getStreamContentAsString(null);
- fail("Was expecting an NPE");
+ fail("Was expecting an IllegalArgumentException");
}
- catch (NullPointerException e)
+ catch (IllegalArgumentException e)
{
}
}
@@ -87,14 +87,14 @@
assertEquals("a\u1000", s);
}
- public void testStreamContentAsBytesThrowsNPE() throws IOException
+ public void testStreamContentAsBytesThrowsIllegalArgumentException() throws IOException
{
try
{
IOUtil.getStreamContentAsBytes(null);
- fail("Was expecting an NPE");
+ fail("Was expecting an IllegalArgumentException");
}
- catch (NullPointerException e)
+ catch (IllegalArgumentException e)
{
}
}
@@ -121,14 +121,14 @@
}
}
- public void testGetResourceAsStringThrowsNPE() throws IOException
+ public void testGetResourceAsStringThrowsIllegalArgumentException() throws IOException
{
try
{
IOUtil.getResourceAsString(null);
- fail("Was expecting an NPE");
+ fail("Was expecting an IllegalArgumentException");
}
- catch (NullPointerException e)
+ catch (IllegalArgumentException e)
{
//
}
@@ -149,9 +149,9 @@
{
Thread.currentThread().setContextClassLoader(newCL);
IOUtil.getResourceAsString("whatever");
- fail("Was expecting an NPE");
+ fail("Was expecting an IllegalArgumentException");
}
- catch (NullPointerException e)
+ catch (IllegalArgumentException e)
{
//
}
@@ -308,14 +308,14 @@
}
}
- public void testGetStreamContentAsBytesThrowsNPE() throws IOException
+ public void testGetStreamContentAsBytesThrowsIllegalArgumentException() throws IOException
{
try
{
IOUtil.getStreamContentAsBytes(null);
- fail("Was expecting an NPE");
+ fail("Was expecting an IllegalArgumentException");
}
- catch (NullPointerException expected)
+ catch (IllegalArgumentException expected)
{
}
}
Modified: kernel/trunk/exo.kernel.commons/src/test/java/org/exoplatform/commons/utils/TestTools.java
===================================================================
--- kernel/trunk/exo.kernel.commons/src/test/java/org/exoplatform/commons/utils/TestTools.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.commons/src/test/java/org/exoplatform/commons/utils/TestTools.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -66,14 +66,14 @@
assertTrue(strings.contains("b"));
}
- public void testSetThrowsNPE()
+ public void testSetThrowsIllegalArgumentException()
{
try
{
Tools.set((String[])null);
fail();
}
- catch (NullPointerException expected)
+ catch (IllegalArgumentException expected)
{
}
}
@@ -89,14 +89,14 @@
assertEquals(Tools.set("a", "b"),Tools.parseCommaList("a,b"));
}
- public void testParseCommandListThrowsNPE()
+ public void testParseCommandListThrowsIllegalArgumentException()
{
try
{
Tools.parseCommaList(null);
fail();
}
- catch (NullPointerException e)
+ catch (IllegalArgumentException e)
{
}
}
@@ -110,14 +110,14 @@
assertTrue(Tools.endsWithIgnoreCase("A", "a"));
}
- public void testEndsWithIgnoreCaseThrowsNPE()
+ public void testEndsWithIgnoreCaseThrowsIllegalArgumentException()
{
try
{
Tools.endsWithIgnoreCase(null, "a");
fail();
}
- catch (NullPointerException e)
+ catch (IllegalArgumentException e)
{
}
try
@@ -125,7 +125,7 @@
Tools.endsWithIgnoreCase("a", null);
fail();
}
- catch (NullPointerException e)
+ catch (IllegalArgumentException e)
{
}
try
@@ -133,7 +133,7 @@
Tools.endsWithIgnoreCase(null, null);
fail();
}
- catch (NullPointerException e)
+ catch (IllegalArgumentException e)
{
}
}
@@ -151,14 +151,14 @@
assertEquals("b", props.getProperty("a"));
}
- public void testAsMapThrowsNPE()
+ public void testAsMapThrowsIllegalArgumentException()
{
try
{
Tools.asMap(null);
fail();
}
- catch (NullPointerException e)
+ catch (IllegalArgumentException e)
{
}
}
@@ -176,14 +176,14 @@
assertEquals(Collections.singletonMap("a", "b"), map);
}
- public void testAsPropertiesThrowsNPE()
+ public void testAsPropertiesThrowsIllegalArgumentException()
{
try
{
Tools.asProperties(null);
fail();
}
- catch (NullPointerException e)
+ catch (IllegalArgumentException e)
{
}
}
Modified: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/concurrent/ConcurrentFIFOExoCache.java
===================================================================
--- kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/concurrent/ConcurrentFIFOExoCache.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/concurrent/ConcurrentFIFOExoCache.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -180,7 +180,7 @@
{
if (name == null)
{
- throw new NullPointerException("No null cache key accepted");
+ throw new IllegalArgumentException("No null cache key accepted");
}
if (liveTimeMillis != 0)
{
@@ -193,7 +193,7 @@
{
if (objs == null)
{
- throw new NullPointerException("No null map accepted");
+ throw new IllegalArgumentException("No null map accepted");
}
long expirationTime = liveTimeMillis > 0 ? System.currentTimeMillis() + liveTimeMillis : Long.MAX_VALUE;
for (Serializable name : objs.keySet())
@@ -213,7 +213,7 @@
{
if (name == null)
{
- throw new NullPointerException("No null cache key accepted");
+ throw new IllegalArgumentException("No null cache key accepted");
}
return state.remove(name);
}
@@ -281,7 +281,7 @@
{
if (listener == null)
{
- throw new NullPointerException();
+ throw new IllegalArgumentException();
}
listeners.add(new ListenerContext<K, V>(listener, this));
}
Modified: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/concurrent/ListenerContext.java
===================================================================
--- kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/concurrent/ListenerContext.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/concurrent/ListenerContext.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -21,6 +21,8 @@
import org.exoplatform.services.cache.CacheInfo;
import org.exoplatform.services.cache.CacheListener;
import org.exoplatform.services.cache.CacheListenerContext;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
@@ -29,6 +31,8 @@
public class ListenerContext<K, V> implements CacheListenerContext, CacheInfo
{
+ private static final Log LOG = ExoLogger.getLogger("exo.kernel.component.cache.ListenerContext");
+
/** . */
private final ConcurrentFIFOExoCache cache;
@@ -74,6 +78,10 @@
}
catch (Exception ignore)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + ignore.getMessage());
+ }
}
}
@@ -85,6 +93,10 @@
}
catch (Exception ignore)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + ignore.getMessage());
+ }
}
}
@@ -96,6 +108,10 @@
}
catch (Exception ignore)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + ignore.getMessage());
+ }
}
}
@@ -107,6 +123,10 @@
}
catch (Exception ignore)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + ignore.getMessage());
+ }
}
}
@@ -118,6 +138,10 @@
}
catch (Exception ignore)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + ignore.getMessage());
+ }
}
}
}
Modified: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/impl/CacheServiceImpl.java
===================================================================
--- kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/impl/CacheServiceImpl.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/impl/CacheServiceImpl.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -109,7 +109,7 @@
{
if (region == null)
{
- throw new NullPointerException("region cannot be null");
+ throw new IllegalArgumentException("region cannot be null");
}
if (region.length() == 0)
{
@@ -187,7 +187,10 @@
}
catch (ClassNotFoundException e)
{
- // The implementation could not be found
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
if (simple == null)
@@ -220,7 +223,10 @@
}
catch (Exception e)
{
- // ignore me
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
if (cache != null)
{
Modified: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/impl/CacheServiceManaged.java
===================================================================
--- kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/impl/CacheServiceManaged.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/impl/CacheServiceManaged.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -25,6 +25,8 @@
import org.exoplatform.management.jmx.annotations.NameTemplate;
import org.exoplatform.management.jmx.annotations.Property;
import org.exoplatform.services.cache.ExoCache;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
@@ -36,6 +38,8 @@
public class CacheServiceManaged implements ManagementAware
{
+ private static final Log LOG = ExoLogger.getLogger("exo.kernel.component.cache.CacheServiceManaged");
+
/** . */
private ManagementContext context;
@@ -62,6 +66,10 @@
}
catch (Exception wtf)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + wtf.getMessage());
+ }
}
}
}
Modified: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/invalidation/InvalidationExoCache.java
===================================================================
--- kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/invalidation/InvalidationExoCache.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/invalidation/InvalidationExoCache.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -168,11 +168,11 @@
/**
* @see org.exoplatform.services.cache.ExoCache#putMap(java.util.Map)
*/
- public void putMap(Map<? extends K, ? extends V> objs) throws NullPointerException, IllegalArgumentException
+ public void putMap(Map<? extends K, ? extends V> objs) throws IllegalArgumentException
{
if (objs == null)
{
- throw new NullPointerException("No null map accepted");
+ throw new IllegalArgumentException("No null map accepted");
}
Map<K, HashCode<V>> map = new LinkedHashMap<K, HashCode<V>>();
for (Entry<? extends K, ? extends V> entry : objs.entrySet())
@@ -308,11 +308,11 @@
/**
* @see org.exoplatform.services.cache.ExoCache#addCacheListener(org.exoplatform.services.cache.CacheListener)
*/
- public void addCacheListener(CacheListener<? super K, ? super V> listener) throws NullPointerException
+ public void addCacheListener(CacheListener<? super K, ? super V> listener) throws IllegalArgumentException
{
if (listener == null)
{
- throw new NullPointerException();
+ throw new IllegalArgumentException();
}
listeners.add(listener);
}
Modified: kernel/trunk/exo.kernel.component.cache/src/test/java/org/exoplatform/services/cache/test/TestConcurrentCache.java
===================================================================
--- kernel/trunk/exo.kernel.component.cache/src/test/java/org/exoplatform/services/cache/test/TestConcurrentCache.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.component.cache/src/test/java/org/exoplatform/services/cache/test/TestConcurrentCache.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -57,7 +57,7 @@
cache.put(null, new Object());
fail();
}
- catch (NullPointerException ignore)
+ catch (IllegalArgumentException ignore)
{
assertEquals(1, cache.getCacheSize());
assertEquals("a", cache.get("a"));
@@ -67,7 +67,7 @@
cache.remove(null);
fail();
}
- catch (NullPointerException ignore)
+ catch (IllegalArgumentException ignore)
{
assertEquals(1, cache.getCacheSize());
assertEquals("a", cache.get("a"));
@@ -77,7 +77,7 @@
cache.putMap(null);
fail();
}
- catch (NullPointerException ignore)
+ catch (IllegalArgumentException ignore)
{
assertEquals(1, cache.getCacheSize());
assertEquals("a", cache.get("a"));
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/AbstractExoCache.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/AbstractExoCache.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/AbstractExoCache.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -101,7 +101,7 @@
{
if (listener == null)
{
- throw new IllegalArgumentException("The listener cannot be null");
+ throw new IllegalArgumentException();
}
listeners.add(new ListenerContext<K, V>(listener, this));
}
@@ -221,7 +221,7 @@
/**
* {@inheritDoc}
*/
- public void put(final K key, final V value) throws NullPointerException
+ public void put(final K key, final V value) throws IllegalArgumentException
{
if (key == null)
{
@@ -256,7 +256,7 @@
/**
* {@inheritDoc}
*/
- public void putMap(final Map<? extends K, ? extends V> objs) throws NullPointerException, IllegalArgumentException
+ public void putMap(final Map<? extends K, ? extends V> objs) throws IllegalArgumentException
{
if (objs == null)
{
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/ExoCacheFactoryImpl.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/ExoCacheFactoryImpl.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/ExoCacheFactoryImpl.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -385,7 +385,8 @@
// We expect a distributed cache
if (distributedCacheManager == null)
{
- throw new IllegalStateException("The DistributedCacheManager has not been defined in the configuration,"
+ throw new IllegalArgumentException(
+ "The DistributedCacheManager has not been defined in the configuration,"
+ " please configure it at root container level if you want to use a distributed cache.");
}
return new DistributedExoCache(ctx, config,
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/distributed/DistributedExoCache.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/distributed/DistributedExoCache.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/distributed/DistributedExoCache.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -136,7 +136,7 @@
{
if (listener == null)
{
- throw new IllegalArgumentException("The listener cannot be null");
+ throw new IllegalArgumentException();
}
List<ListenerContext> lListeners = getListeners(fullName);
if (lListeners == null)
@@ -360,7 +360,7 @@
/**
* {@inheritDoc}
*/
- public void put(final K key, final V value) throws NullPointerException
+ public void put(final K key, final V value) throws IllegalArgumentException
{
if (key == null)
{
@@ -396,7 +396,7 @@
/**
* {@inheritDoc}
*/
- public void putMap(final Map<? extends K, ? extends V> objs) throws NullPointerException, IllegalArgumentException
+ public void putMap(final Map<? extends K, ? extends V> objs) throws IllegalArgumentException
{
if (objs == null)
{
@@ -444,7 +444,7 @@
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
- public V remove(Serializable name) throws NullPointerException
+ public V remove(Serializable name) throws IllegalArgumentException
{
if (name == null)
{
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/AbstractExoCache.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/AbstractExoCache.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/AbstractExoCache.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -107,7 +107,7 @@
{
if (listener == null)
{
- throw new NullPointerException();
+ throw new IllegalArgumentException();
}
listeners.add(new ListenerContext<K, V>(listener, this));
}
@@ -234,11 +234,11 @@
/**
* {@inheritDoc}
*/
- public void put(K key, V value) throws NullPointerException
+ public void put(K key, V value) throws IllegalArgumentException
{
if (key == null)
{
- throw new NullPointerException("No null cache key accepted");
+ throw new IllegalArgumentException("No null cache key accepted");
}
putOnly(key, value);
onPut(key, value);
@@ -255,11 +255,11 @@
/**
* {@inheritDoc}
*/
- public void putMap(Map<? extends K, ? extends V> objs) throws NullPointerException, IllegalArgumentException
+ public void putMap(Map<? extends K, ? extends V> objs) throws IllegalArgumentException
{
if (objs == null)
{
- throw new NullPointerException("No null map accepted");
+ throw new IllegalArgumentException("No null map accepted");
}
for (Serializable name : objs.keySet())
{
@@ -299,11 +299,11 @@
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
- public V remove(Serializable name) throws NullPointerException
+ public V remove(Serializable name) throws IllegalArgumentException
{
if (name == null)
{
- throw new NullPointerException("No null cache key accepted");
+ throw new IllegalArgumentException("No null cache key accepted");
}
final Fqn<Serializable> fqn = getFqn(name);
// We use the methods peek and getDirect to avoid going through the interceptor chain
Modified: 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 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/ConcurrentPicoContainer.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -111,7 +111,9 @@
public ConcurrentPicoContainer(ComponentAdapterFactory componentAdapterFactory, PicoContainer parent)
{
if (componentAdapterFactory == null)
- throw new NullPointerException("componentAdapterFactory");
+ {
+ throw new IllegalArgumentException("componentAdapterFactory");
+ }
this.componentAdapterFactory = componentAdapterFactory;
this.parent = parent == null ? null : new ImmutablePicoContainer(parent);
}
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/StandaloneContainer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/StandaloneContainer.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/StandaloneContainer.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -424,7 +424,10 @@
}
catch (Exception ex)
{
- // ignore me
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + ex.getMessage());
+ }
}
}
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/component/RequestLifeCycle.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/component/RequestLifeCycle.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/component/RequestLifeCycle.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -96,7 +96,7 @@
{
if (container == null)
{
- throw new NullPointerException();
+ throw new IllegalArgumentException();
}
RequestLifeCycleStack lf = current.get();
if (lf == null)
@@ -118,7 +118,7 @@
{
if (lifeCycle == null)
{
- throw new NullPointerException();
+ throw new IllegalArgumentException();
}
RequestLifeCycleStack lf = current.get();
if (lf == null)
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 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/ConfigurationUnmarshaller.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -70,7 +70,7 @@
public class ConfigurationUnmarshaller
{
- private static final Log log = ExoLogger.getLogger("exo.kernel.container.ConfigurationUnmarshaller");
+ private static final Log LOG = ExoLogger.getLogger("exo.kernel.container.ConfigurationUnmarshaller");
/**
* A private copy of the list of kernel namespaces
@@ -92,14 +92,14 @@
public void warning(SAXParseException exception) throws SAXException
{
- log.warn(exception.getMessage(), exception);
+ LOG.warn(exception.getMessage(), exception);
}
public void error(SAXParseException exception) throws SAXException
{
if (exception.getMessage().equals("cvc-elt.1: Cannot find the declaration of element 'configuration'."))
{
- log.info("The document "
+ LOG.info("The document "
+ url
+ " does not contain a schema declaration, it should have an "
+ "XML declaration similar to\n"
@@ -111,7 +111,7 @@
}
else
{
- log.error("In document " + url + " at (" + exception.getLineNumber() + "," + exception.getColumnNumber()
+ LOG.error("In document " + url + " at (" + exception.getLineNumber() + "," + exception.getColumnNumber()
+ ") :" + exception.getMessage());
}
valid = false;
@@ -119,7 +119,7 @@
public void fatalError(SAXParseException exception) throws SAXException
{
- log.fatal("In document " + url + " at (" + exception.getLineNumber() + "," + exception.getColumnNumber()
+ LOG.fatal("In document " + url + " at (" + exception.getLineNumber() + "," + exception.getColumnNumber()
+ ") :" + exception.getMessage());
valid = false;
}
@@ -172,12 +172,12 @@
}
catch (ParserConfigurationException e)
{
- log.error("Got a parser configuration exception when doing XSD validation");
+ LOG.error("Got a parser configuration exception when doing XSD validation");
return false;
}
catch (SAXException e)
{
- log.error("Got a sax exception when doing XSD validation");
+ LOG.error("Got a sax exception when doing XSD validation");
return false;
}
}
@@ -204,7 +204,10 @@
}
catch (Exception e)
{
- // ignore me
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
@@ -216,7 +219,7 @@
boolean valid = isValid(url);
if (!valid)
{
- log.info("The configuration file " + url + " was not found valid according to its XSD");
+ LOG.info("The configuration file " + url + " was not found valid according to its XSD");
}
}
@@ -239,7 +242,7 @@
if (cause instanceof FactoryConfigurationError)
{
// do nothing and let try to instantiate later
- log.debug("Was not able to find document builder factory class in Java > 5, will use default", cause);
+ LOG.debug("Was not able to find document builder factory class in Java > 5, will use default", cause);
}
else
{
@@ -249,7 +252,10 @@
}
catch (NoSuchMethodException e)
{
- // Java < 6
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
//
@@ -295,8 +301,8 @@
String document = buffer.toString();
// Debug
- if (log.isTraceEnabled())
- log.trace("About to parse configuration file " + document);
+ if (LOG.isTraceEnabled())
+ LOG.trace("About to parse configuration file " + document);
//
IBindingFactory bfact = BindingDirectory.getFactory(Configuration.class);
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/ManageableContainer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/ManageableContainer.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/ManageableContainer.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -246,7 +246,10 @@
}
catch (Exception e)
{
- // Ignore, may be caused by lazy initialization mechanism
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return super.unregisterComponent(componentKey);
}
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/ManagementContextImpl.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/ManagementContextImpl.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/ManagementContextImpl.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -75,7 +75,7 @@
{
if (container == null)
{
- throw new NullPointerException();
+ throw new IllegalArgumentException();
}
//
@@ -102,11 +102,11 @@
{
if (parent == null)
{
- throw new NullPointerException();
+ throw new IllegalArgumentException();
}
if (container == null)
{
- throw new NullPointerException();
+ throw new IllegalArgumentException();
}
//
@@ -133,7 +133,7 @@
{
if (parent == null)
{
- throw new NullPointerException();
+ throw new IllegalArgumentException();
}
if ((resource != null && typeMD == null) && (resource == null && typeMD != null))
{
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/MetaDataBuilder.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/MetaDataBuilder.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/MetaDataBuilder.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -91,7 +91,7 @@
{
if (clazz == null)
{
- throw new NullPointerException();
+ throw new IllegalArgumentException();
}
//
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -27,6 +27,7 @@
import java.lang.management.ManagementFactory;
import java.lang.reflect.Method;
import java.net.URI;
+import java.net.URISyntaxException;
import java.security.PrivilegedAction;
import java.security.PrivilegedExceptionAction;
@@ -42,7 +43,7 @@
/**
* The logger
*/
- private static final Log log = ExoLogger.getLogger("exo.kernel.container.J2EEServerInfo");
+ private static final Log LOG = ExoLogger.getLogger("exo.kernel.container.J2EEServerInfo");
/**
* The name of the JVM parameter that allows us to change the location of the
@@ -101,10 +102,20 @@
{
exoConfDir_ = new File(new File(new URI(jbossConfigUrl)), confDirName).getAbsolutePath();
}
- catch (Throwable e)
+ catch (SecurityException e)
{
- // don't care about it
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
+ catch (URISyntaxException e)
+ {
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
+ }
}
//
@@ -124,7 +135,7 @@
}
catch (Exception ignore)
{
- log.error(ignore.getLocalizedMessage(), ignore);
+ LOG.error(ignore.getLocalizedMessage(), ignore);
}
}
else if (jettyHome != null)
@@ -182,7 +193,7 @@
String exoConfHome = PrivilegedSystemHelper.getProperty(EXO_CONF_PARAM);
if (exoConfHome != null && exoConfHome.length() > 0)
{
- log.info("Override exo-conf directory '" + exoConfDir_ + "' with location '" + exoConfHome
+ LOG.info("Override exo-conf directory '" + exoConfDir_ + "' with location '" + exoConfHome
+ "'");
exoConfDir_ = exoConfHome;
}
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 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/util/ContainerUtil.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -52,7 +52,7 @@
public class ContainerUtil
{
/** The logger. */
- private static final Log log = ExoLogger.getExoLogger(ContainerUtil.class);
+ private static final Log LOG = ExoLogger.getExoLogger(ContainerUtil.class);
static public Constructor<?>[] getSortedConstructors(Class<?> clazz) throws NoClassDefFoundError
{
@@ -142,7 +142,7 @@
}
catch (Exception ex)
{
- log.error("Failed to instanciate plugin " + plugin.getType() + ": " + ex.getMessage(), ex);
+ LOG.error("Failed to instanciate plugin " + plugin.getType() + ": " + ex.getMessage(), ex);
}
}
@@ -163,7 +163,7 @@
}
catch (Exception ex)
{
- log.error("Failed to instanciate plugin " + plugin.getType() + ": " + ex.getMessage(), ex);
+ LOG.error("Failed to instanciate plugin " + plugin.getType() + ": " + ex.getMessage(), ex);
}
}
}
@@ -188,7 +188,7 @@
if (component.isMultiInstance())
{
container.registerComponent(new ConstructorInjectionComponentAdapter(classType, classType));
- log.debug("===>>> Thread local component " + classType.getName() + " registered.");
+ LOG.debug("===>>> Thread local component " + classType.getName() + " registered.");
}
else
{
@@ -203,7 +203,7 @@
if (component.isMultiInstance())
{
container.registerComponent(new ConstructorInjectionComponentAdapter(keyType, classType));
- log.debug("===>>> Thread local component " + classType.getName() + " registered.");
+ LOG.debug("===>>> Thread local component " + classType.getName() + " registered.");
}
else
{
@@ -218,7 +218,7 @@
}
catch (ClassNotFoundException ex)
{
- log.error("Cannot register the component corresponding to key = '" + key + "' and type = '" + type + "'", ex);
+ LOG.error("Cannot register the component corresponding to key = '" + key + "' and type = '" + type + "'", ex);
}
}
}
@@ -259,19 +259,19 @@
String fileName = url.getFile();
if (Tools.endsWithIgnoreCase(path, ".properties"))
{
- if (log.isDebugEnabled())
- log.debug("Attempt to load property file " + path);
+ if (LOG.isDebugEnabled())
+ LOG.debug("Attempt to load property file " + path);
props = PropertiesLoader.load(in);
}
else if (Tools.endsWithIgnoreCase(fileName, ".xml"))
{
- if (log.isDebugEnabled())
- log.debug("Attempt to load property file " + path + " with XML format");
+ if (LOG.isDebugEnabled())
+ LOG.debug("Attempt to load property file " + path + " with XML format");
props = PropertiesLoader.loadFromXML(in);
}
- else if (log.isDebugEnabled())
+ else if (LOG.isDebugEnabled())
{
- log.debug("Will not load property file" + path + " because its format is not recognized");
+ LOG.debug("Will not load property file" + path + " because its format is not recognized");
}
if (props != null && resolveVariables)
{
@@ -289,12 +289,12 @@
}
else
{
- log.error("Could not load property file " + path);
+ LOG.error("Could not load property file " + path);
}
}
catch (Exception e)
{
- log.error("Cannot load property file " + path, e);
+ LOG.error("Cannot load property file " + path, e);
}
finally
{
@@ -306,6 +306,10 @@
}
catch (IOException ignore)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + ignore.getMessage());
+ }
}
}
}
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/util/TemplateConfigurationHelper.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/util/TemplateConfigurationHelper.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/util/TemplateConfigurationHelper.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -20,6 +20,8 @@
import org.exoplatform.commons.utils.PrivilegedFileHelper;
import org.exoplatform.container.configuration.ConfigurationManager;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -42,6 +44,9 @@
*/
public class TemplateConfigurationHelper
{
+
+ private static final Log LOG = ExoLogger.getLogger("exo.kernel.container.TemplateConfigurationHelper");
+
// list with include-patterns
private List<Pattern> includes = new ArrayList<Pattern>();
@@ -147,7 +152,10 @@
}
catch (Exception e)
{
- // will try to use another resolve mechanism
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
// try to get resource by class loader
@@ -172,7 +180,10 @@
}
catch (IOException e)
{
- // Still can't resolve
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
return inputStream;
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 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/xml/Configuration.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -47,7 +47,7 @@
public static final String KERNEL_CONFIGURATION_1_0_URI = "http://www.exoplaform.org/xml/ns/kernel_1_0.xsd";
- private static final Log log = ExoLogger.getLogger("exo.kernel.container.Configuration");
+ private static final Log LOG = ExoLogger.getLogger("exo.kernel.container.Configuration");
private Map<String, ContainerLifecyclePlugin> containerLifecyclePlugin_ =
new HashMap<String, ContainerLifecyclePlugin>();
@@ -264,7 +264,7 @@
}
catch (CloneNotSupportedException e)
{
- log.warn("Could not clone the configuration", e);
+ LOG.warn("Could not clone the configuration", e);
break;
}
}
@@ -291,7 +291,7 @@
}
catch (Exception e)
{
- log.warn("Couldn't dump the runtime configuration in XML Format", e);
+ LOG.warn("Couldn't dump the runtime configuration in XML Format", e);
}
}
@@ -308,7 +308,7 @@
}
catch (Exception e)
{
- log.warn("Cannot convert the configuration to XML format", e);
+ LOG.warn("Cannot convert the configuration to XML format", e);
return null;
}
finally
@@ -319,6 +319,10 @@
}
catch (IOException ignore)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + ignore.getMessage());
+ }
}
}
return sw.toString();
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/xml/ObjectParam.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/xml/ObjectParam.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/xml/ObjectParam.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -100,7 +100,7 @@
}
}
}
- catch (Throwable ex)
+ catch (Exception ex)
{
// if(prop != null) {
// S ystem.out.println("Exception when try setting the prop.name " +
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedMethodMetaData.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedMethodMetaData.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedMethodMetaData.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -49,17 +49,17 @@
*
* @param method the method
* @param impactType the access mode
- * @throws NullPointerException if the method is null or the impact is null
+ * @throws IllegalArgumentException if the method is null or the impact is null
*/
- public ManagedMethodMetaData(Method method, ImpactType impactType) throws NullPointerException
+ public ManagedMethodMetaData(Method method, ImpactType impactType) throws IllegalArgumentException
{
if (method == null)
{
- throw new NullPointerException();
+ throw new IllegalArgumentException();
}
if (impactType == null)
{
- throw new NullPointerException();
+ throw new IllegalArgumentException();
}
//
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedPropertyMetaData.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedPropertyMetaData.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedPropertyMetaData.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -48,12 +48,11 @@
private final ManagedParameterMetaData setterParameter;
public ManagedPropertyMetaData(String name, Method getter, String getterDescription, Method setter,
- String setterDescription, ManagedParameterMetaData setterParameter) throws NullPointerException,
- IllegalArgumentException
+ String setterDescription, ManagedParameterMetaData setterParameter) throws IllegalArgumentException
{
if (name == null)
{
- throw new NullPointerException("No null name accepted");
+ throw new IllegalArgumentException("No null name accepted");
}
if (setter != null)
{
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedTypeMetaData.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedTypeMetaData.java 2012-01-26 10:14:51 UTC (rev 5520)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/management/spi/ManagedTypeMetaData.java 2012-01-26 10:23:07 UTC (rev 5521)
@@ -43,11 +43,11 @@
/** . */
private final Map<MethodKey, ManagedMethodMetaData> methods;
- public ManagedTypeMetaData(Class type) throws NullPointerException
+ public ManagedTypeMetaData(Class type) throws IllegalArgumentException
{
if (type == null)
{
- throw new NullPointerException();
+ throw new IllegalArgumentException();
}
//
12 years, 3 months
exo-jcr SVN: r5520 - kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-01-26 05:14:51 -0500 (Thu, 26 Jan 2012)
New Revision: 5520
Modified:
kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/IOUtil.java
Log:
EXOJCR-1725: Fixed the Blocker/Critical violations and the easiest Major ones raised by eXo Quality Level 1.2
Modified: kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/IOUtil.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/IOUtil.java 2012-01-25 15:36:50 UTC (rev 5519)
+++ kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/IOUtil.java 2012-01-26 10:14:51 UTC (rev 5520)
@@ -202,7 +202,7 @@
*
* @param resource the resource name
* @return the resource content
- * @throws NullPointerException if the specified argument is null or the loaded resource does not exist
+ * @throws IllegalArgumentException if the specified argument is null or the loaded resource does not exist
* @throws IOException thrown by accessing the resource
*/
static public String getResourceAsString(String resource) throws IOException
12 years, 3 months
exo-jcr SVN: r5519 - jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/core.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2012-01-25 10:36:50 -0500 (Wed, 25 Jan 2012)
New Revision: 5519
Modified:
jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/core/organization-service.xml
Log:
EXOJCR-1717: added a chapter to docbook describing how to implement a custom organization service
Modified: jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/core/organization-service.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/core/organization-service.xml 2012-01-25 15:04:48 UTC (rev 5518)
+++ jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/core/organization-service.xml 2012-01-25 15:36:50 UTC (rev 5519)
@@ -107,6 +107,373 @@
</section>
<section>
+ <title>Custom Organization Service implementation instructions</title>
+
+ <para>To create a custom organization service you need to implement a
+ several interfaces and extend some classes which will be listed
+ below.</para>
+
+ <section>
+ <title>Basic entities implementation</title>
+
+ <para>First of all you need to create classes implementing the following
+ interfaces (each of which represent a basic unit of organization
+ service):</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.User</ulink></para>
+
+ <para>This is the interface for a User data model. The
+ OrganizationService implementor can use the different strategy to
+ implement this class, he can use the native field for each get
+ method or use a Map to hold the user data.</para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.UserProfile</ulink></para>
+
+ <para>This is the interface for a UserProfile data model. The
+ implementor should have an user map info in the implementation. The
+ map should only accept the java.lang.String for the key and the
+ value.</para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.Group</ulink></para>
+
+ <para>This is the interface for the group data model.</para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.Membership</ulink></para>
+
+ <para>This is the interface for the membership data model.</para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.MembershipType</ulink></para>
+
+ <para>This is the interface for the membership type data
+ model.</para>
+ </listitem>
+ </itemizedlist>
+
+ <note>
+ <para>After each set method is called the developer must call
+ UserHandler.saveUser (GroupHandler.saveGroup,
+ MembershipHandler.saveMembership etc.) method to persist the
+ changes.</para>
+ </note>
+
+ <para>You can find examples of the mentioned above implementations at
+ subversion server:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/src/main/...">UserImpl</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/src/main/...">UserProfileImpl</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/src/main/...">GroupImpl</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/src/main/...">MembershipImpl</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/src/main/...">MembershipTypeImpl</ulink></para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>Unit handlers implementation</title>
+
+ <para>After you created basic organization service unit instances you
+ need to create classess to handle them e.g. to persist changes, to add
+ listener etc. For that purpose you need to implement a several
+ interfaces correspondingly:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>User handler</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.UserHandler</ulink></para>
+
+ <para>This class is acted as a sub component of the organization
+ service. It is used to manage the user account and broadcast the
+ user event to all the registered listener in the organization
+ service. The user event can be: new user event, update user
+ event and delete user event. Each event should have 2 phases:
+ pre event and post event. The method createUser , saveUser and
+ removeUser broadcast the event at each phase so the listeners
+ can handle the event properly.</para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.ExtendedUserHandler</ulink></para>
+
+ <para><emphasis role="bold">Optional</emphasis>. Implement it if
+ you want to be able to use <ulink
+ url="http://en.wikipedia.org/wiki/Digest_access_authentication">Digest
+ access authentication</ulink> i.e. you need a one way password
+ encyption for authentication.</para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.UserEventListenerHandler</ulink></para>
+
+ <para><emphasis role="bold">Optional</emphasis>. Provides the
+ ability to get the list of <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.UserEventListener</ulink>.
+ List should be unmodifiable to prevent modification outside of
+ <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.UserHandler</ulink>.</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+
+ <listitem>
+ <para>User profile handler</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.UserProfileHandler</ulink></para>
+
+ <para>This interface is acted as a sub interface of the
+ organization service. It is used to manage the the UserProfile
+ record, the extra information of an user such address, phone...
+ The interface should allow the developer create, delete and
+ update a UserProfile. and broadcast the event to the user
+ profile event listeners.</para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.UserProfileEventListenerHandler</ulink></para>
+
+ <para><emphasis role="bold">Optional</emphasis>. Provides the
+ ability to get the list of <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.UserProfileEventListener</ulink>.
+ List should be unmodifiable to prevent modification outside of
+ <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.UserProfileHandler</ulink>.</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+
+ <listitem>
+ <para>Group handler</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.GroupHandler</ulink></para>
+
+ <para>This class is acted as a sub component of the organization
+ service. It is used to manage the group and broadcast the group
+ event to all the registered listener in the organization
+ service. The group event can be: new group event, update group
+ event and delete group event. Each event should have 2 phases:
+ pre event and post event. The methods createGroup, saveGroup and
+ removeGroup broadcast the event at each phase so the listeners
+ can handle the event properly.</para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.GroupEventListenerHandler</ulink></para>
+
+ <para><emphasis role="bold">Optional</emphasis>. Provides the
+ ability to get the of <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.GroupEventListener</ulink>.
+ List should be unmodifiable to prevent modification outside of
+ <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.GroupHandler</ulink>.</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+
+ <listitem>
+ <para>Membership handler</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.MembershipHandler</ulink></para>
+
+ <para>This class is acted as a sub component of the organization
+ service. It is used to manage the membership - the relation of
+ user , group, and membership type - and broadcast the membership
+ event to all the registered listener in the organization
+ service. The membership event can be: new linked membership and
+ delete the membership type event. Each event should have 2
+ phases: pre event and post event. The method linkMembership and
+ removeMembership broadcast the event at each phase so the
+ listeners can handle the event properly.</para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.MembershipEventListenerHandler</ulink></para>
+
+ <para><emphasis role="bold">Optional</emphasis>. Provides the
+ ability to get the of <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.MembershipEventListener</ulink>.
+ List should be unmodifiable to prevent modification outside of
+ <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.MembershipHandler</ulink>.</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+
+ <listitem>
+ <para>Membership type handler</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.MembershipTypeHandler</ulink></para>
+
+ <para>This class is acted as a sub component of the organization
+ service. It is used to manage the membership - the relation of
+ user , group, and membership type - and broadcast the membership
+ event to all the registered listener in the organization
+ service. The membership event can be: new linked membership and
+ delete the membership type event. Each event should have 2
+ phases: pre event and post event. The method linkMembership and
+ removeMembership broadcast the event at each phase so the
+ listeners can handle the event properly.</para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.MembershipTypeEventListenerHandler</ulink></para>
+
+ <para><emphasis role="bold">Optional</emphasis>. Provides the
+ ability to get the list of <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.MembershipTypeEventListener</ulink>.
+ List should be unmodifiable to prevent modification outside of
+ <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.MembershipTypeHandler</ulink>.</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </itemizedlist>
+
+ <para>You can find examples of the mentioned above implementations at
+ subversion server:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/src/main/...">UserHandlerImpl</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/src/main/...">UserProfileHandlerImpl</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/src/main/...">GroupHandlerImpl</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/src/main/...">MembershipHandlerImpl</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/src/main/...">MembershipTypeHandlerImpl</ulink></para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>Extending BaseOrganizationService class</title>
+
+ <para>Finally you need to create your main custom organization service
+ class. It must extend <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.BaseOrganizationService</ulink>.
+ BaseOrganizationService class contains organization service unit
+ handlers as protected fields, so you can initialize them in accordance
+ to your purposes. It also has <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.OrganizationService</ulink>
+ interface methods' implementations. This is the class you need to
+ mention in the configuration file if you want to use your custom
+ organization service.</para>
+
+ <para>You can find example of such class at subversion server: <ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/src/main/...">JCROrganizationServiceImpl</ulink>.</para>
+ </section>
+
+ <section>
+ <title>Verification of compliance</title>
+
+ <para>Make sure that your custom organization service implementation is
+ fully compliant with Organization Service TCK tests. Tests are available
+ as maven artifact:</para>
+
+ <para>groupId - <emphasis>org.exoplatform.core</emphasis></para>
+
+ <para>artifactId -
+ <emphasis>exo.core.component.organization.tests</emphasis></para>
+
+ <para>You can find TCK tests package source code <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">here</ulink></para>
+
+ <note>
+ <para>In order to be able to run unit tests you may need to configure
+ the following maven plugins:<itemizedlist>
+ <listitem>
+ <para><ulink
+ url="http://maven.apache.org/plugins/maven-dependency-plugin/">maven-dependency-plugin</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="http://mojo.codehaus.org/build-helper-maven-plugin/">build-helper-maven-plugin</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="http://maven.apache.org/plugins/maven-surefire-plugin/">maven-surefire-plugin</ulink></para>
+ </listitem>
+ </itemizedlist> Check <ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/pom.xml">pom.xml</ulink>
+ file to find out one of the ways to configure maven project object
+ model. More detailed description you can find in the dedicated chapter
+ called "Organization Service TCK tests configuration"</para>
+ </note>
+ </section>
+ </section>
+
+ <section>
<title>Related articles and how-tos</title>
<itemizedlist>
12 years, 3 months
exo-jcr SVN: r5518 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/core.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2012-01-25 10:04:48 -0500 (Wed, 25 Jan 2012)
New Revision: 5518
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/core/organization-service.xml
Log:
EXOJCR-1717: added chapter to docbook describing how to implement a custom organization service
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/core/organization-service.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/core/organization-service.xml 2012-01-25 13:00:12 UTC (rev 5517)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/core/organization-service.xml 2012-01-25 15:04:48 UTC (rev 5518)
@@ -107,6 +107,373 @@
</section>
<section>
+ <title>Custom Organization Service implementation instructions</title>
+
+ <para>To create a custom organization service you need to implement a
+ several interfaces and extend some classes which will be listed
+ below.</para>
+
+ <section>
+ <title>Basic entities implementation</title>
+
+ <para>First of all you need to create classes implementing the following
+ interfaces (each of which represent a basic unit of organization
+ service):</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.User</ulink></para>
+
+ <para>This is the interface for a User data model. The
+ OrganizationService implementor can use the different strategy to
+ implement this class, he can use the native field for each get
+ method or use a Map to hold the user data.</para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.UserProfile</ulink></para>
+
+ <para>This is the interface for a UserProfile data model. The
+ implementor should have an user map info in the implementation. The
+ map should only accept the java.lang.String for the key and the
+ value.</para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.Group</ulink></para>
+
+ <para>This is the interface for the group data model.</para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.Membership</ulink></para>
+
+ <para>This is the interface for the membership data model.</para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.MembershipType</ulink></para>
+
+ <para>This is the interface for the membership type data
+ model.</para>
+ </listitem>
+ </itemizedlist>
+
+ <note>
+ <para>After each set method is called the developer must call
+ UserHandler.saveUser (GroupHandler.saveGroup,
+ MembershipHandler.saveMembership etc.) method to persist the
+ changes.</para>
+ </note>
+
+ <para>You can find examples of the mentioned above implementations at
+ subversion server:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/src/main/...">UserImpl</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/src/main/...">UserProfileImpl</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/src/main/...">GroupImpl</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/src/main/...">MembershipImpl</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/src/main/...">MembershipTypeImpl</ulink></para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>Unit handlers implementation</title>
+
+ <para>After you created basic organization service unit instances you
+ need to create classess to handle them e.g. to persist changes, to add
+ listener etc. For that purpose you need to implement a several
+ interfaces correspondingly:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>User handler</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.UserHandler</ulink></para>
+
+ <para>This class is acted as a sub component of the organization
+ service. It is used to manage the user account and broadcast the
+ user event to all the registered listener in the organization
+ service. The user event can be: new user event, update user
+ event and delete user event. Each event should have 2 phases:
+ pre event and post event. The method createUser , saveUser and
+ removeUser broadcast the event at each phase so the listeners
+ can handle the event properly.</para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.ExtendedUserHandler</ulink></para>
+
+ <para><emphasis role="bold">Optional</emphasis>. Implement it if
+ you want to be able to use <ulink
+ url="http://en.wikipedia.org/wiki/Digest_access_authentication">Digest
+ access authentication</ulink> i.e. you need a one way password
+ encyption for authentication.</para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.UserEventListenerHandler</ulink></para>
+
+ <para><emphasis role="bold">Optional</emphasis>. Provides the
+ ability to get the list of <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.UserEventListener</ulink>.
+ List should be unmodifiable to prevent modification outside of
+ <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.UserHandler</ulink>.</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+
+ <listitem>
+ <para>User profile handler</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.UserProfileHandler</ulink></para>
+
+ <para>This interface is acted as a sub interface of the
+ organization service. It is used to manage the the UserProfile
+ record, the extra information of an user such address, phone...
+ The interface should allow the developer create, delete and
+ update a UserProfile. and broadcast the event to the user
+ profile event listeners.</para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.UserProfileEventListenerHandler</ulink></para>
+
+ <para><emphasis role="bold">Optional</emphasis>. Provides the
+ ability to get the list of <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.UserProfileEventListener</ulink>.
+ List should be unmodifiable to prevent modification outside of
+ <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.UserProfileHandler</ulink>.</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+
+ <listitem>
+ <para>Group handler</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.GroupHandler</ulink></para>
+
+ <para>This class is acted as a sub component of the organization
+ service. It is used to manage the group and broadcast the group
+ event to all the registered listener in the organization
+ service. The group event can be: new group event, update group
+ event and delete group event. Each event should have 2 phases:
+ pre event and post event. The methods createGroup, saveGroup and
+ removeGroup broadcast the event at each phase so the listeners
+ can handle the event properly.</para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.GroupEventListenerHandler</ulink></para>
+
+ <para><emphasis role="bold">Optional</emphasis>. Provides the
+ ability to get the of <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.GroupEventListener</ulink>.
+ List should be unmodifiable to prevent modification outside of
+ <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.GroupHandler</ulink>.</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+
+ <listitem>
+ <para>Membership handler</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.MembershipHandler</ulink></para>
+
+ <para>This class is acted as a sub component of the organization
+ service. It is used to manage the membership - the relation of
+ user , group, and membership type - and broadcast the membership
+ event to all the registered listener in the organization
+ service. The membership event can be: new linked membership and
+ delete the membership type event. Each event should have 2
+ phases: pre event and post event. The method linkMembership and
+ removeMembership broadcast the event at each phase so the
+ listeners can handle the event properly.</para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.MembershipEventListenerHandler</ulink></para>
+
+ <para><emphasis role="bold">Optional</emphasis>. Provides the
+ ability to get the of <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.MembershipEventListener</ulink>.
+ List should be unmodifiable to prevent modification outside of
+ <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.MembershipHandler</ulink>.</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+
+ <listitem>
+ <para>Membership type handler</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.MembershipTypeHandler</ulink></para>
+
+ <para>This class is acted as a sub component of the organization
+ service. It is used to manage the membership - the relation of
+ user , group, and membership type - and broadcast the membership
+ event to all the registered listener in the organization
+ service. The membership event can be: new linked membership and
+ delete the membership type event. Each event should have 2
+ phases: pre event and post event. The method linkMembership and
+ removeMembership broadcast the event at each phase so the
+ listeners can handle the event properly.</para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.MembershipTypeEventListenerHandler</ulink></para>
+
+ <para><emphasis role="bold">Optional</emphasis>. Provides the
+ ability to get the list of <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.MembershipTypeEventListener</ulink>.
+ List should be unmodifiable to prevent modification outside of
+ <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.MembershipTypeHandler</ulink>.</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </itemizedlist>
+
+ <para>You can find examples of the mentioned above implementations at
+ subversion server:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/src/main/...">UserHandlerImpl</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/src/main/...">UserProfileHandlerImpl</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/src/main/...">GroupHandlerImpl</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/src/main/...">MembershipHandlerImpl</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/src/main/...">MembershipTypeHandlerImpl</ulink></para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>Extending BaseOrganizationService class</title>
+
+ <para>Finally you need to create your main custom organization service
+ class. It must extend <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.BaseOrganizationService</ulink>.
+ BaseOrganizationService class contains organization service unit
+ handlers as protected fields, so you can initialize them in accordance
+ to your purposes. It also has <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">org.exoplatform.services.organization.OrganizationService</ulink>
+ interface methods' implementations. This is the class you need to
+ mention in the configuration file if you want to use your custom
+ organization service.</para>
+
+ <para>You can find example of such class at subversion server: <ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/src/main/...">JCROrganizationServiceImpl</ulink>.</para>
+ </section>
+
+ <section>
+ <title>Verification of compliance</title>
+
+ <para>Make sure that your custom organization service implementation is
+ fully compliant with Organization Service TCK tests. Tests are available
+ as maven artifact:</para>
+
+ <para>groupId - <emphasis>org.exoplatform.core</emphasis></para>
+
+ <para>artifactId -
+ <emphasis>exo.core.component.organization.tests</emphasis></para>
+
+ <para>You can find TCK tests package source code <ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/core/tags/2.4.5-GA/exo.core.compo...">here</ulink></para>
+
+ <note>
+ <para>In order to be able to run unit tests you may need to configure
+ the following maven plugins:<itemizedlist>
+ <listitem>
+ <para><ulink
+ url="http://maven.apache.org/plugins/maven-dependency-plugin/">maven-dependency-plugin</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="http://mojo.codehaus.org/build-helper-maven-plugin/">build-helper-maven-plugin</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="http://maven.apache.org/plugins/maven-surefire-plugin/">maven-surefire-plugin</ulink></para>
+ </listitem>
+ </itemizedlist> Check <ulink
+ url="http://svn.exoplatform.org/projects/jcr-services/tags/1.14.5-GA/pom.xml">pom.xml</ulink>
+ file to find out one of the ways to configure maven project object
+ model. More detailed description you can find in the dedicated chapter
+ called "Organization Service TCK tests configuration"</para>
+ </note>
+ </section>
+ </section>
+
+ <section>
<title>Related articles and how-tos</title>
<itemizedlist>
12 years, 3 months