JBoss Portal SVN: r7228 - in trunk/common/src/main/org/jboss/portal/common: adapter and 23 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-05-09 12:47:57 -0400 (Wed, 09 May 2007)
New Revision: 7228
Modified:
trunk/common/src/main/org/jboss/portal/common/FixMe.java
trunk/common/src/main/org/jboss/portal/common/NotYetImplemented.java
trunk/common/src/main/org/jboss/portal/common/adapter/AdaptedMethodDispatcher.java
trunk/common/src/main/org/jboss/portal/common/adapter/AdaptedMethodDispatcherFactory.java
trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdaptable.java
trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdapted.java
trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdapter.java
trunk/common/src/main/org/jboss/portal/common/adapter/DefaultJavaLangObjectAdapted.java
trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectAdapted.java
trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectMethodDispatcher.java
trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectMethodDispatcherFactory.java
trunk/common/src/main/org/jboss/portal/common/adapter/MethodDispatcher.java
trunk/common/src/main/org/jboss/portal/common/adapter/MethodDispatcherFactory.java
trunk/common/src/main/org/jboss/portal/common/ant/AbstractDeploymentTask.java
trunk/common/src/main/org/jboss/portal/common/ant/CannotCreateDirException.java
trunk/common/src/main/org/jboss/portal/common/ant/Deploy.java
trunk/common/src/main/org/jboss/portal/common/ant/DirException.java
trunk/common/src/main/org/jboss/portal/common/ant/Explode.java
trunk/common/src/main/org/jboss/portal/common/ant/FileIsNotDirException.java
trunk/common/src/main/org/jboss/portal/common/ant/Implode.java
trunk/common/src/main/org/jboss/portal/common/ant/Undeploy.java
trunk/common/src/main/org/jboss/portal/common/concurrent/loader/LoaderContext.java
trunk/common/src/main/org/jboss/portal/common/concurrent/loader/LoadingPolicy.java
trunk/common/src/main/org/jboss/portal/common/concurrent/loader/ObjectBatch.java
trunk/common/src/main/org/jboss/portal/common/concurrent/loader/ObjectLoader.java
trunk/common/src/main/org/jboss/portal/common/http/HttpHeader.java
trunk/common/src/main/org/jboss/portal/common/http/HttpHeaders.java
trunk/common/src/main/org/jboss/portal/common/http/HttpRequest.java
trunk/common/src/main/org/jboss/portal/common/http/HttpResponse.java
trunk/common/src/main/org/jboss/portal/common/http/QueryStringParser.java
trunk/common/src/main/org/jboss/portal/common/i18n/AbstractLocaleFormat.java
trunk/common/src/main/org/jboss/portal/common/i18n/BundleName.java
trunk/common/src/main/org/jboss/portal/common/i18n/CachingLocaleFormat.java
trunk/common/src/main/org/jboss/portal/common/i18n/ComplexResourceBundleFactory.java
trunk/common/src/main/org/jboss/portal/common/i18n/DefaultLocaleFormat.java
trunk/common/src/main/org/jboss/portal/common/i18n/I18NTools.java
trunk/common/src/main/org/jboss/portal/common/i18n/LocaleFactory.java
trunk/common/src/main/org/jboss/portal/common/i18n/LocaleFormat.java
trunk/common/src/main/org/jboss/portal/common/i18n/LocaleManager.java
trunk/common/src/main/org/jboss/portal/common/i18n/RFC3066LanguageTagLocaleFormat.java
trunk/common/src/main/org/jboss/portal/common/i18n/ResourceBundleFactory.java
trunk/common/src/main/org/jboss/portal/common/i18n/ResourceBundleManager.java
trunk/common/src/main/org/jboss/portal/common/i18n/SimpleResourceBundleFactory.java
trunk/common/src/main/org/jboss/portal/common/invocation/AbstractInvocationContext.java
trunk/common/src/main/org/jboss/portal/common/invocation/AttributeResolver.java
trunk/common/src/main/org/jboss/portal/common/invocation/EmptyAttributeResolver.java
trunk/common/src/main/org/jboss/portal/common/invocation/EmptyInterceptorStackFactory.java
trunk/common/src/main/org/jboss/portal/common/invocation/InterceptorStackFactory.java
trunk/common/src/main/org/jboss/portal/common/invocation/InvocationContext.java
trunk/common/src/main/org/jboss/portal/common/invocation/InvocationHandler.java
trunk/common/src/main/org/jboss/portal/common/invocation/Scope.java
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/AbstractSessionAttributeResolver.java
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/MapAttributeResolver.java
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/PrincipalAttributeResolver.java
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/RequestAttributeResolver.java
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/SessionAttributeResolver.java
trunk/common/src/main/org/jboss/portal/common/io/UndeclaredIOException.java
trunk/common/src/main/org/jboss/portal/common/jar/JarEntryInfo.java
trunk/common/src/main/org/jboss/portal/common/jar/JarInfo.java
trunk/common/src/main/org/jboss/portal/common/junit/ExtendedAssert.java
trunk/common/src/main/org/jboss/portal/common/junit/TransactionAssert.java
trunk/common/src/main/org/jboss/portal/common/junit/ant/ConfigurableJUnitTask.java
trunk/common/src/main/org/jboss/portal/common/junit/ant/ConfigurableJUnitTest.java
trunk/common/src/main/org/jboss/portal/common/junit/ant/TestParameter.java
trunk/common/src/main/org/jboss/portal/common/junit/ant/TestParameterValue.java
trunk/common/src/main/org/jboss/portal/common/markup/MarkupAttribute.java
trunk/common/src/main/org/jboss/portal/common/markup/MarkupElement.java
trunk/common/src/main/org/jboss/portal/common/net/URLFilter.java
trunk/common/src/main/org/jboss/portal/common/reflect/Modifier.java
trunk/common/src/main/org/jboss/portal/common/servlet/BufferingRequestWrapper.java
trunk/common/src/main/org/jboss/portal/common/servlet/BufferingResponseWrapper.java
trunk/common/src/main/org/jboss/portal/common/servlet/ServletOutputStreamBuffer.java
trunk/common/src/main/org/jboss/portal/common/test/MonoValuedTestParameterValue.java
trunk/common/src/main/org/jboss/portal/common/test/MultiValuedTestParameterValue.java
trunk/common/src/main/org/jboss/portal/common/test/TestParameterValue.java
trunk/common/src/main/org/jboss/portal/common/test/TestParametrization.java
trunk/common/src/main/org/jboss/portal/common/test/driver/DriverCommand.java
trunk/common/src/main/org/jboss/portal/common/test/driver/DriverResponse.java
trunk/common/src/main/org/jboss/portal/common/test/driver/ParameterNotBoundException.java
trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriver.java
trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverContainer.java
trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverException.java
trunk/common/src/main/org/jboss/portal/common/test/driver/TestSuite.java
trunk/common/src/main/org/jboss/portal/common/test/driver/command/StartTestCommand.java
trunk/common/src/main/org/jboss/portal/common/test/driver/response/EndTestResponse.java
trunk/common/src/main/org/jboss/portal/common/test/driver/response/ErrorResponse.java
trunk/common/src/main/org/jboss/portal/common/test/driver/response/FailureResponse.java
trunk/common/src/main/org/jboss/portal/common/test/info/TestContainerInfo.java
trunk/common/src/main/org/jboss/portal/common/test/info/TestInfo.java
trunk/common/src/main/org/jboss/portal/common/test/info/TestItemInfo.java
trunk/common/src/main/org/jboss/portal/common/test/info/TestParameterInfo.java
trunk/common/src/main/org/jboss/portal/common/test/junit/JUnitAdapter.java
trunk/common/src/main/org/jboss/portal/common/test/junit/POJOJUnitTest.java
trunk/common/src/main/org/jboss/portal/common/test/junit/ThrowableDecoder.java
trunk/common/src/main/org/jboss/portal/common/text/CharBuffer.java
trunk/common/src/main/org/jboss/portal/common/text/FastURLEncoder.java
trunk/common/src/main/org/jboss/portal/common/util/CopyOnWriteRegistry.java
trunk/common/src/main/org/jboss/portal/common/util/IteratorStatus.java
trunk/common/src/main/org/jboss/portal/common/util/MapAccessor.java
trunk/common/src/main/org/jboss/portal/common/util/MapBuilder.java
trunk/common/src/main/org/jboss/portal/common/util/MarkupInfo.java
trunk/common/src/main/org/jboss/portal/common/xml/NullEntityResolver.java
Log:
- Updated svn properties.
Modified: trunk/common/src/main/org/jboss/portal/common/FixMe.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/FixMe.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/FixMe.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -24,7 +24,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class FixMe extends UnsupportedOperationException
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/FixMe.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/NotYetImplemented.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/NotYetImplemented.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/NotYetImplemented.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -24,7 +24,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class NotYetImplemented extends UnsupportedOperationException
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/NotYetImplemented.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/adapter/AdaptedMethodDispatcher.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/adapter/AdaptedMethodDispatcher.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/adapter/AdaptedMethodDispatcher.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -26,7 +26,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
class AdaptedMethodDispatcher implements MethodDispatcher
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/adapter/AdaptedMethodDispatcher.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/adapter/AdaptedMethodDispatcherFactory.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/adapter/AdaptedMethodDispatcherFactory.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/adapter/AdaptedMethodDispatcherFactory.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -26,7 +26,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
class AdaptedMethodDispatcherFactory implements MethodDispatcherFactory
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/adapter/AdaptedMethodDispatcherFactory.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdaptable.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdaptable.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdaptable.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -23,10 +23,10 @@
package org.jboss.portal.common.adapter;
/**
- * Denotes an object that is class adaptable.
+ * Denotes an object that is class adaptable.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public interface ClassAdaptable
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdaptable.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdapted.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdapted.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdapted.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -26,7 +26,7 @@
* A class adapted.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class ClassAdapted
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdapted.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdapter.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdapter.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdapter.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,20 +22,20 @@
******************************************************************************/
package org.jboss.portal.common.adapter;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Proxy;
-import java.lang.reflect.Method;
import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
-import java.util.Map;
+import java.lang.reflect.Proxy;
import java.util.HashMap;
+import java.util.Map;
/**
* Creates a new class adapter.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class ClassAdapter
{
@@ -62,9 +62,10 @@
};
/**
- * Creates a new class adapter. The object adapted implementation used will be an instance of <code>JavaLangObjectAdapted</code>.
+ * Creates a new class adapter. The object adapted implementation used will be an instance of
+ * <code>JavaLangObjectAdapted</code>.
*
- * @param loader the class loader that will contain the dynamic proxy generated class
+ * @param loader the class loader that will contain the dynamic proxy generated class
* @param adapteds the array of class adapteds
* @throws NoSuchMethodException
* @throws IllegalArgumentException if an argument is null
@@ -77,8 +78,8 @@
/**
* Create a new class adapter.
*
- * @param loader the class loader that will contain the dynamic proxy generated class
- * @param adapteds the array of class adapteds
+ * @param loader the class loader that will contain the dynamic proxy generated class
+ * @param adapteds the array of class adapteds
* @param objectAdapted the implementation of object adapted
* @throws NoSuchMethodException
* @throws IllegalArgumentException if an argument is null
@@ -109,7 +110,7 @@
itfs[0] = ClassAdaptable.class;
//
- for (int i = 0;i < adapteds.length;i++)
+ for (int i = 0; i < adapteds.length; i++)
{
ClassAdapted adapted = adapteds[i];
@@ -133,7 +134,7 @@
private void addAdapted(Class adaptedClass, MethodDispatcherFactory methodDispatcherFactory)
{
Method[] methods = adaptedClass.getMethods();
- for (int j = 0;j < methods.length;j++)
+ for (int j = 0; j < methods.length; j++)
{
Method method = methods[j];
int modifiers = method.getModifiers();
@@ -147,9 +148,7 @@
}
}
- /**
- * Returns an instance of the the adaptable object.
- */
+ /** Returns an instance of the the adaptable object. */
public ClassAdaptable getAdaptable() throws IllegalAccessException, InstantiationException, InvocationTargetException
{
return (ClassAdaptable)ctor.newInstance(new Object[]{handler});
Property changes on: trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdapter.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/adapter/DefaultJavaLangObjectAdapted.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/adapter/DefaultJavaLangObjectAdapted.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/adapter/DefaultJavaLangObjectAdapted.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -24,7 +24,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class DefaultJavaLangObjectAdapted implements JavaLangObjectAdapted
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/adapter/DefaultJavaLangObjectAdapted.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectAdapted.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectAdapted.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectAdapted.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -26,7 +26,7 @@
* Defines contract for the <code>java.lang.Object</code> adapted.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public interface JavaLangObjectAdapted
{
@@ -50,7 +50,7 @@
* Implementation of <code>equals</code>.
*
* @param adaptable the adaptable object
- * @param obj the object to test equality with
+ * @param obj the object to test equality with
* @return true the equals value
*/
boolean equals(ClassAdaptable adaptable, Object obj);
Property changes on: trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectAdapted.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectMethodDispatcher.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectMethodDispatcher.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectMethodDispatcher.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -27,7 +27,7 @@
* are delegated by a dynamic proxy to the <code>InvocationHandler</code>.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
abstract class JavaLangObjectMethodDispatcher implements MethodDispatcher
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectMethodDispatcher.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectMethodDispatcherFactory.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectMethodDispatcherFactory.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectMethodDispatcherFactory.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -26,7 +26,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
class JavaLangObjectMethodDispatcherFactory implements MethodDispatcherFactory
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectMethodDispatcherFactory.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/adapter/MethodDispatcher.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/adapter/MethodDispatcher.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/adapter/MethodDispatcher.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -24,7 +24,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
interface MethodDispatcher
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/adapter/MethodDispatcher.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/adapter/MethodDispatcherFactory.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/adapter/MethodDispatcherFactory.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/adapter/MethodDispatcherFactory.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -26,7 +26,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
interface MethodDispatcherFactory
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/adapter/MethodDispatcherFactory.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/ant/AbstractDeploymentTask.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/ant/AbstractDeploymentTask.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/ant/AbstractDeploymentTask.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -42,7 +42,7 @@
* A deployment task.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5451 $
+ * @version $Revision$
*/
public abstract class AbstractDeploymentTask extends Task
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/ant/AbstractDeploymentTask.java
___________________________________________________________________
Name: svn:keywords
- "Author Date Id Revision"
+ Author Date Id Revision
Modified: trunk/common/src/main/org/jboss/portal/common/ant/CannotCreateDirException.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/ant/CannotCreateDirException.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/ant/CannotCreateDirException.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -26,7 +26,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5451 $
+ * @version $Revision$
*/
public class CannotCreateDirException extends DirException
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/ant/CannotCreateDirException.java
___________________________________________________________________
Name: svn:keywords
- "Author Date Id Revision"
+ Author Date Id Revision
Modified: trunk/common/src/main/org/jboss/portal/common/ant/Deploy.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/ant/Deploy.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/ant/Deploy.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -30,7 +30,7 @@
* A blocking deploy task.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5451 $
+ * @version $Revision$
*/
public class Deploy extends AbstractDeploymentTask
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/ant/Deploy.java
___________________________________________________________________
Name: svn:keywords
- "Author Date Id Revision"
+ Author Date Id Revision
Modified: trunk/common/src/main/org/jboss/portal/common/ant/DirException.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/ant/DirException.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/ant/DirException.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -26,7 +26,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5451 $
+ * @version $Revision$
*/
public class DirException extends Exception
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/ant/DirException.java
___________________________________________________________________
Name: svn:keywords
- "Author Date Id Revision"
+ Author Date Id Revision
Modified: trunk/common/src/main/org/jboss/portal/common/ant/Explode.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/ant/Explode.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/ant/Explode.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -44,7 +44,7 @@
* Ant task that explode an archive.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5451 $
+ * @version $Revision$
*/
public class Explode extends Task
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/ant/Explode.java
___________________________________________________________________
Name: svn:keywords
- "Author Date Id Revision"
+ Author Date Id Revision
Modified: trunk/common/src/main/org/jboss/portal/common/ant/FileIsNotDirException.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/ant/FileIsNotDirException.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/ant/FileIsNotDirException.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -26,7 +26,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5451 $
+ * @version $Revision$
*/
public class FileIsNotDirException extends DirException
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/ant/FileIsNotDirException.java
___________________________________________________________________
Name: svn:keywords
- "Author Date Id Revision"
+ Author Date Id Revision
Modified: trunk/common/src/main/org/jboss/portal/common/ant/Implode.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/ant/Implode.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/ant/Implode.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -42,7 +42,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5451 $
+ * @version $Revision$
*/
public class Implode extends Task
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/ant/Implode.java
___________________________________________________________________
Name: svn:keywords
- "Author Date Id Revision"
+ Author Date Id Revision
Modified: trunk/common/src/main/org/jboss/portal/common/ant/Undeploy.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/ant/Undeploy.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/ant/Undeploy.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -30,7 +30,7 @@
* A blocking undeploy task.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5451 $
+ * @version $Revision$
*/
public class Undeploy extends AbstractDeploymentTask
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/ant/Undeploy.java
___________________________________________________________________
Name: svn:keywords
- "Author Date Id Revision"
+ Author Date Id Revision
Modified: trunk/common/src/main/org/jboss/portal/common/concurrent/loader/LoaderContext.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/concurrent/loader/LoaderContext.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/concurrent/loader/LoaderContext.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -28,7 +28,7 @@
* Defines contextual services used for object batch loading service.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class LoaderContext
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/concurrent/loader/LoaderContext.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/concurrent/loader/LoadingPolicy.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/concurrent/loader/LoadingPolicy.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/concurrent/loader/LoadingPolicy.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -26,26 +26,24 @@
* Defines the loading policy for an object batch.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class LoadingPolicy
{
/**
- * When an attempt is made to load one object, all objects are loaded and the current thread waits
- * until all objects have been either loaded or failed.
+ * When an attempt is made to load one object, all objects are loaded and the current thread waits until all objects
+ * have been either loaded or failed.
*/
public static final LoadingPolicy LOAD_ALL_SYNC = new LoadingPolicy();
/**
- * When an attempt is made to load one object, all objects are loaded but the current thread will
- * only have to wait the object it is requesting.
+ * When an attempt is made to load one object, all objects are loaded but the current thread will only have to wait
+ * the object it is requesting.
*/
public static final LoadingPolicy LOAD_ALL_ASYNC = new LoadingPolicy();
- /**
- * When an attempt is made to load object object, only the requested object will be loaded.
- */
+ /** When an attempt is made to load object object, only the requested object will be loaded. */
public static final LoadingPolicy LOAD_ONE = new LoadingPolicy();
private LoadingPolicy()
Property changes on: trunk/common/src/main/org/jboss/portal/common/concurrent/loader/LoadingPolicy.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/concurrent/loader/ObjectBatch.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/concurrent/loader/ObjectBatch.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/concurrent/loader/ObjectBatch.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,17 +22,17 @@
******************************************************************************/
package org.jboss.portal.common.concurrent.loader;
+import edu.emory.mathcs.backport.java.util.concurrent.Callable;
+import edu.emory.mathcs.backport.java.util.concurrent.ExecutionException;
+import edu.emory.mathcs.backport.java.util.concurrent.Future;
import edu.emory.mathcs.backport.java.util.concurrent.locks.Lock;
import edu.emory.mathcs.backport.java.util.concurrent.locks.ReentrantLock;
-import edu.emory.mathcs.backport.java.util.concurrent.Future;
-import edu.emory.mathcs.backport.java.util.concurrent.Callable;
-import edu.emory.mathcs.backport.java.util.concurrent.ExecutionException;
/**
* Defines a batch of virtual objects.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class ObjectBatch
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/concurrent/loader/ObjectBatch.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/concurrent/loader/ObjectLoader.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/concurrent/loader/ObjectLoader.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/concurrent/loader/ObjectLoader.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -26,12 +26,10 @@
* Defines loading capabilities for an object.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public interface ObjectLoader
{
- /**
- * Loads an object or return null.
- */
+ /** Loads an object or return null. */
Object load();
}
Property changes on: trunk/common/src/main/org/jboss/portal/common/concurrent/loader/ObjectLoader.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/http/HttpHeader.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/http/HttpHeader.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/http/HttpHeader.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -23,15 +23,15 @@
package org.jboss.portal.common.http;
import java.io.Serializable;
-import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
+import java.util.List;
/**
* Modelize an http header structure.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class HttpHeader implements Serializable
{
@@ -90,9 +90,7 @@
return elements.iterator();
}
- /**
- * An element of an header
- */
+ /** An element of an header */
public static class Element implements Serializable
{
/** The mandatory name. */
@@ -174,9 +172,7 @@
return params.iterator();
}
- /**
- * A param of an element.
- */
+ /** A param of an element. */
public static class Param implements Serializable
{
/** The mandatory name. */
@@ -215,7 +211,7 @@
public String getValue()
{
StringBuffer buffer = new StringBuffer();
- for (Iterator j = elements();j.hasNext();)
+ for (Iterator j = elements(); j.hasNext();)
{
HttpHeader.Element elt = (HttpHeader.Element)j.next();
buffer.append(elt.getName());
@@ -223,7 +219,7 @@
{
buffer.append("=").append(elt.getValue());
}
- for (Iterator k = elt.params();k.hasNext();)
+ for (Iterator k = elt.params(); k.hasNext();)
{
HttpHeader.Element.Param param = (HttpHeader.Element.Param)k.next();
buffer.append(";").append(param.getName());
Property changes on: trunk/common/src/main/org/jboss/portal/common/http/HttpHeader.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/http/HttpHeaders.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/http/HttpHeaders.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/http/HttpHeaders.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,14 +22,14 @@
******************************************************************************/
package org.jboss.portal.common.http;
-import java.util.List;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
-import java.io.Serializable;
+import java.util.List;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class HttpHeaders implements Serializable
{
@@ -58,7 +58,7 @@
{
throw new IllegalArgumentException();
}
- for (Iterator i = headers.iterator();i.hasNext();)
+ for (Iterator i = headers.iterator(); i.hasNext();)
{
HttpHeader header = (HttpHeader)i.next();
if (header.getName().equals(name))
@@ -77,7 +77,7 @@
public String toString()
{
StringBuffer buffer = new StringBuffer();
- for (Iterator i = headers.iterator();i.hasNext();)
+ for (Iterator i = headers.iterator(); i.hasNext();)
{
HttpHeader header = (HttpHeader)i.next();
buffer.append(header.toString());
Property changes on: trunk/common/src/main/org/jboss/portal/common/http/HttpHeaders.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/http/HttpRequest.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/http/HttpRequest.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/http/HttpRequest.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -23,21 +23,21 @@
package org.jboss.portal.common.http;
import java.io.Serializable;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
-import java.util.Collections;
/**
* Just used to define the request body.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class HttpRequest implements Serializable
{
- public abstract static class Body implements Serializable
+ public abstract static class Body implements Serializable
{
}
Property changes on: trunk/common/src/main/org/jboss/portal/common/http/HttpRequest.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/http/HttpResponse.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/http/HttpResponse.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/http/HttpResponse.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -26,7 +26,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class HttpResponse implements Serializable
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/http/HttpResponse.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/http/QueryStringParser.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/http/QueryStringParser.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/http/QueryStringParser.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -24,14 +24,14 @@
import org.jboss.portal.common.util.URLTools;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.Map;
-import java.util.Collections;
import java.util.StringTokenizer;
-import java.util.HashMap;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class QueryStringParser
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/http/QueryStringParser.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/i18n/AbstractLocaleFormat.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/i18n/AbstractLocaleFormat.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/i18n/AbstractLocaleFormat.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,18 +22,18 @@
******************************************************************************/
package org.jboss.portal.common.i18n;
+import org.jboss.portal.common.io.UndeclaredIOException;
import org.jboss.portal.common.util.ConversionException;
import org.jboss.portal.common.util.NullConversionException;
-import org.jboss.portal.common.io.UndeclaredIOException;
-import java.util.Locale;
-import java.io.Writer;
import java.io.IOException;
import java.io.StringWriter;
+import java.io.Writer;
+import java.util.Locale;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public abstract class AbstractLocaleFormat implements LocaleFormat
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/i18n/AbstractLocaleFormat.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/i18n/BundleName.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/i18n/BundleName.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/i18n/BundleName.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -29,7 +29,7 @@
* The immutable name of a bundle.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class BundleName
{
@@ -129,7 +129,7 @@
country = locale.getCountry();
variant = locale.getVariant();
status = 8 + (language.length() > 0 ? 4 : 0) + (country.length() > 0 ? 2 : 0) + (variant.length() > 0 ? 1 : 0);
- switch(status & 0x7)
+ switch (status & 0x7)
{
case 0:
name = baseName;
@@ -173,7 +173,7 @@
}
else
{
- switch(status)
+ switch (status)
{
case 0:
throw new NoSuchElementException();
@@ -224,10 +224,9 @@
public static class Parser
{
/**
- *
* @param s
* @param from inclusive
- * @param to exclusive
+ * @param to exclusive
* @return
*/
public BundleName parse(String s, int from, int to)
Property changes on: trunk/common/src/main/org/jboss/portal/common/i18n/BundleName.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/i18n/CachingLocaleFormat.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/i18n/CachingLocaleFormat.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/i18n/CachingLocaleFormat.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,17 +22,16 @@
******************************************************************************/
package org.jboss.portal.common.i18n;
+import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap;
import org.jboss.portal.common.util.ConversionException;
-import java.util.Locale;
-import java.io.Writer;
import java.io.IOException;
+import java.io.Writer;
+import java.util.Locale;
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class CachingLocaleFormat implements LocaleFormat
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/i18n/CachingLocaleFormat.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/i18n/ComplexResourceBundleFactory.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/i18n/ComplexResourceBundleFactory.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/i18n/ComplexResourceBundleFactory.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -24,15 +24,15 @@
import org.jboss.portal.common.util.Tools;
-import java.util.ResourceBundle;
+import java.io.IOException;
+import java.io.InputStream;
import java.util.Locale;
import java.util.PropertyResourceBundle;
-import java.io.InputStream;
-import java.io.IOException;
+import java.util.ResourceBundle;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class ComplexResourceBundleFactory implements ResourceBundleFactory
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/i18n/ComplexResourceBundleFactory.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/i18n/DefaultLocaleFormat.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/i18n/DefaultLocaleFormat.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/i18n/DefaultLocaleFormat.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -24,18 +24,18 @@
import org.jboss.portal.common.util.FormatConversionException;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.HashMap;
+import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.io.Writer;
-import java.io.IOException;
/**
* Implementation for the programmatic name of a locale.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
class DefaultLocaleFormat extends AbstractLocaleFormat
{
@@ -45,7 +45,7 @@
static
{
- for (Iterator i = LocaleManager.getLocales().iterator();i.hasNext();)
+ for (Iterator i = LocaleManager.getLocales().iterator(); i.hasNext();)
{
Locale locale = (Locale)i.next();
Property changes on: trunk/common/src/main/org/jboss/portal/common/i18n/DefaultLocaleFormat.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/i18n/I18NTools.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/i18n/I18NTools.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/i18n/I18NTools.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -26,22 +26,19 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class I18NTools
{
- /**
- * Separator.
- */
+ /** Separator. */
private static final String RFC3066_SEPARATOR = "-";
/**
- * Retrieves the language identification tag associated to the specified Locale as defined by
- * <a href="http://www.ietf.org/rfc/rfc3066.txt">IETF RFC 3066</a> limited to 2-letter
- * language code per ISO standard 639, a "-" (dash) and a 2-letter country code per
- * ISO 3166 alpha-2 country codes. E.g. "en-US" for American English, "en-GB" for
- * British English, etc.
+ * Retrieves the language identification tag associated to the specified Locale as defined by <a
+ * href="http://www.ietf.org/rfc/rfc3066.txt">IETF RFC 3066</a> limited to 2-letter language code per ISO standard
+ * 639, a "-" (dash) and a 2-letter country code per ISO 3166 alpha-2 country codes. E.g. "en-US" for American
+ * English, "en-GB" for British English, etc.
*
* @param locale the locale which language tag is wanted
* @return a <a href="http://www.ietf.org/rfc/rfc3066.txt">IETF RFC 3066</a>-compatible language tag.
Property changes on: trunk/common/src/main/org/jboss/portal/common/i18n/I18NTools.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/i18n/LocaleFactory.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/i18n/LocaleFactory.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/i18n/LocaleFactory.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -26,7 +26,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public interface LocaleFactory
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/i18n/LocaleFactory.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/i18n/LocaleFormat.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/i18n/LocaleFormat.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/i18n/LocaleFormat.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -24,13 +24,13 @@
import org.jboss.portal.common.util.ConversionException;
+import java.io.IOException;
+import java.io.Writer;
import java.util.Locale;
-import java.io.Writer;
-import java.io.IOException;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public interface LocaleFormat
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/i18n/LocaleFormat.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/i18n/LocaleManager.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/i18n/LocaleManager.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/i18n/LocaleManager.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -30,7 +30,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class LocaleManager
{
@@ -38,9 +38,7 @@
/** . */
private static final Collection all = Collections.unmodifiableSet(Tools.toSet(Locale.getAvailableLocales()));
- /**
- * Return a collection of all available locale info for the platform.
- */
+ /** Return a collection of all available locale info for the platform. */
public static Collection getLocales()
{
return all;
Property changes on: trunk/common/src/main/org/jboss/portal/common/i18n/LocaleManager.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/i18n/RFC3066LanguageTagLocaleFormat.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/i18n/RFC3066LanguageTagLocaleFormat.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/i18n/RFC3066LanguageTagLocaleFormat.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -24,38 +24,30 @@
import org.jboss.portal.common.util.FormatConversionException;
-import java.util.regex.Pattern;
-import java.util.regex.Matcher;
-import java.util.Locale;
-import java.util.Arrays;
-import java.io.Writer;
import java.io.IOException;
+import java.io.Writer;
+import java.util.Arrays;
+import java.util.Locale;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
class RFC3066LanguageTagLocaleFormat extends AbstractLocaleFormat
{
- /**
- * Separator.
- */
+ /** Separator. */
private static final String RFC3066_SEPARATOR = "-";
- /**
- * Valid language tag matcher (see <a href="http://www.ietf.org/rfc/rfc3066.txt">IETF RFC 3066</a>).
- */
+ /** Valid language tag matcher (see <a href="http://www.ietf.org/rfc/rfc3066.txt">IETF RFC 3066</a>). */
private final Pattern RFC3066_COMPOUND_LANG_PATTERN = Pattern.compile("(\\p{Lower}{2})(-(\\p{Upper}{2}))?");
- /**
- * Sorted valid ISO country codes (needed for Arrays.binarySearch).
- */
+ /** Sorted valid ISO country codes (needed for Arrays.binarySearch). */
private final String[] SORTED_ISO_COUNTRIES = Locale.getISOCountries();
- /**
- * Sorted valid ISO language codes (needed for Arrays.binarySearch).
- */
+ /** Sorted valid ISO language codes (needed for Arrays.binarySearch). */
private final String[] SORTED_ISO_LANGUAGES = Locale.getISOLanguages();
protected Locale internalGetLocale(String value) throws FormatConversionException
@@ -85,11 +77,10 @@
}
/**
- * Retrieves the language identification tag associated to the specified Locale as defined by
- * <a href="http://www.ietf.org/rfc/rfc3066.txt">IETF RFC 3066</a> limited to 2-letter
- * language code per ISO standard 639, a "-" (dash) and a 2-letter country code per
- * ISO 3166 alpha-2 country codes. E.g. "en-US" for American English, "en-GB" for
- * British English, etc.
+ * Retrieves the language identification tag associated to the specified Locale as defined by <a
+ * href="http://www.ietf.org/rfc/rfc3066.txt">IETF RFC 3066</a> limited to 2-letter language code per ISO standard
+ * 639, a "-" (dash) and a 2-letter country code per ISO 3166 alpha-2 country codes. E.g. "en-US" for American
+ * English, "en-GB" for British English, etc.
*
* @param locale the locale which language tag is wanted
* @return a <a href="http://www.ietf.org/rfc/rfc3066.txt">IETF RFC 3066</a>-compatible language tag.
Property changes on: trunk/common/src/main/org/jboss/portal/common/i18n/RFC3066LanguageTagLocaleFormat.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/i18n/ResourceBundleFactory.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/i18n/ResourceBundleFactory.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/i18n/ResourceBundleFactory.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,14 +22,14 @@
******************************************************************************/
package org.jboss.portal.common.i18n;
+import java.util.Locale;
import java.util.ResourceBundle;
-import java.util.Locale;
/**
* Definition of a factory for resource bundles.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public interface ResourceBundleFactory
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/i18n/ResourceBundleFactory.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/i18n/ResourceBundleManager.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/i18n/ResourceBundleManager.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/i18n/ResourceBundleManager.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -24,23 +24,22 @@
import org.apache.log4j.Logger;
-import java.util.Map;
-import java.util.ResourceBundle;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
+import java.util.Map;
import java.util.MissingResourceException;
+import java.util.ResourceBundle;
/**
- * <p>Manage a set of resource bundles. Obtention of bundles is done using a ResourceBundleFactory object.
- * A bundle obtained succesfully is cached in order to avoid the potential expensive cost of bundle obtention.</p>
+ * <p>Manage a set of resource bundles. Obtention of bundles is done using a ResourceBundleFactory object. A bundle
+ * obtained succesfully is cached in order to avoid the potential expensive cost of bundle obtention.</p>
+ * <p/>
+ * <p>The manager can also be used to build LocalizedString object from the loaded bundles.</p>
*
- * <p>The manager can also be used to build LocalizedString object from the loaded bundles.</p>
- *
- *
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
- * @version $Revision: 6697 $
+ * @version $Revision$
*/
public class ResourceBundleManager
{
@@ -58,7 +57,7 @@
private ResourceBundleFactory resourceBundleFactory;
/**
- * @param defaultBundle the default bundle returned when no bundle has been obtained for the locale
+ * @param defaultBundle the default bundle returned when no bundle has been obtained for the locale
* @param resourceBundleFactory the resource bundle factory
* @throws IllegalArgumentException IllegalArgumentException if the resource bundle factory is null
*/
@@ -79,7 +78,7 @@
* <code>Locale.ENGLISH</code>. Two successive calls to this method may not return identical results since the
* returned <code>LocalizedString</code> is built using the bundles known by the manager.
*
- * @param key the key to lookup in the bundles
+ * @param key the key to lookup in the bundles
* @param defaultValue the default value
* @return the localized string
* @throws IllegalArgumentException if the key of the default value is null
Property changes on: trunk/common/src/main/org/jboss/portal/common/i18n/ResourceBundleManager.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/i18n/SimpleResourceBundleFactory.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/i18n/SimpleResourceBundleFactory.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/i18n/SimpleResourceBundleFactory.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,14 +22,14 @@
******************************************************************************/
package org.jboss.portal.common.i18n;
+import java.util.Locale;
import java.util.ResourceBundle;
-import java.util.Locale;
/**
* An implementation that delegates bundle loading to <code>ResourceBundle.getBundle(String,Locale,ClassLoader)</code>.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class SimpleResourceBundleFactory implements ResourceBundleFactory
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/i18n/SimpleResourceBundleFactory.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/invocation/AbstractInvocationContext.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/invocation/AbstractInvocationContext.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/invocation/AbstractInvocationContext.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,12 +22,12 @@
******************************************************************************/
package org.jboss.portal.common.invocation;
+import java.util.HashMap;
import java.util.Map;
-import java.util.HashMap;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class AbstractInvocationContext implements InvocationContext
{
@@ -132,7 +132,8 @@
}
/**
- * Typed registration to avoid issues classes that implement both interfaces AttributeResolver and InvocationContext.
+ * Typed registration to avoid issues classes that implement both interfaces AttributeResolver and
+ * InvocationContext.
*/
private abstract static class Registration
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/invocation/AbstractInvocationContext.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/invocation/AttributeResolver.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/invocation/AttributeResolver.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/invocation/AttributeResolver.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -28,7 +28,7 @@
* An attribute resolver.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public interface AttributeResolver
{
@@ -43,14 +43,14 @@
* Return an attribute from this resolver.
*
* @param attrKey
+ * @return the attribute value or null if it is not found
* @throws IllegalArgumentException if the attribute key is not valid
- * @return the attribute value or null if it is not found
*/
Object getAttribute(Object attrKey) throws IllegalArgumentException;
/**
- * Update an attribute value on this resolve. If the attribute value is null
- * the resolver must treat the operation as a removal of the attribute.
+ * Update an attribute value on this resolve. If the attribute value is null the resolver must treat the operation as
+ * a removal of the attribute.
*
* @param attrKey
* @param attrValue the attribute value
Property changes on: trunk/common/src/main/org/jboss/portal/common/invocation/AttributeResolver.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/invocation/EmptyAttributeResolver.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/invocation/EmptyAttributeResolver.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/invocation/EmptyAttributeResolver.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -21,12 +21,12 @@
*/
package org.jboss.portal.common.invocation;
+import java.util.Collections;
import java.util.Set;
-import java.util.Collections;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class EmptyAttributeResolver implements AttributeResolver
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/invocation/EmptyAttributeResolver.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/invocation/EmptyInterceptorStackFactory.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/invocation/EmptyInterceptorStackFactory.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/invocation/EmptyInterceptorStackFactory.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -24,7 +24,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class EmptyInterceptorStackFactory implements InterceptorStackFactory
{
@@ -36,6 +36,7 @@
{
return 0;
}
+
public Interceptor getInterceptor(int index) throws ArrayIndexOutOfBoundsException
{
throw new ArrayIndexOutOfBoundsException();
Property changes on: trunk/common/src/main/org/jboss/portal/common/invocation/EmptyInterceptorStackFactory.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/invocation/InterceptorStackFactory.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/invocation/InterceptorStackFactory.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/invocation/InterceptorStackFactory.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -24,7 +24,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public interface InterceptorStackFactory
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/invocation/InterceptorStackFactory.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/invocation/InvocationContext.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/invocation/InvocationContext.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/invocation/InvocationContext.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -24,7 +24,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public interface InvocationContext
{
@@ -58,8 +58,8 @@
void setAttribute(Scope attrScope, Object attrKey, Object attrValue) throws IllegalArgumentException;
/**
- * Remove an attribute value. If the attribute value is null
- * the resolver must treat the operation as a removal of the attribute.
+ * Remove an attribute value. If the attribute value is null the resolver must treat the operation as a removal of
+ * the attribute.
*
* @param attrKey
* @throws IllegalArgumentException if the attribute key is null or the attribute scope is not valid
Property changes on: trunk/common/src/main/org/jboss/portal/common/invocation/InvocationContext.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/invocation/InvocationHandler.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/invocation/InvocationHandler.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/invocation/InvocationHandler.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,12 +22,9 @@
******************************************************************************/
package org.jboss.portal.common.invocation;
-import org.jboss.portal.common.invocation.Invocation;
-import org.jboss.portal.common.invocation.InvocationException;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public interface InvocationHandler
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/invocation/InvocationHandler.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/invocation/Scope.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/invocation/Scope.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/invocation/Scope.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -26,7 +26,7 @@
* The scope of an attribute.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class Scope
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/invocation/Scope.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/invocation/resolver/AbstractSessionAttributeResolver.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/invocation/resolver/AbstractSessionAttributeResolver.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/invocation/resolver/AbstractSessionAttributeResolver.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -26,14 +26,14 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
-import java.util.Collections;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public abstract class AbstractSessionAttributeResolver implements AttributeResolver
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/invocation/resolver/AbstractSessionAttributeResolver.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/invocation/resolver/MapAttributeResolver.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/invocation/resolver/MapAttributeResolver.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/invocation/resolver/MapAttributeResolver.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -30,7 +30,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class MapAttributeResolver implements AttributeResolver
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/invocation/resolver/MapAttributeResolver.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/invocation/resolver/PrincipalAttributeResolver.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/invocation/resolver/PrincipalAttributeResolver.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/invocation/resolver/PrincipalAttributeResolver.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -27,7 +27,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class PrincipalAttributeResolver extends AbstractSessionAttributeResolver
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/invocation/resolver/PrincipalAttributeResolver.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/invocation/resolver/RequestAttributeResolver.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/invocation/resolver/RequestAttributeResolver.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/invocation/resolver/RequestAttributeResolver.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -30,7 +30,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class RequestAttributeResolver implements AttributeResolver
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/invocation/resolver/RequestAttributeResolver.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/invocation/resolver/SessionAttributeResolver.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/invocation/resolver/SessionAttributeResolver.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/invocation/resolver/SessionAttributeResolver.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -26,7 +26,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class SessionAttributeResolver extends AbstractSessionAttributeResolver
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/invocation/resolver/SessionAttributeResolver.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/io/UndeclaredIOException.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/io/UndeclaredIOException.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/io/UndeclaredIOException.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,14 +22,14 @@
******************************************************************************/
package org.jboss.portal.common.io;
+import java.io.IOException;
import java.lang.reflect.UndeclaredThrowableException;
-import java.io.IOException;
/**
* Avoid a method to declare an IOException in its signature when it is not necessary.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class UndeclaredIOException extends UndeclaredThrowableException
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/io/UndeclaredIOException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/jar/JarEntryInfo.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/jar/JarEntryInfo.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/jar/JarEntryInfo.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,19 +22,19 @@
******************************************************************************/
package org.jboss.portal.common.jar;
-import java.util.jar.JarEntry;
-import java.util.List;
-import java.util.Iterator;
+import java.net.MalformedURLException;
+import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
-import java.net.URL;
-import java.net.MalformedURLException;
+import java.util.Iterator;
+import java.util.List;
+import java.util.jar.JarEntry;
/**
* Enhance jar entry object by adding more info.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class JarEntryInfo implements Comparable
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/jar/JarEntryInfo.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/jar/JarInfo.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/jar/JarInfo.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/jar/JarInfo.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,18 +22,18 @@
******************************************************************************/
package org.jboss.portal.common.jar;
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.Iterator;
import java.util.SortedSet;
import java.util.TreeSet;
-import java.util.Enumeration;
-import java.util.Iterator;
+import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.jar.JarInputStream;
-import java.util.jar.JarEntry;
-import java.io.IOException;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class JarInfo
{
@@ -48,7 +48,7 @@
throw new IllegalArgumentException();
}
entries = new TreeSet();
- for (Enumeration e = file.entries();e.hasMoreElements();)
+ for (Enumeration e = file.entries(); e.hasMoreElements();)
{
JarEntry entry = (JarEntry)e.nextElement();
JarEntryInfo info = new JarEntryInfo(entry);
@@ -63,7 +63,7 @@
throw new IllegalArgumentException();
}
entries = new TreeSet();
- for (JarEntry entry = in.getNextJarEntry();entry !=null;entry = in.getNextJarEntry())
+ for (JarEntry entry = in.getNextJarEntry(); entry != null; entry = in.getNextJarEntry())
{
JarEntryInfo info = new JarEntryInfo(entry);
entries.add(info);
Property changes on: trunk/common/src/main/org/jboss/portal/common/jar/JarInfo.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/junit/ExtendedAssert.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/junit/ExtendedAssert.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/junit/ExtendedAssert.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -31,7 +31,7 @@
* Add more assert methods.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1842 $
+ * @version $Revision$
*/
public class ExtendedAssert extends Assert
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/junit/ExtendedAssert.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/junit/TransactionAssert.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/junit/TransactionAssert.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/junit/TransactionAssert.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -25,14 +25,14 @@
import junit.framework.Assert;
import junit.framework.AssertionFailedError;
-import javax.transaction.UserTransaction;
-import javax.transaction.Status;
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import javax.transaction.Status;
+import javax.transaction.UserTransaction;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5246 $
+ * @version $Revision$
*/
public class TransactionAssert extends Assert
{
@@ -117,9 +117,7 @@
}
}
- /**
- * Commit the transaction or fail.
- */
+ /** Commit the transaction or fail. */
public static void commitTransaction()
{
try
@@ -133,9 +131,7 @@
}
}
- /**
- * Rollback the transaction or fail.
- */
+ /** Rollback the transaction or fail. */
public static void rollbackTransaction()
{
rollbackTransaction(true);
@@ -178,9 +174,7 @@
}
}
- /**
- * Begin a transaction or fail.
- */
+ /** Begin a transaction or fail. */
public static void beginTransaction()
{
try
@@ -194,10 +188,7 @@
}
}
- /**
- * If no transaction do nothing.
- * End the transaction if it is active or marked for rollback otherwise fail.
- */
+ /** If no transaction do nothing. End the transaction if it is active or marked for rollback otherwise fail. */
public static int endTransaction()
{
try
@@ -229,10 +220,7 @@
}
}
- /**
- * If no transaction do nothing.
- * End the transaction if it is active or marked for rollback otherwise fail.
- */
+ /** If no transaction do nothing. End the transaction if it is active or marked for rollback otherwise fail. */
public static int endTransaction(Terminator expectedTerminator)
{
if (expectedTerminator == null)
Property changes on: trunk/common/src/main/org/jboss/portal/common/junit/TransactionAssert.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/junit/ant/ConfigurableJUnitTask.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/junit/ant/ConfigurableJUnitTask.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/junit/ant/ConfigurableJUnitTask.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -26,7 +26,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class ConfigurableJUnitTask extends JUnitTask
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/junit/ant/ConfigurableJUnitTask.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/junit/ant/ConfigurableJUnitTest.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/junit/ant/ConfigurableJUnitTest.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/junit/ant/ConfigurableJUnitTest.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -23,19 +23,18 @@
package org.jboss.portal.common.junit.ant;
import org.apache.tools.ant.taskdefs.optional.junit.JUnitTest;
-import org.jboss.portal.common.junit.ant.ConfigurableJUnitTask;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.ArrayList;
-import java.io.ObjectOutputStream;
-import java.io.IOException;
import java.io.File;
import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class ConfigurableJUnitTest extends JUnitTest
{
@@ -75,7 +74,7 @@
else if (parameter.nestedValues.size() > 0)
{
values = new String[parameter.nestedValues.size()];
- for (int j = 0;j < values.length;j++)
+ for (int j = 0; j < values.length; j++)
{
values[j] = ((TestParameterValue)parameter.nestedValues.get(j)).text;
}
Property changes on: trunk/common/src/main/org/jboss/portal/common/junit/ant/ConfigurableJUnitTest.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/junit/ant/TestParameter.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/junit/ant/TestParameter.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/junit/ant/TestParameter.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,18 +22,15 @@
******************************************************************************/
package org.jboss.portal.common.junit.ant;
-import java.util.Map;
-import java.util.Iterator;
-import java.util.ArrayList;
-import java.io.ObjectInputStream;
-import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
-import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.util.ArrayList;
+import java.util.Map;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class TestParameter
{
@@ -62,7 +59,7 @@
nestedValues.add(value);
}
- public static Map readExternalParameters()
+ public static Map readExternalParameters()
{
try
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/junit/ant/TestParameter.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/junit/ant/TestParameterValue.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/junit/ant/TestParameterValue.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/junit/ant/TestParameterValue.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -24,7 +24,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class TestParameterValue
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/junit/ant/TestParameterValue.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/markup/MarkupAttribute.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/markup/MarkupAttribute.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/markup/MarkupAttribute.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,19 +22,19 @@
******************************************************************************/
package org.jboss.portal.common.markup;
-import org.jboss.portal.common.text.FastURLEncoder;
import org.jboss.portal.common.io.UndeclaredIOException;
+import org.jboss.portal.common.text.FastURLEncoder;
-import java.io.Writer;
import java.io.IOException;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
+import java.io.Writer;
/**
* A markup attribute.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class MarkupAttribute
{
@@ -52,9 +52,9 @@
final String encodedValue;
/**
- * @param name the attribute name
+ * @param name the attribute name
* @param value the attribute value
- * @param type the attribute type
+ * @param type the attribute type
*/
public MarkupAttribute(String name, String value, Type type)
{
@@ -100,9 +100,7 @@
return type;
}
- /**
- * The type of the attribute value.
- */
+ /** The type of the attribute value. */
public abstract static class Type
{
@@ -130,13 +128,9 @@
}
/**
- * CDATA is a sequence of characters from the document character set and may include character entities.
- * User agents should interpret attribute values as follows:
- * <ul>
- * <li>Replace character entities with characters,</li>
- * <li>Ignore line feeds,</li>
- * <li>Replace each carriage return or tab with a single space.</li>
- * </ul>
+ * CDATA is a sequence of characters from the document character set and may include character entities. User
+ * agents should interpret attribute values as follows: <ul> <li>Replace character entities with characters,</li>
+ * <li>Ignore line feeds,</li> <li>Replace each carriage return or tab with a single space.</li> </ul>
*/
public static final Type CDATA = new CDATAType();
@@ -146,14 +140,10 @@
*/
public static final Type NAME = new CDATAType();
- /**
- * %ContentType required : CDATA -- media type, as per [RFC2045].
- */
+ /** %ContentType required : CDATA -- media type, as per [RFC2045]. */
public static final Type CONTENT_TYPE = new CDATAType();
- /**
- * %URI : CDATA -- a Uniform Resource Identifier, see [URI].
- */
+ /** %URI : CDATA -- a Uniform Resource Identifier, see [URI]. */
public static final Type URI = new CDATAType()
{
{
@@ -182,24 +172,16 @@
}
};
- /**
- * %LinkTypes : CDATA -- space-separated list of link types.
- */
+ /** %LinkTypes : CDATA -- space-separated list of link types. */
public static final Type LINK_TYPES = new CDATAType();
- /**
- * %Text : CDATA : CDATA.
- */
+ /** %Text : CDATA : CDATA. */
public static final Type TEXT = new CDATAType();
- /**
- * %MediaDesc : CDATA -- single or comma-separated list of media descriptors.
- */
+ /** %MediaDesc : CDATA -- single or comma-separated list of media descriptors. */
public static final Type MEDIA_DESC = new CDATAType();
- /**
- * %URI : CDATA -- a Uniform Resource Identifier, see [URI].
- */
+ /** %URI : CDATA -- a Uniform Resource Identifier, see [URI]. */
public static final Type HREF = new CDATAType();
}
}
Property changes on: trunk/common/src/main/org/jboss/portal/common/markup/MarkupAttribute.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/markup/MarkupElement.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/markup/MarkupElement.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/markup/MarkupElement.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -24,17 +24,17 @@
import org.jboss.portal.common.io.UndeclaredIOException;
-import java.util.Set;
-import java.util.HashSet;
-import java.io.Writer;
import java.io.IOException;
import java.io.StringWriter;
+import java.io.Writer;
+import java.util.HashSet;
+import java.util.Set;
/**
* An markup element.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class MarkupElement
{
@@ -46,10 +46,9 @@
final String bodyContent;
/**
- * If true and the body content is null then output the start tag and
- * the end tag instead of an empty tag. The use case is for the script element which
- * when it is empty raise issues on IE, so it start element and end element have to be
- * used.
+ * If true and the body content is null then output the start tag and the end tag instead of an empty tag. The use
+ * case is for the script element which when it is empty raise issues on IE, so it start element and end element have
+ * to be used.
*/
final boolean neverEmpty;
@@ -57,7 +56,7 @@
final MarkupAttribute[] attributes;
/**
- * @param name the element name
+ * @param name the element name
* @param bodyContent the optional body content
* @param neverEmpty
* @param attributes
@@ -79,7 +78,7 @@
//
Set tmp = new HashSet();
- for (int i= 0;i < attributes.length;i++)
+ for (int i = 0; i < attributes.length; i++)
{
MarkupAttribute attribute = attributes[i];
if (attribute == null)
@@ -125,7 +124,7 @@
public MarkupAttribute getAttribute(String name)
{
- for (int i = 0;i < attributes.length;i++)
+ for (int i = 0; i < attributes.length; i++)
{
MarkupAttribute attribute = attributes[i];
if (attribute.name.equals(name))
@@ -150,7 +149,7 @@
{
writer.write("<");
writer.write(name);
- for (int i = 0;i < attributes.length;i++)
+ for (int i = 0; i < attributes.length; i++)
{
MarkupAttribute attribute = attributes[i];
Property changes on: trunk/common/src/main/org/jboss/portal/common/markup/MarkupElement.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/net/URLFilter.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/net/URLFilter.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/net/URLFilter.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -26,17 +26,13 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public interface URLFilter
{
- /**
- * Return true if the filter accepts the url.
- */
+ /** Return true if the filter accepts the url. */
boolean acceptFile(URL url);
- /**
- * Return true if the directory should be visited.
- */
+ /** Return true if the directory should be visited. */
boolean acceptDir(URL url);
}
Property changes on: trunk/common/src/main/org/jboss/portal/common/net/URLFilter.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/reflect/Modifier.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/reflect/Modifier.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/reflect/Modifier.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -28,14 +28,13 @@
* Extends the java Modifier object in order to add more utility methods.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class Modifier extends java.lang.reflect.Modifier
{
/**
- * Return true if the field is considered as a readable property which means that
- * it is public and non static.
+ * Return true if the field is considered as a readable property which means that it is public and non static.
*
* @param f the field to test
* @return true if the field is a readable property
@@ -54,8 +53,8 @@
}
/**
- * Return true if the field is considered as a writable property which means that
- * it is public, non static and non final.
+ * Return true if the field is considered as a writable property which means that it is public, non static and non
+ * final.
*
* @param f the field to test
* @return true if the field is a writable property
Property changes on: trunk/common/src/main/org/jboss/portal/common/reflect/Modifier.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/servlet/BufferingRequestWrapper.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/servlet/BufferingRequestWrapper.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/servlet/BufferingRequestWrapper.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -24,23 +24,21 @@
import org.jboss.portal.common.util.Tools;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
import java.util.Enumeration;
import java.util.HashMap;
-import java.util.Map;
-import java.util.Locale;
-import java.util.Set;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
-
/**
- * Wrapper around a HTTPServletRequest to add attributes without
- * affecting the actual request.
+ * Wrapper around a HTTPServletRequest to add attributes without affecting the actual request.
*
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class BufferingRequestWrapper extends HttpServletRequestWrapper
{
@@ -126,7 +124,7 @@
Set names = new HashSet();
//
- for (Enumeration e = getRequest().getAttributeNames();e.hasMoreElements();)
+ for (Enumeration e = getRequest().getAttributeNames(); e.hasMoreElements();)
{
names.add(e.nextElement());
}
Property changes on: trunk/common/src/main/org/jboss/portal/common/servlet/BufferingRequestWrapper.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/servlet/BufferingResponseWrapper.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/servlet/BufferingResponseWrapper.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/servlet/BufferingResponseWrapper.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -24,20 +24,20 @@
import org.jboss.portal.common.io.UndeclaredIOException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletResponseWrapper;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Locale;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpServletResponseWrapper;
-
/**
* Redirection of the Writer
+ *
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class BufferingResponseWrapper extends HttpServletResponseWrapper
{
@@ -92,7 +92,7 @@
return null;
}
}
-
+
public void addCookie(Cookie arg0)
{
}
Property changes on: trunk/common/src/main/org/jboss/portal/common/servlet/BufferingResponseWrapper.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/servlet/ServletOutputStreamBuffer.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/servlet/ServletOutputStreamBuffer.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/servlet/ServletOutputStreamBuffer.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -28,7 +28,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class ServletOutputStreamBuffer extends ServletOutputStream
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/servlet/ServletOutputStreamBuffer.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/test/MonoValuedTestParameterValue.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/MonoValuedTestParameterValue.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/test/MonoValuedTestParameterValue.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -26,7 +26,7 @@
* A mono value.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class MonoValuedTestParameterValue extends TestParameterValue
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/test/MonoValuedTestParameterValue.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/test/MultiValuedTestParameterValue.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/MultiValuedTestParameterValue.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/test/MultiValuedTestParameterValue.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,15 +22,15 @@
******************************************************************************/
package org.jboss.portal.common.test;
+import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
-import java.util.Arrays;
/**
* A multi value.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class MultiValuedTestParameterValue extends TestParameterValue
{
@@ -65,22 +65,23 @@
return value;
}
- /**
- * Return an iterator over the values.
- */
+ /** Return an iterator over the values. */
public Iterator iterator()
{
return new Iterator()
{
Iterator i = value.iterator();
+
public boolean hasNext()
{
return i.hasNext();
}
+
public Object next()
{
return new MonoValuedTestParameterValue(i.next());
}
+
public void remove()
{
throw new UnsupportedOperationException();
Property changes on: trunk/common/src/main/org/jboss/portal/common/test/MultiValuedTestParameterValue.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/test/TestParameterValue.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/TestParameterValue.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/test/TestParameterValue.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -28,7 +28,7 @@
* The value of a test parameter.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public abstract class TestParameterValue implements Serializable
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/test/TestParameterValue.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/test/TestParametrization.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/TestParametrization.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/test/TestParametrization.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -24,20 +24,20 @@
import org.jboss.portal.common.test.info.TestInfo;
-import java.util.Map;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashMap;
-import java.util.ArrayList;
-import java.util.Set;
import java.util.HashSet;
import java.util.Iterator;
-import java.util.Collection;
-import java.io.Serializable;
+import java.util.Map;
+import java.util.Set;
/**
* The parametrization of a test.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class TestParametrization implements Serializable
{
@@ -61,7 +61,7 @@
}
//
- for (Iterator i = parameterValues.entrySet().iterator();i.hasNext();)
+ for (Iterator i = parameterValues.entrySet().iterator(); i.hasNext();)
{
Map.Entry entry = (Map.Entry)i.next();
String parameterName = (String)entry.getKey();
@@ -73,7 +73,7 @@
/**
* Set a paraemeter value, using a null value will remove the parameter.
*
- * @param parameterName the parameter name
+ * @param parameterName the parameter name
* @param parameterValue the parameter value
* @throws IllegalArgumentException if the parameter name is null
*/
@@ -89,7 +89,7 @@
}
else
{
- parameterValues.put(parameterName, parameterValue);
+ parameterValues.put(parameterName, parameterValue);
}
}
@@ -117,7 +117,7 @@
public String toString()
{
StringBuffer tmp = new StringBuffer();
- for (Iterator i = parameterValues.entrySet().iterator();i.hasNext();)
+ for (Iterator i = parameterValues.entrySet().iterator(); i.hasNext();)
{
Map.Entry entry = (Map.Entry)i.next();
String parameterName = (String)entry.getKey();
@@ -128,8 +128,8 @@
}
/**
- * Build a collection of parametrization that satisfies the parameters exposed by the test
- * meta information and the parameter provided by the map.
+ * Build a collection of parametrization that satisfies the parameters exposed by the test meta information and the
+ * parameter provided by the map.
*/
public Collection create(TestInfo info)
{
@@ -155,11 +155,11 @@
{
MultiValuedTestParameterValue multiValue = (MultiValuedTestParameterValue)value;
ArrayList tmp = new ArrayList();
- for (Iterator j = multiValue.iterator();j.hasNext();)
+ for (Iterator j = multiValue.iterator(); j.hasNext();)
{
TestParameterValue o = (TestParameterValue)j.next();
ArrayList copy = new ArrayList(c.size());
- for (Iterator k = c.iterator();k.hasNext();)
+ for (Iterator k = c.iterator(); k.hasNext();)
{
Map parametrization = (Map)k.next();
parametrization = new HashMap(parametrization);
@@ -182,7 +182,7 @@
}
//
- for (int i = 0;i < c.size();i++)
+ for (int i = 0; i < c.size(); i++)
{
Map parametrization = (Map)c.get(i);
TestParametrization ctx = new TestParametrization(parametrization);
Property changes on: trunk/common/src/main/org/jboss/portal/common/test/TestParametrization.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/test/driver/DriverCommand.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/driver/DriverCommand.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/test/driver/DriverCommand.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -28,7 +28,7 @@
* The command in the test protocol.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class DriverCommand implements Serializable
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/test/driver/DriverCommand.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/test/driver/DriverResponse.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/driver/DriverResponse.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/test/driver/DriverResponse.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -28,7 +28,7 @@
* The response in the test protocol.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5448 $
+ * @version $Revision$
*/
public abstract class DriverResponse implements Serializable
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/test/driver/DriverResponse.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/test/driver/ParameterNotBoundException.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/driver/ParameterNotBoundException.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/test/driver/ParameterNotBoundException.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -24,7 +24,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class ParameterNotBoundException extends TestDriverException
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/test/driver/ParameterNotBoundException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriver.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriver.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriver.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -28,17 +28,13 @@
* The contract that defines what a testable system is and its usage.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public interface TestDriver
{
- /**
- * Returns the meta information exposed by the driver.
- */
+ /** Returns the meta information exposed by the driver. */
TestItemInfo getInfo();
- /**
- * Execute a command of the testing protocol.
- */
+ /** Execute a command of the testing protocol. */
DriverResponse invoke(String testId, DriverCommand command) throws TestDriverException;
}
Property changes on: trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriver.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverContainer.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverContainer.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverContainer.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -26,7 +26,7 @@
* Provides an interface for a test driver container.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public interface TestDriverContainer extends TestDriver
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverContainer.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverException.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverException.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverException.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -24,7 +24,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class TestDriverException extends Exception
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/test/driver/TestSuite.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/driver/TestSuite.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/test/driver/TestSuite.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -25,14 +25,14 @@
import org.jboss.portal.common.test.info.TestContainerInfo;
import org.jboss.portal.common.test.info.TestItemInfo;
+import java.util.LinkedHashMap;
import java.util.Map;
-import java.util.LinkedHashMap;
/**
* A test suite is a test driver container that expose itself as a test driver.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class TestSuite implements TestDriverContainer
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/test/driver/TestSuite.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/test/driver/command/StartTestCommand.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/driver/command/StartTestCommand.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/test/driver/command/StartTestCommand.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,14 +22,14 @@
******************************************************************************/
package org.jboss.portal.common.test.driver.command;
+import org.jboss.portal.common.test.TestParametrization;
import org.jboss.portal.common.test.driver.DriverCommand;
-import org.jboss.portal.common.test.TestParametrization;
/**
* Start the test.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class StartTestCommand extends DriverCommand
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/test/driver/command/StartTestCommand.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/test/driver/response/EndTestResponse.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/driver/response/EndTestResponse.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/test/driver/response/EndTestResponse.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -28,7 +28,7 @@
* Terminate the test.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5448 $
+ * @version $Revision$
*/
public class EndTestResponse extends DriverResponse
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/test/driver/response/EndTestResponse.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/test/driver/response/ErrorResponse.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/driver/response/ErrorResponse.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/test/driver/response/ErrorResponse.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,14 +22,14 @@
******************************************************************************/
package org.jboss.portal.common.test.driver.response;
+import junit.framework.AssertionFailedError;
import org.jboss.portal.common.test.driver.DriverResponse;
-import junit.framework.AssertionFailedError;
/**
* An error occured during the execution of the test.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5448 $
+ * @version $Revision$
*/
public class ErrorResponse extends DriverResponse
{
@@ -66,6 +66,6 @@
public String toString()
{
- return throwable != null ? "Error[throwable=" + throwable + "]" : "Error[]";
+ return throwable != null ? "Error[throwable=" + throwable + "]" : "Error[]";
}
}
Property changes on: trunk/common/src/main/org/jboss/portal/common/test/driver/response/ErrorResponse.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/test/driver/response/FailureResponse.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/driver/response/FailureResponse.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/test/driver/response/FailureResponse.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,14 +22,14 @@
******************************************************************************/
package org.jboss.portal.common.test.driver.response;
+import junit.framework.AssertionFailedError;
import org.jboss.portal.common.test.driver.DriverResponse;
-import junit.framework.AssertionFailedError;
/**
* A failure occured during the execution of the test.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5448 $
+ * @version $Revision$
*/
public class FailureResponse extends DriverResponse
{
@@ -66,6 +66,6 @@
public String toString()
{
- return throwable != null ? "Failure[throwable=" + throwable + "]" : "ErrorResponse[]";
+ return throwable != null ? "Failure[throwable=" + throwable + "]" : "ErrorResponse[]";
}
}
Property changes on: trunk/common/src/main/org/jboss/portal/common/test/driver/response/FailureResponse.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/test/info/TestContainerInfo.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/info/TestContainerInfo.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/test/info/TestContainerInfo.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,16 +22,16 @@
******************************************************************************/
package org.jboss.portal.common.test.info;
+import java.util.HashMap;
+import java.util.Iterator;
import java.util.Map;
-import java.util.HashMap;
import java.util.Set;
-import java.util.Iterator;
/**
* Container for items.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class TestContainerInfo extends TestItemInfo
{
@@ -53,7 +53,7 @@
/**
* Create a named container.
*
- * @param name the container name
+ * @param name the container name
* @param description the container description
* @throws IllegalArgumentException if the name is null
*/
@@ -73,7 +73,7 @@
{
super(that);
this.children = new HashMap(that.children.size());
- for (Iterator i = that.children.values().iterator();i.hasNext();)
+ for (Iterator i = that.children.values().iterator(); i.hasNext();)
{
TestItemInfo child = (TestItemInfo)i.next();
TestItemInfo childClone = child.createClone();
@@ -91,7 +91,7 @@
visitor.enter(this);
//
- for (Iterator i = children.values().iterator();i.hasNext();)
+ for (Iterator i = children.values().iterator(); i.hasNext();)
{
TestItemInfo child = (TestItemInfo)i.next();
child.internalVisit(visitor);
@@ -186,7 +186,7 @@
int index = itemId.indexOf('/');
String name = index != -1 ? itemId.substring(0, index) : itemId;
String next = index != -1 ? itemId.substring(index + 1) : "";
- for (Iterator i = children.values().iterator();i.hasNext();)
+ for (Iterator i = children.values().iterator(); i.hasNext();)
{
TestItemInfo child = (TestItemInfo)i.next();
if (name.equals(child.getName()))
@@ -200,7 +200,7 @@
public String toString()
{
StringBuffer buffer = new StringBuffer("TestContainerInfo[" + getName()).append(",");
- for (Iterator i = children.values().iterator();i.hasNext();)
+ for (Iterator i = children.values().iterator(); i.hasNext();)
{
TestItemInfo child = (TestItemInfo)i.next();
buffer.append(child);
Property changes on: trunk/common/src/main/org/jboss/portal/common/test/info/TestContainerInfo.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/test/info/TestInfo.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/info/TestInfo.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/test/info/TestInfo.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,15 +22,15 @@
******************************************************************************/
package org.jboss.portal.common.test.info;
+import java.util.HashMap;
import java.util.Map;
-import java.util.HashMap;
import java.util.Set;
/**
* Meta information that describe a test.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class TestInfo extends TestItemInfo
{
@@ -64,7 +64,7 @@
/**
* Create a named test.
*
- * @param name the test name
+ * @param name the test name
* @param description the test description
* @throws IllegalArgumentException if the name is null
*/
Property changes on: trunk/common/src/main/org/jboss/portal/common/test/info/TestInfo.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/test/info/TestItemInfo.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/info/TestItemInfo.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/test/info/TestItemInfo.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -25,12 +25,11 @@
import java.io.Serializable;
/**
- * A test item info is the abstraction over a test info and a test container info as
- * both of them contains similarities. It is a data structure which describes a collection
- * of tests.
+ * A test item info is the abstraction over a test info and a test container info as both of them contains similarities.
+ * It is a data structure which describes a collection of tests.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public abstract class TestItemInfo implements Serializable
{
@@ -74,7 +73,7 @@
/**
* Create an item with the specified name.
*
- * @param name the test name
+ * @param name the test name
* @param description the test description
* @throws IllegalArgumentException if the name is null
*/
@@ -121,7 +120,7 @@
/**
* Return the id relative to a parent context.
*
- * @return the id relative
+ * @return the id relative
*/
public String getId(TestItemInfo context)
{
@@ -211,30 +210,20 @@
internalVisit(visitor);
}
- /**
- * Visitor interface for the item structure.
- */
+ /** Visitor interface for the item structure. */
public interface Visitor
{
- /**
- * Enter a container.
- */
+ /** Enter a container. */
void enter(TestContainerInfo testContainerInfo);
- /**
- * Leave a container.
- */
+ /** Leave a container. */
void leave(TestContainerInfo testContainerInfo);
- /**
- * Visit a test.
- */
+ /** Visit a test. */
void visit(TestInfo testInfo);
}
- /**
- * Boiler plate visitor.
- */
+ /** Boiler plate visitor. */
public static class AbstractVisitor implements Visitor
{
/**
Property changes on: trunk/common/src/main/org/jboss/portal/common/test/info/TestItemInfo.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/test/info/TestParameterInfo.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/info/TestParameterInfo.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/test/info/TestParameterInfo.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -28,7 +28,7 @@
* Meta information of a test parameter.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class TestParameterInfo implements Serializable
{
@@ -53,7 +53,7 @@
/**
* Create a test parameter with the specified name.
*
- * @param name the parameter name
+ * @param name the parameter name
* @param description the parameter description
* @throws IllegalArgumentException if the name is null
*/
Property changes on: trunk/common/src/main/org/jboss/portal/common/test/info/TestParameterInfo.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/test/junit/JUnitAdapter.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/junit/JUnitAdapter.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/test/junit/JUnitAdapter.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,35 +22,34 @@
******************************************************************************/
package org.jboss.portal.common.test.junit;
-import junit.framework.TestResult;
-import junit.framework.TestCase;
import junit.framework.AssertionFailedError;
-import org.jboss.portal.common.test.TestParametrization;
+import junit.framework.TestCase;
+import junit.framework.TestResult;
+import org.jboss.portal.common.junit.ant.TestParameter;
import org.jboss.portal.common.test.MonoValuedTestParameterValue;
import org.jboss.portal.common.test.MultiValuedTestParameterValue;
-import org.jboss.portal.common.test.info.TestInfo;
-import org.jboss.portal.common.test.info.TestItemInfo;
-import org.jboss.portal.common.test.driver.TestDriver;
+import org.jboss.portal.common.test.TestParametrization;
import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.TestDriver;
+import org.jboss.portal.common.test.driver.command.StartTestCommand;
import org.jboss.portal.common.test.driver.response.ErrorResponse;
import org.jboss.portal.common.test.driver.response.FailureResponse;
-import org.jboss.portal.common.test.driver.command.StartTestCommand;
-import org.jboss.portal.common.junit.ant.TestParameter;
+import org.jboss.portal.common.test.info.TestInfo;
+import org.jboss.portal.common.test.info.TestItemInfo;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Collections;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
/**
- * An runner that adapts the <code>junit.framework.Test</code> interface to the
- * <code>TestDriver</code> protocol.
+ * An runner that adapts the <code>junit.framework.Test</code> interface to the <code>TestDriver</code> protocol.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
-public class JUnitAdapter implements junit.framework.Test
+public class JUnitAdapter implements junit.framework.Test
{
/** . */
@@ -108,10 +107,10 @@
public void visit(final TestInfo testInfo)
{
Collection contexts = parametrization.create(testInfo);
- for (Iterator i = contexts.iterator();i.hasNext();)
+ for (Iterator i = contexts.iterator(); i.hasNext();)
{
final TestParametrization parametrization = (TestParametrization)i.next();
- String name = parametrization.isEmpty() ? testInfo.getName() : testInfo.getName() + "_" + parametrization;
+ String name = parametrization.isEmpty() ? testInfo.getName() : testInfo.getName() + "_" + parametrization;
TestCase tc = new TestCase(name)
{
public void runBare() throws Throwable
@@ -150,7 +149,7 @@
else
{
Map tmp = new HashMap();
- for (Iterator i = parameterMap.entrySet().iterator();i.hasNext();)
+ for (Iterator i = parameterMap.entrySet().iterator(); i.hasNext();)
{
Map.Entry entry = (Map.Entry)i.next();
String parameterName = (String)entry.getKey();
Property changes on: trunk/common/src/main/org/jboss/portal/common/test/junit/JUnitAdapter.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/test/junit/POJOJUnitTest.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/junit/POJOJUnitTest.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/test/junit/POJOJUnitTest.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,37 +22,36 @@
******************************************************************************/
package org.jboss.portal.common.test.junit;
-import org.jboss.portal.common.test.info.TestInfo;
-import org.jboss.portal.common.test.info.TestParameterInfo;
-import org.jboss.portal.common.test.info.TestItemInfo;
-import org.jboss.portal.common.test.info.TestContainerInfo;
-import org.jboss.portal.common.test.TestParametrization;
+import junit.framework.AssertionFailedError;
+import junit.framework.TestSuite;
import org.jboss.portal.common.test.TestParameterValue;
+import org.jboss.portal.common.test.TestParametrization;
+import org.jboss.portal.common.test.driver.DriverCommand;
+import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.test.driver.ParameterNotBoundException;
import org.jboss.portal.common.test.driver.TestDriver;
-import org.jboss.portal.common.test.driver.DriverResponse;
-import org.jboss.portal.common.test.driver.DriverCommand;
import org.jboss.portal.common.test.driver.TestDriverException;
+import org.jboss.portal.common.test.driver.command.StartTestCommand;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
import org.jboss.portal.common.test.driver.response.ErrorResponse;
import org.jboss.portal.common.test.driver.response.FailureResponse;
-import org.jboss.portal.common.test.driver.response.EndTestResponse;
-import org.jboss.portal.common.test.driver.command.StartTestCommand;
+import org.jboss.portal.common.test.info.TestContainerInfo;
+import org.jboss.portal.common.test.info.TestInfo;
+import org.jboss.portal.common.test.info.TestItemInfo;
+import org.jboss.portal.common.test.info.TestParameterInfo;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
-import java.util.Map;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.Map;
-import junit.framework.AssertionFailedError;
-import junit.framework.TestSuite;
-
/**
* Test an object based on junit infrastructure + some conventions.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class POJOJUnitTest implements TestDriver
{
@@ -129,7 +128,7 @@
// Contextualize
TestParametrization parametrization = start.getParametrization();
- for (Iterator i = testInfo.getParameterNames().iterator();i.hasNext();)
+ for (Iterator i = testInfo.getParameterNames().iterator(); i.hasNext();)
{
String parameterName = (String)i.next();
TestParameterValue value = parametrization.getParameterValue(parameterName);
@@ -228,15 +227,15 @@
{
String methodName = method.getName();
if (methodName.startsWith("test") &&
- method.getParameterTypes().length == 0)
+ method.getParameterTypes().length == 0)
{
TestInfo childInfo = new TestInfo(method.getName());
containerInfo.addChild(childInfo);
testMap.put(method.getName(), method);
}
else if (methodName.startsWith("set") &&
- methodName.endsWith("Parameter") &&
- method.getParameterTypes().length == 1)
+ methodName.endsWith("Parameter") &&
+ method.getParameterTypes().length == 1)
{
String parameterName = methodName.substring(3, methodName.length() - 9);
setterMap.put(parameterName, method);
@@ -245,10 +244,10 @@
}
// Set all parameters on children
- for (Iterator i = setterMap.keySet().iterator();i.hasNext();)
+ for (Iterator i = setterMap.keySet().iterator(); i.hasNext();)
{
String parameterName = (String)i.next();
- for (Iterator j = testMap.keySet().iterator();j.hasNext();)
+ for (Iterator j = testMap.keySet().iterator(); j.hasNext();)
{
String childName = (String)j.next();
TestInfo childInfo = (TestInfo)containerInfo.getChild(childName);
@@ -267,9 +266,7 @@
this.containerInfo = containerInfo;
}
- /**
- * Return true if the method is invokable.
- */
+ /** Return true if the method is invokable. */
private boolean isInvokable(Method m)
{
int modifiers = m.getModifiers();
Property changes on: trunk/common/src/main/org/jboss/portal/common/test/junit/POJOJUnitTest.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/test/junit/ThrowableDecoder.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/junit/ThrowableDecoder.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/test/junit/ThrowableDecoder.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -23,25 +23,25 @@
package org.jboss.portal.common.test.junit;
import junit.framework.AssertionFailedError;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.response.ErrorResponse;
import org.jboss.portal.common.test.driver.response.FailureResponse;
-import org.jboss.portal.common.test.driver.response.ErrorResponse;
-import org.jboss.portal.common.test.driver.DriverResponse;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class ThrowableDecoder
{
/**
* <p>Decode a throwable into a suitable driver response.</p>
- *
+ * <p/>
* <p>If the throwable or one of its causes are an instance of the class <code>junit.framework.AssertionFailedError</code>
* then a <code>org.jboss.portal.common.test.driver.response.FailureResponse</code> is returned.</p>
+ * <p/>
+ * <p>Otherwise an <code>org.jboss.portal.common.test.driver.response.ErrorResponse</code> object is built with the
+ * throwable as argument and returned.</p>
*
- * <p>Otherwise an <code>org.jboss.portal.common.test.driver.response.ErrorResponse</code> object is built
- * with the throwable as argument and returned.</p>
- *
* @param t the throwable to decode.
* @return the proper driver response
*/
Property changes on: trunk/common/src/main/org/jboss/portal/common/test/junit/ThrowableDecoder.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/text/CharBuffer.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/text/CharBuffer.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/text/CharBuffer.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,12 +22,12 @@
******************************************************************************/
package org.jboss.portal.common.text;
-import java.net.URLEncoder;
import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class CharBuffer
{
@@ -74,7 +74,7 @@
{
throw new IllegalArgumentException();
}
- for (int i = 0;i < s.length();i++)
+ for (int i = 0; i < s.length(); i++)
{
char c = s.charAt(i);
if (c >= encoder.from && c < encoder.to)
@@ -158,7 +158,7 @@
ensureCapacity(length + chars.length);
if (chars.length < 10)
{
- for (int i = 0;i < chars.length;i++)
+ for (int i = 0; i < chars.length; i++)
{
buffer[length++] = chars[i];
}
@@ -177,9 +177,7 @@
length += s.length();
}
- /**
- * Can be subclassed to provide a customized implementation.
- */
+ /** Can be subclassed to provide a customized implementation. */
protected void ensureCapacity(int minimumCapacity)
{
int capacity = buffer.length;
Property changes on: trunk/common/src/main/org/jboss/portal/common/text/CharBuffer.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/text/FastURLEncoder.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/text/FastURLEncoder.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/text/FastURLEncoder.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -24,14 +24,14 @@
import org.jboss.portal.common.io.UndeclaredIOException;
+import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
-import java.io.IOException;
import java.net.URLEncoder;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class FastURLEncoder
{
@@ -73,7 +73,7 @@
this.table = new char[to - from][];
//
- for (int c = (to - 1);c >= from;c--)
+ for (int c = (to - 1); c >= from; c--)
{
String v = URLEncoder.encode(Character.toString((char)c), encoding);
table[c - from] = v.toCharArray();
@@ -97,7 +97,7 @@
{
throw new IllegalArgumentException();
}
- for (int i = 0;i < s.length();i++)
+ for (int i = 0; i < s.length(); i++)
{
char c = s.charAt(i);
if (c >= from && c < to)
@@ -131,7 +131,7 @@
}
try
{
- for (int i = 0;i < s.length();i++)
+ for (int i = 0; i < s.length(); i++)
{
char c = s.charAt(i);
if (c >= from && c < to)
Property changes on: trunk/common/src/main/org/jboss/portal/common/text/FastURLEncoder.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/util/CopyOnWriteRegistry.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/CopyOnWriteRegistry.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/util/CopyOnWriteRegistry.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,17 +22,17 @@
******************************************************************************/
package org.jboss.portal.common.util;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.Map;
-import java.util.HashMap;
import java.util.Set;
-import java.util.Collections;
-import java.util.Collection;
/**
* Implementation of a registry that implements copy on write semantics.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class CopyOnWriteRegistry
{
@@ -48,7 +48,7 @@
/**
* Register an object.
*
- * @param key the registration key
+ * @param key the registration key
* @param object the registered object
* @return true if the registration was made
* @throws IllegalArgumentException if the one argument is null
Property changes on: trunk/common/src/main/org/jboss/portal/common/util/CopyOnWriteRegistry.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/util/IteratorStatus.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/IteratorStatus.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/util/IteratorStatus.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -22,15 +22,15 @@
******************************************************************************/
package org.jboss.portal.common.util;
+import java.util.Collection;
import java.util.Iterator;
-import java.util.Collection;
/**
- * An java.util.Iterator wrapper which keep additional state associated with the wrapped iterator.
- * The implementation of the Iterator interface delegates all operations to the wrapped iterator.
+ * An java.util.Iterator wrapper which keep additional state associated with the wrapped iterator. The implementation of
+ * the Iterator interface delegates all operations to the wrapped iterator.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class IteratorStatus implements Iterator
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/util/IteratorStatus.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/util/MapAccessor.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/MapAccessor.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/util/MapAccessor.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -28,7 +28,7 @@
* An interface which defines how a map can be accessed.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public interface MapAccessor
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/util/MapAccessor.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/util/MapBuilder.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/MapBuilder.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/util/MapBuilder.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -23,14 +23,14 @@
package org.jboss.portal.common.util;
import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.Map;
-import java.util.LinkedHashMap;
/**
* An helper to build collection of object in a simple manner.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5451 $
+ * @version $Revision$
*/
public class MapBuilder
{
@@ -46,7 +46,7 @@
/**
* Add the object to the collection.
*
- * @param key the key
+ * @param key the key
* @param value the value
* @return the builder
*/
Property changes on: trunk/common/src/main/org/jboss/portal/common/util/MapBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/util/MarkupInfo.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/MarkupInfo.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/util/MarkupInfo.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -26,7 +26,7 @@
* Extends content to describe markup content.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class MarkupInfo extends ContentInfo
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/util/MarkupInfo.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/xml/NullEntityResolver.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/xml/NullEntityResolver.java 2007-05-09 09:58:43 UTC (rev 7227)
+++ trunk/common/src/main/org/jboss/portal/common/xml/NullEntityResolver.java 2007-05-09 16:47:57 UTC (rev 7228)
@@ -30,7 +30,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class NullEntityResolver implements EntityResolver
{
Property changes on: trunk/common/src/main/org/jboss/portal/common/xml/NullEntityResolver.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
18 years, 12 months
JBoss Portal SVN: r7227 - in trunk: core/src/main/org/jboss/portal/test/core/model/portal and 3 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-05-09 05:58:43 -0400 (Wed, 09 May 2007)
New Revision: 7227
Added:
trunk/demo/src/resources/portal-demo-sar/
trunk/demo/src/resources/portal-demo-sar/META-INF/
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/AbstractPortalObjectContainer.java
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PersistentPortalObjectContainer.java
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/TransientPortalObjectContainer.java
trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
Log:
- minor code reorg in portal object container
- no need to inject CustomizationManager in portal object container anymore as it is used by the internal portlet content provider instead
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/portal/AbstractPortalObjectContainer.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/portal/AbstractPortalObjectContainer.java 2007-05-09 09:27:25 UTC (rev 7226)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/portal/AbstractPortalObjectContainer.java 2007-05-09 09:58:43 UTC (rev 7227)
@@ -29,7 +29,6 @@
import org.jboss.portal.core.model.content.ContentType;
import org.jboss.portal.core.model.content.spi.ContentProviderRegistry;
import org.jboss.portal.core.model.content.spi.ContentProvider;
-import org.jboss.portal.core.model.instance.InstanceContainer;
import org.jboss.portal.core.model.content.spi.handler.ContentHandler;
import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.security.PortalPermission;
@@ -58,25 +57,12 @@
private PortalObjectIdImpl rootId = new PortalObjectIdImpl();
/** . */
- private InstanceContainer instanceContainer;
-
- /** . */
private ContentProviderRegistry contentProviderRegistry;
protected AbstractPortalObjectContainer()
{
}
- public InstanceContainer getInstanceContainer()
- {
- return instanceContainer;
- }
-
- public void setInstanceContainer(InstanceContainer instanceContainer)
- {
- this.instanceContainer = instanceContainer;
- }
-
public ContentProviderRegistry getContentProviderRegistry()
{
return contentProviderRegistry;
@@ -87,11 +73,39 @@
this.contentProviderRegistry = contentProviderRegistry;
}
+ // PortalObjectContainer implementation******************************************************************************
+
public PortalObject getRootObject()
{
return getObject(rootId);
}
+ public PortalObject getObject(PortalObjectId id) throws IllegalArgumentException
+ {
+ if (id == null)
+ {
+ throw new IllegalArgumentException("No null id accepted " + id);
+ }
+ ObjectNode node;
+ if (id instanceof PortalObjectIdImpl)
+ {
+ node = getObjectNode((PortalObjectIdImpl)id);
+ }
+ else
+ {
+ PortalObjectIdImpl poid = new PortalObjectIdImpl(id);
+ node = getObjectNode(poid);
+ }
+ return node == null ? null : node.getObject();
+ }
+
+ public AuthorizationDomain getAuthorizationDomain()
+ {
+ return this;
+ }
+
+ // AuthorizationDomain implementation *******************************************************************************
+
public String getType()
{
return PortalObjectPermission.PERMISSION_TYPE;
@@ -112,6 +126,8 @@
return this;
}
+ // PermissionFactory implementation *********************************************************************************
+
public PortalPermission createPermissionContainer(PortalPermissionCollection collection) throws PortalSecurityException
{
return new PortalObjectPermission(collection);
@@ -129,27 +145,8 @@
return new PortalObjectPermission(id, actions);
}
- public PortalObject getObject(PortalObjectId id) throws IllegalArgumentException
- {
- if (id == null)
- {
- throw new IllegalArgumentException("No null id accepted " + id);
- }
- ObjectNode node;
- if (id instanceof PortalObjectIdImpl)
- {
- node = getObjectNode((PortalObjectIdImpl)id);
- }
- else
- {
- PortalObjectIdImpl poid = new PortalObjectIdImpl(id);
- node = getObjectNode(poid);
- }
- return node == null ? null : node.getObject();
- }
+ // PermissionRepository implementation ******************************************************************************
- protected abstract ObjectNode getObjectNode(PortalObjectIdImpl id);
-
public PortalPermission getPermission(String roleName, String uri) throws PortalSecurityException
{
PortalObjectIdImpl id = new PortalObjectIdImpl(PortalObjectId.parse(uri, PortalObjectId.CANONICAL_FORMAT));
@@ -165,6 +162,8 @@
return null;
}
+ // DomainConfigurator implementation ********************************************************************************
+
public void removeSecurityBindings(String uri) throws SecurityConfigurationException
{
PortalObjectIdImpl id = new PortalObjectIdImpl(PortalObjectId.parse(uri, PortalObjectId.CANONICAL_FORMAT));
@@ -201,6 +200,16 @@
}
}
+ // ******************************************************************************************************************
+
+ /**
+ * Must be subclasses to provide the access to a node.
+ *
+ * @param id the portal object id
+ * @return a node or null if not found
+ */
+ protected abstract ObjectNode getObjectNode(PortalObjectIdImpl id);
+
public class Context
{
/**
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PersistentPortalObjectContainer.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PersistentPortalObjectContainer.java 2007-05-09 09:27:25 UTC (rev 7226)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PersistentPortalObjectContainer.java 2007-05-09 09:58:43 UTC (rev 7227)
@@ -204,11 +204,6 @@
sessionFactory = null;
}
- public AuthorizationDomain getAuthorizationDomain()
- {
- return this;
- }
-
public boolean createRootIfNotExist() throws Exception
{
log.debug("Detecting the existence of the portal object root context");
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/portal/TransientPortalObjectContainer.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/portal/TransientPortalObjectContainer.java 2007-05-09 09:27:25 UTC (rev 7226)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/portal/TransientPortalObjectContainer.java 2007-05-09 09:58:43 UTC (rev 7227)
@@ -54,12 +54,6 @@
ctx.setObjectNode(root);
}
- /** @see PortalObjectContainer#getAuthorizationDomain() */
- public AuthorizationDomain getAuthorizationDomain()
- {
- throw new IllegalStateException("Unimplemented");
- }
-
protected ObjectNode getObjectNode(PortalObjectIdImpl id)
{
ObjectNode node = root;
Modified: trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2007-05-09 09:27:25 UTC (rev 7226)
+++ trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2007-05-09 09:58:43 UTC (rev 7227)
@@ -242,6 +242,11 @@
TransactionAssert.commitTransaction();
}
+ public void testPortalNode() throws Exception
+ {
+
+ }
+
public void testRecreate() throws Exception
{
PortalObjectId defaultId = new PortalObjectId(new String[]{"default"});
Modified: trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-05-09 09:27:25 UTC (rev 7226)
+++ trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-05-09 09:58:43 UTC (rev 7227)
@@ -596,9 +596,6 @@
optional-attribute-name="AuthorizationDomainRegistry"
proxy-type="attribute">portal:service=AuthorizationDomainRegistry</depends>
<depends
- optional-attribute-name="InstanceContainer"
- proxy-type="attribute">portal:container=Instance</depends>
- <depends
optional-attribute-name="ContentProviderRegistry"
proxy-type="attribute">portal:service=ContentProviderRegistry</depends>
<attribute name="SessionFactoryJNDIName">java:/portal/PortalObjectSessionFactory</attribute>
18 years, 12 months
JBoss Portal SVN: r7226 - in trunk: common and 25 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-05-09 05:27:25 -0400 (Wed, 09 May 2007)
New Revision: 7226
Added:
trunk/common/src/main/org/jboss/portal/common/adapter/
trunk/common/src/main/org/jboss/portal/common/adapter/AdaptedMethodDispatcher.java
trunk/common/src/main/org/jboss/portal/common/adapter/AdaptedMethodDispatcherFactory.java
trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdaptable.java
trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdapted.java
trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdapter.java
trunk/common/src/main/org/jboss/portal/common/adapter/DefaultJavaLangObjectAdapted.java
trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectAdapted.java
trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectMethodDispatcher.java
trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectMethodDispatcherFactory.java
trunk/common/src/main/org/jboss/portal/common/adapter/MethodDispatcher.java
trunk/common/src/main/org/jboss/portal/common/adapter/MethodDispatcherFactory.java
trunk/common/src/main/org/jboss/portal/test/common/adapter/
trunk/common/src/main/org/jboss/portal/test/common/adapter/Adapted1.java
trunk/common/src/main/org/jboss/portal/test/common/adapter/Adapted2.java
trunk/common/src/main/org/jboss/portal/test/common/adapter/AdapterTestCase.java
trunk/common/src/main/org/jboss/portal/test/common/adapter/Business1.java
trunk/common/src/main/org/jboss/portal/test/common/adapter/Business2.java
trunk/common/src/main/org/jboss/portal/test/common/adapter/ObjectAdapted.java
trunk/core/src/main/org/jboss/portal/core/impl/portlet/info/
trunk/core/src/main/org/jboss/portal/core/impl/portlet/info/AjaxInfoImpl.java
trunk/core/src/main/org/jboss/portal/core/impl/portlet/info/CorePortletInfoFactory.java
trunk/core/src/main/org/jboss/portal/core/impl/portlet/info/CorePortletInfoImpl.java
trunk/core/src/main/org/jboss/portal/core/impl/portlet/info/MarkupHeaderInfoImpl.java
trunk/core/src/main/org/jboss/portal/core/portlet/info/
trunk/core/src/main/org/jboss/portal/core/portlet/info/AjaxInfo.java
trunk/core/src/main/org/jboss/portal/core/portlet/info/CorePortletInfo.java
trunk/core/src/main/org/jboss/portal/core/portlet/info/MarkupHeaderInfo.java
trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/model/portal/persistent-jboss-beans.xml
trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/model/portal/transient-jboss-beans.xml
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletAPIFactoryImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletInfoFactoryImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletAPIFactory.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletInfoFactory.java
Removed:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/APIFactory.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/APIFactoryImpl.java
Modified:
trunk/bridge/src/main/org/jboss/portal/bridge/JBossServletContextProvider.java
trunk/common/build.xml
trunk/core/build.xml
trunk/core/src/main/org/jboss/portal/core/aspects/portlet/AjaxInterceptor.java
trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java
trunk/core/src/main/org/jboss/portal/core/aspects/portlet/TransactionInterceptor.java
trunk/core/src/main/org/jboss/portal/core/impl/api/node/PortalNodeImpl.java
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/TransientPortalObjectContainer.java
trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
trunk/core/src/main/org/jboss/portlet/JBossAPIFactory.java
trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java
trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeploymentFactory.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortletSessionSynchronizationInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainer.java
trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerCapabilities.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPortletInfo.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerSessionInfo.java
trunk/portlet/src/main/org/jboss/portal/portlet/metadata/JBossPortletMetaData.java
Log:
- introduced PortletInfoFactory that allows to plug in PortletInfo extension
- replaced usage of build time meta data in portlet core aspects by an extension of the portlet runtime meta data
- optimized security checks in the PortalNodeImpl object by leveraging the fact that the security check view recursive on a node will imply the security check view on its children
Modified: trunk/bridge/src/main/org/jboss/portal/bridge/JBossServletContextProvider.java
===================================================================
--- trunk/bridge/src/main/org/jboss/portal/bridge/JBossServletContextProvider.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/bridge/src/main/org/jboss/portal/bridge/JBossServletContextProvider.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -23,10 +23,9 @@
package org.jboss.portal.bridge;
import org.apache.portals.bridges.common.ServletContextProvider;
-import org.jboss.portal.portlet.impl.jsr168.info.ContainerPortletInfo;
import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.container.PortletContainerInvoker;
+import org.jboss.portal.portlet.container.PortletContainer;
import javax.portlet.GenericPortlet;
import javax.portlet.PortletRequest;
@@ -123,11 +122,11 @@
public BridgeInfo(PortletInvocation invocation)
{
- ContainerPortletInfo info = (ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
+ PortletContainer container = (PortletContainer)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER);
//
this.invocation = invocation;
- this.ctx = info.getContainer().getApplication().getContext().getServletContext();
+ this.ctx = container.getApplication().getContext().getServletContext();
this.breq = null;
this.bresp = null;
}
Modified: trunk/common/build.xml
===================================================================
--- trunk/common/build.xml 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/common/build.xml 2007-05-09 09:27:25 UTC (rev 7226)
@@ -210,6 +210,7 @@
</x-sysproperty>
<x-test>
+ <test todir="${test.reports}" name="org.jboss.portal.test.common.adapter.AdapterTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.common.BundleNameIteratorTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.common.BundleNameParserTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.common.ComplexResourceBundleFactoryTestCase"/>
Added: trunk/common/src/main/org/jboss/portal/common/adapter/AdaptedMethodDispatcher.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/adapter/AdaptedMethodDispatcher.java (rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/adapter/AdaptedMethodDispatcher.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.common.adapter;
+
+import java.lang.reflect.Method;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+class AdaptedMethodDispatcher implements MethodDispatcher
+{
+
+ /** . */
+ private final Method method;
+
+ /** . */
+ private final Object target;
+
+ public AdaptedMethodDispatcher(Method method, Object target)
+ {
+ this.method = method;
+ this.target = target;
+ }
+
+ public Object dispatch(ClassAdaptable adaptable, Object[] args) throws Throwable
+ {
+ return method.invoke(target, args);
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/adapter/AdaptedMethodDispatcherFactory.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/adapter/AdaptedMethodDispatcherFactory.java (rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/adapter/AdaptedMethodDispatcherFactory.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.common.adapter;
+
+import java.lang.reflect.Method;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+class AdaptedMethodDispatcherFactory implements MethodDispatcherFactory
+{
+
+ /** . */
+ private final Object target;
+
+ public AdaptedMethodDispatcherFactory(Object target)
+ {
+ this.target = target;
+ }
+
+ public MethodDispatcher createDispatcher(Method method)
+ {
+ return new AdaptedMethodDispatcher(method, target);
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdaptable.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdaptable.java (rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdaptable.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.common.adapter;
+
+/**
+ * Denotes an object that is class adaptable.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface ClassAdaptable
+{
+}
Added: trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdapted.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdapted.java (rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdapted.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.common.adapter;
+
+/**
+ * A class adapted.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ClassAdapted
+{
+
+ /** . */
+ final Class itf;
+
+ /** . */
+ final Object object;
+
+ public ClassAdapted(Class itf, Object object)
+ {
+ if (itf == null)
+ {
+ throw new IllegalArgumentException("No null adapted interface accepted");
+ }
+ if (!itf.isInterface())
+ {
+ throw new IllegalArgumentException("Adapted interface is not an interface");
+ }
+ if (object == null)
+ {
+ throw new IllegalArgumentException("No null adapted object accepted");
+ }
+
+ //
+ this.itf = itf;
+ this.object = object;
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdapter.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdapter.java (rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/adapter/ClassAdapter.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,157 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.common.adapter;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Proxy;
+import java.lang.reflect.Method;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Modifier;
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * Creates a new class adapter.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ClassAdapter
+{
+
+ /** . */
+ private final Map dispatchers;
+
+ /** . */
+ private final Constructor ctor;
+
+ /** . */
+ private final InvocationHandler handler = new InvocationHandler()
+ {
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+ {
+ MethodDispatcher dispatcher = (MethodDispatcher)dispatchers.get(method);
+
+ //
+ ClassAdaptable adaptable = (ClassAdaptable)proxy;
+
+ //
+ return dispatcher.dispatch(adaptable, args);
+ }
+ };
+
+ /**
+ * Creates a new class adapter. The object adapted implementation used will be an instance of <code>JavaLangObjectAdapted</code>.
+ *
+ * @param loader the class loader that will contain the dynamic proxy generated class
+ * @param adapteds the array of class adapteds
+ * @throws NoSuchMethodException
+ * @throws IllegalArgumentException if an argument is null
+ */
+ public ClassAdapter(ClassLoader loader, ClassAdapted[] adapteds) throws NoSuchMethodException, IllegalArgumentException
+ {
+ this(loader, adapteds, new DefaultJavaLangObjectAdapted());
+ }
+
+ /**
+ * Create a new class adapter.
+ *
+ * @param loader the class loader that will contain the dynamic proxy generated class
+ * @param adapteds the array of class adapteds
+ * @param objectAdapted the implementation of object adapted
+ * @throws NoSuchMethodException
+ * @throws IllegalArgumentException if an argument is null
+ */
+ public ClassAdapter(ClassLoader loader, ClassAdapted[] adapteds, JavaLangObjectAdapted objectAdapted) throws NoSuchMethodException, IllegalArgumentException
+ {
+ if (loader == null)
+ {
+ throw new IllegalArgumentException("No null class loader accepted");
+ }
+ if (adapteds == null)
+ {
+ throw new IllegalArgumentException("No null adapteds accepted");
+ }
+ if (objectAdapted == null)
+ {
+ throw new IllegalArgumentException("No null object adapted accepted");
+ }
+
+ //
+ dispatchers = new HashMap();
+
+ //
+ addAdapted(Object.class, new JavaLangObjectMethodDispatcherFactory(objectAdapted));
+
+ //
+ Class[] itfs = new Class[adapteds.length + 1];
+ itfs[0] = ClassAdaptable.class;
+
+ //
+ for (int i = 0;i < adapteds.length;i++)
+ {
+ ClassAdapted adapted = adapteds[i];
+
+ //
+ if (adapted == null)
+ {
+ throw new IllegalArgumentException("No null adapted accepted");
+ }
+
+ //
+ itfs[1 + i] = adapted.itf;
+
+ //
+ addAdapted(adapted.itf, new AdaptedMethodDispatcherFactory(adapted.object));
+ }
+
+ //
+ ctor = Proxy.getProxyClass(loader, itfs).getConstructor(new Class[]{InvocationHandler.class});
+ }
+
+ private void addAdapted(Class adaptedClass, MethodDispatcherFactory methodDispatcherFactory)
+ {
+ Method[] methods = adaptedClass.getMethods();
+ for (int j = 0;j < methods.length;j++)
+ {
+ Method method = methods[j];
+ int modifiers = method.getModifiers();
+ if (Modifier.isPublic(modifiers) && !Modifier.isFinal(modifiers) && !Modifier.isStatic(modifiers))
+ {
+ if (!dispatchers.containsKey(method))
+ {
+ dispatchers.put(method, methodDispatcherFactory.createDispatcher(method));
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns an instance of the the adaptable object.
+ */
+ public ClassAdaptable getAdaptable() throws IllegalAccessException, InstantiationException, InvocationTargetException
+ {
+ return (ClassAdaptable)ctor.newInstance(new Object[]{handler});
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/adapter/DefaultJavaLangObjectAdapted.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/adapter/DefaultJavaLangObjectAdapted.java (rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/adapter/DefaultJavaLangObjectAdapted.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.common.adapter;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class DefaultJavaLangObjectAdapted implements JavaLangObjectAdapted
+{
+
+ public String toString(ClassAdaptable adaptable)
+ {
+ return "Adapter[class=" + adaptable.getClass().getName() + ",hashCode=" + System.identityHashCode(adaptable) + "]";
+ }
+
+ public int hashCode(ClassAdaptable adaptable)
+ {
+ return System.identityHashCode(adaptable);
+ }
+
+ public boolean equals(ClassAdaptable adaptable, Object obj)
+ {
+ return adaptable == obj;
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectAdapted.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectAdapted.java (rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectAdapted.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,57 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.common.adapter;
+
+/**
+ * Defines contract for the <code>java.lang.Object</code> adapted.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface JavaLangObjectAdapted
+{
+ /**
+ * Implementation of <code>toString()</code>.
+ *
+ * @param adaptable the adaptable object
+ * @return the string value
+ */
+ String toString(ClassAdaptable adaptable);
+
+ /**
+ * Implementation of <code>hashCode</code>.
+ *
+ * @param adaptable the adaptable object
+ * @return the hash code value
+ */
+ int hashCode(ClassAdaptable adaptable);
+
+ /**
+ * Implementation of <code>equals</code>.
+ *
+ * @param adaptable the adaptable object
+ * @param obj the object to test equality with
+ * @return true the equals value
+ */
+ boolean equals(ClassAdaptable adaptable, Object obj);
+}
Added: trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectMethodDispatcher.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectMethodDispatcher.java (rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectMethodDispatcher.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,84 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.common.adapter;
+
+/**
+ * Implementation of the <code>MethodDispatcher</code> interface for the methods of <code>java.lang.Object</code> which
+ * are delegated by a dynamic proxy to the <code>InvocationHandler</code>.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+abstract class JavaLangObjectMethodDispatcher implements MethodDispatcher
+{
+
+ /** . */
+ protected final JavaLangObjectAdapted target;
+
+ public JavaLangObjectMethodDispatcher(JavaLangObjectAdapted target)
+ {
+ this.target = target;
+ }
+
+ static class ToString extends JavaLangObjectMethodDispatcher
+ {
+
+ public ToString(JavaLangObjectAdapted target)
+ {
+ super(target);
+ }
+
+ public Object dispatch(ClassAdaptable adaptable, Object[] args) throws Throwable
+ {
+ return target.toString(adaptable);
+ }
+ }
+
+ static class Equals extends JavaLangObjectMethodDispatcher
+ {
+
+ public Equals(JavaLangObjectAdapted target)
+ {
+ super(target);
+ }
+
+ public Object dispatch(ClassAdaptable adaptable, Object[] args) throws Throwable
+ {
+ return Boolean.valueOf(target.equals(adaptable, args[0]));
+ }
+ }
+
+ static class HashCode extends JavaLangObjectMethodDispatcher
+ {
+
+ public HashCode(JavaLangObjectAdapted target)
+ {
+ super(target);
+ }
+
+ public Object dispatch(ClassAdaptable adaptable, Object[] args) throws Throwable
+ {
+ return new Integer(target.hashCode(adaptable));
+ }
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectMethodDispatcherFactory.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectMethodDispatcherFactory.java (rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/adapter/JavaLangObjectMethodDispatcherFactory.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,61 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.common.adapter;
+
+import java.lang.reflect.Method;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+class JavaLangObjectMethodDispatcherFactory implements MethodDispatcherFactory
+{
+
+ /** . */
+ private final JavaLangObjectAdapted target;
+
+ public JavaLangObjectMethodDispatcherFactory(JavaLangObjectAdapted target)
+ {
+ this.target = target;
+ }
+
+ public MethodDispatcher createDispatcher(Method method)
+ {
+ if ("toString".equals(method.getName()))
+ {
+ return new JavaLangObjectMethodDispatcher.ToString(target);
+ }
+ else if ("equals".equals(method.getName()))
+ {
+ return new JavaLangObjectMethodDispatcher.Equals(target);
+ }
+ else if ("hashCode".equals(method.getName()))
+ {
+ return new JavaLangObjectMethodDispatcher.HashCode(target);
+ }
+ else
+ {
+ throw new AssertionError("Should not be possible");
+ }
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/common/adapter/MethodDispatcher.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/adapter/MethodDispatcher.java (rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/adapter/MethodDispatcher.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,32 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.common.adapter;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+interface MethodDispatcher
+{
+ Object dispatch(ClassAdaptable adaptable, Object[] args) throws Throwable;
+}
Added: trunk/common/src/main/org/jboss/portal/common/adapter/MethodDispatcherFactory.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/adapter/MethodDispatcherFactory.java (rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/adapter/MethodDispatcherFactory.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,34 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.common.adapter;
+
+import java.lang.reflect.Method;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+interface MethodDispatcherFactory
+{
+ MethodDispatcher createDispatcher(Method method);
+}
Added: trunk/common/src/main/org/jboss/portal/test/common/adapter/Adapted1.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/test/common/adapter/Adapted1.java (rev 0)
+++ trunk/common/src/main/org/jboss/portal/test/common/adapter/Adapted1.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.common.adapter;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class Adapted1 implements Business1
+{
+
+ /** . */
+ int business1MethodCount;
+
+ /** . */
+ int commonMethodCount;
+
+ public void business1Method()
+ {
+ business1MethodCount++;
+ }
+
+ public void commonMethod()
+ {
+ commonMethodCount++;
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/test/common/adapter/Adapted2.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/test/common/adapter/Adapted2.java (rev 0)
+++ trunk/common/src/main/org/jboss/portal/test/common/adapter/Adapted2.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.common.adapter;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class Adapted2 implements Business2
+{
+
+ /** . */
+ int business2MethodCount;
+
+ /** . */
+ int commonMethodCount;
+
+ public void business2Method()
+ {
+ business2MethodCount++;
+ }
+
+ public void commonMethod()
+ {
+ commonMethodCount++;
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/test/common/adapter/AdapterTestCase.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/test/common/adapter/AdapterTestCase.java (rev 0)
+++ trunk/common/src/main/org/jboss/portal/test/common/adapter/AdapterTestCase.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,162 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.common.adapter;
+
+import junit.framework.TestCase;
+import org.jboss.portal.common.adapter.ClassAdapter;
+import org.jboss.portal.common.adapter.ClassAdapted;
+import org.jboss.portal.common.adapter.ClassAdaptable;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class AdapterTestCase extends TestCase
+{
+
+ Adapted1 adapted1;
+ Adapted2 adapted2;
+ ObjectAdapted objectAdapted;
+ ClassAdaptable adaptable;
+
+ protected void setUp() throws Exception
+ {
+ adapted1 = new Adapted1();
+ adapted2 = new Adapted2();
+ objectAdapted = new ObjectAdapted();
+ ClassAdapted[] adapteds = new ClassAdapted[]{new ClassAdapted(Business1.class, adapted1),new ClassAdapted(Business2.class, adapted2)};
+ ClassAdapter adapter = new ClassAdapter(Thread.currentThread().getContextClassLoader(), adapteds, objectAdapted);
+ adaptable = adapter.getAdaptable();
+ }
+
+
+ protected void tearDown() throws Exception
+ {
+ adapted1 = null;
+ adapted2 = null;
+ objectAdapted = null;
+ adaptable = null;
+ }
+
+ public void testImplementedInterfaces()
+ {
+ assertTrue(adaptable instanceof Business1);
+ assertTrue(adaptable instanceof Business2);
+ }
+
+ public void testObjectMethodCall() throws Exception
+ {
+ assertEquals(0, adapted1.business1MethodCount);
+ assertEquals(0, adapted1.commonMethodCount);
+ assertEquals(0, adapted2.business2MethodCount);
+ assertEquals(0, adapted2.commonMethodCount);
+ assertEquals(0, objectAdapted.toStringCount);
+ assertEquals(0, objectAdapted.hashCodeCount);
+ assertEquals(0, objectAdapted.equalsCount);
+
+ //
+ assertEquals("Foo", adaptable.toString());
+ assertEquals(0, adapted1.business1MethodCount);
+ assertEquals(0, adapted1.commonMethodCount);
+ assertEquals(0, adapted2.business2MethodCount);
+ assertEquals(0, adapted2.commonMethodCount);
+ assertEquals(1, objectAdapted.toStringCount);
+ assertEquals(0, objectAdapted.hashCodeCount);
+ assertEquals(0, objectAdapted.equalsCount);
+
+ //
+ assertEquals(1234, adaptable.hashCode());
+ assertEquals(0, adapted1.business1MethodCount);
+ assertEquals(0, adapted1.commonMethodCount);
+ assertEquals(0, adapted2.business2MethodCount);
+ assertEquals(0, adapted2.commonMethodCount);
+ assertEquals(1, objectAdapted.toStringCount);
+ assertEquals(1, objectAdapted.hashCodeCount);
+ assertEquals(0, objectAdapted.equalsCount);
+
+ //
+ assertEquals(true, adaptable.equals(Boolean.TRUE));
+ assertEquals(0, adapted1.business1MethodCount);
+ assertEquals(0, adapted1.commonMethodCount);
+ assertEquals(0, adapted2.business2MethodCount);
+ assertEquals(0, adapted2.commonMethodCount);
+ assertEquals(1, objectAdapted.toStringCount);
+ assertEquals(1, objectAdapted.hashCodeCount);
+ assertEquals(1, objectAdapted.equalsCount);
+
+ //
+ assertEquals(false, adaptable.equals(Boolean.FALSE));
+ assertEquals(0, adapted1.business1MethodCount);
+ assertEquals(0, adapted1.commonMethodCount);
+ assertEquals(0, adapted2.business2MethodCount);
+ assertEquals(0, adapted2.commonMethodCount);
+ assertEquals(1, objectAdapted.toStringCount);
+ assertEquals(1, objectAdapted.hashCodeCount);
+ assertEquals(2, objectAdapted.equalsCount);
+ }
+
+ public void testBusinessMethodCall() throws Exception
+ {
+ assertEquals(0, adapted1.business1MethodCount);
+ assertEquals(0, adapted1.commonMethodCount);
+ assertEquals(0, adapted2.business2MethodCount);
+ assertEquals(0, adapted2.commonMethodCount);
+ assertEquals(0, objectAdapted.toStringCount);
+ assertEquals(0, objectAdapted.hashCodeCount);
+ assertEquals(0, objectAdapted.equalsCount);
+
+ //
+ Business1 business1Adapter = (Business1)adaptable;
+ Business2 business2Adapter = (Business2)adaptable;
+
+ //
+ business1Adapter.business1Method();
+ assertEquals(1, adapted1.business1MethodCount);
+ assertEquals(0, adapted1.commonMethodCount);
+ assertEquals(0, adapted2.business2MethodCount);
+ assertEquals(0, adapted2.commonMethodCount);
+ assertEquals(0, objectAdapted.toStringCount);
+ assertEquals(0, objectAdapted.hashCodeCount);
+ assertEquals(0, objectAdapted.equalsCount);
+
+ //
+ business2Adapter.business2Method();
+ assertEquals(1, adapted1.business1MethodCount);
+ assertEquals(0, adapted1.commonMethodCount);
+ assertEquals(1, adapted2.business2MethodCount);
+ assertEquals(0, adapted2.commonMethodCount);
+ assertEquals(0, objectAdapted.toStringCount);
+ assertEquals(0, objectAdapted.hashCodeCount);
+ assertEquals(0, objectAdapted.equalsCount);
+
+ //
+ business1Adapter.commonMethod();
+ assertEquals(1, adapted1.business1MethodCount);
+ assertEquals(1, adapted1.commonMethodCount);
+ assertEquals(1, adapted2.business2MethodCount);
+ assertEquals(0, adapted2.commonMethodCount);
+ assertEquals(0, objectAdapted.toStringCount);
+ assertEquals(0, objectAdapted.hashCodeCount);
+ assertEquals(0, objectAdapted.equalsCount);
+ }
+}
Added: trunk/common/src/main/org/jboss/portal/test/common/adapter/Business1.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/test/common/adapter/Business1.java (rev 0)
+++ trunk/common/src/main/org/jboss/portal/test/common/adapter/Business1.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.common.adapter;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface Business1
+{
+ void business1Method();
+ void commonMethod();
+}
Added: trunk/common/src/main/org/jboss/portal/test/common/adapter/Business2.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/test/common/adapter/Business2.java (rev 0)
+++ trunk/common/src/main/org/jboss/portal/test/common/adapter/Business2.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.common.adapter;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface Business2
+{
+ void business2Method();
+ void commonMethod();
+}
Added: trunk/common/src/main/org/jboss/portal/test/common/adapter/ObjectAdapted.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/test/common/adapter/ObjectAdapted.java (rev 0)
+++ trunk/common/src/main/org/jboss/portal/test/common/adapter/ObjectAdapted.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,56 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.common.adapter;
+
+import org.jboss.portal.common.adapter.JavaLangObjectAdapted;
+import org.jboss.portal.common.adapter.ClassAdaptable;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ObjectAdapted implements JavaLangObjectAdapted
+{
+
+ int toStringCount;
+ int hashCodeCount;
+ int equalsCount;
+
+ public String toString(ClassAdaptable adaptable)
+ {
+ toStringCount++;
+ return "Foo";
+ }
+
+ public int hashCode(ClassAdaptable adaptable)
+ {
+ hashCodeCount++;
+ return 1234;
+ }
+
+ public boolean equals(ClassAdaptable adaptable, Object obj)
+ {
+ equalsCount++;
+ return ((Boolean)obj).booleanValue();
+ }
+}
Modified: trunk/core/build.xml
===================================================================
--- trunk/core/build.xml 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/core/build.xml 2007-05-09 09:27:25 UTC (rev 7226)
@@ -555,10 +555,19 @@
</x-sysproperty>
<x-test>
+<!--
<zest todir="${test.reports}" name="org.jboss.portal.test.core.model.portal.PortalObjectContainerTestCase"
outfile="TEST-PortalObjectContainerTestCase">
<parameter name="CacheNaturalId" value="true"/>
+ <parameter name="ConfigLocation" value="org/jboss/portal/test/core/model/portal/persistent-jboss-beans.xml"/>
</zest>
+-->
+ <zest todir="${test.reports}" name="org.jboss.portal.test.core.model.portal.PortalObjectContainerTestCase"
+ outfile="TEST-PortalObjectContainerTestCase">
+ <parameter name="CacheNaturalId" value="true"/>
+ <parameter name="ConfigLocation" value="org/jboss/portal/test/core/model/portal/transient-jboss-beans.xml"/>
+ </zest>
+<!--
<zest todir="${test.reports}" name="org.jboss.portal.test.core.model.instance.InstanceContainerTestCase"
outfile="TEST-PersistedLocally-ClonedOnCreate-InstanceContainerTestCase">
<parameter name="PersistLocally" value="true"/>
@@ -600,6 +609,7 @@
name="org.jboss.portal.test.core.model.portal.PortalObjectPermissionTestCase"/>
<test todir="${test.reports}"
name="org.jboss.portal.test.core.model.portal.PortalObjectIdTestCase"/>
+-->
</x-test>
<x-classpath>
<pathelement location="${build.lib}/portal-core-lib.jar"/>
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/portlet/AjaxInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/portlet/AjaxInterceptor.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/portlet/AjaxInterceptor.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -26,12 +26,11 @@
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-import org.jboss.portal.portlet.impl.jsr168.info.ContainerPortletInfo;
import org.jboss.portal.portlet.container.PortletContainerInvoker;
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.core.metadata.portlet.JBossPortletMetaData;
-import org.jboss.portal.core.metadata.portlet.AjaxMetaData;
+import org.jboss.portal.core.portlet.info.CorePortletInfo;
+import org.jboss.portal.core.portlet.info.AjaxInfo;
/**
* Look at the portlet ajax meta data.
@@ -44,6 +43,7 @@
public class AjaxInterceptor extends PortletInterceptor
{
+ /** . */
public static final String PARTIAL_REFRESH = "partialRefresh";
protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
@@ -53,14 +53,14 @@
//
if (response instanceof FragmentResponse)
{
- PortletContainer container = ((ContainerPortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
- JBossPortletMetaData portletMD = (JBossPortletMetaData)container.getJBossMetaData();
- if (portletMD != null)
+ PortletContainer container = (PortletContainer)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER);
+ CorePortletInfo info = (CorePortletInfo)container.getInfo();
+ if (info != null)
{
- AjaxMetaData ajax = portletMD.getAjax();
+ AjaxInfo ajax = info.getAjax();
if (ajax != null)
{
- invocation.setAttribute(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, PARTIAL_REFRESH, ajax.getPartialRefresh());
+ invocation.setAttribute(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, PARTIAL_REFRESH, Boolean.valueOf(ajax.getPartialRefresh()));
}
}
}
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -24,12 +24,10 @@
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.common.markup.MarkupElement;
-import org.jboss.portal.core.metadata.portlet.HeaderContentMetaData;
-import org.jboss.portal.core.metadata.portlet.JBossPortletMetaData;
-import org.jboss.portal.core.metadata.portlet.ElementMetaData;
+import org.jboss.portal.core.portlet.info.CorePortletInfo;
+import org.jboss.portal.core.portlet.info.MarkupHeaderInfo;
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.container.PortletContainerInvoker;
-import org.jboss.portal.portlet.impl.jsr168.info.ContainerPortletInfo;
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
@@ -63,22 +61,19 @@
String headerChars = fragment.getHeader();
// Add declaratively injected header content here (get it via the component)
- PortletContainer container = ((ContainerPortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
- JBossPortletMetaData portletMD = (JBossPortletMetaData)container.getJBossMetaData();
- if (portletMD != null)
+ PortletContainer container = (PortletContainer)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER);
+ CorePortletInfo info = (CorePortletInfo)container.getInfo();
+ MarkupHeaderInfo headerContentInfo = info.getMarkupHeader();
+ if (headerContentInfo != null)
{
- HeaderContentMetaData headerContent = portletMD.getHeaderContent();
- if (headerContent != null)
- {
- // Init the buffer
- buffer = initBuffer(headerChars);
+ // Init the buffer
+ buffer = initBuffer(headerChars);
- // Get the context path
- String contextPath = (String)invocation.getDispatchedRequest().getAttribute("javax.servlet.include.context_path");
+ // Get the context path
+ String contextPath = (String)invocation.getDispatchedRequest().getAttribute("javax.servlet.include.context_path");
- // Render header
- render(headerContent, buffer, contextPath);
- }
+ // Render header
+ render(headerContentInfo, buffer, contextPath);
}
// Add header content coming from the response written by the portlet at runtime
@@ -124,18 +119,17 @@
}
/**
- * Render the header content provided by the portlet meta data.
+ * Render the header content provided by the portlet.
*
* @param headerContent
* @param writer
* @param contextPath
*/
- protected void render(HeaderContentMetaData headerContent, StringWriter writer, String contextPath)
+ protected void render(MarkupHeaderInfo headerContent, StringWriter writer, String contextPath)
{
- for (Iterator i = headerContent.getElements().iterator(); i.hasNext();)
+ for (Iterator i = headerContent.getMarkupElements().iterator(); i.hasNext();)
{
- ElementMetaData elementMD = (ElementMetaData)i.next();
- MarkupElement element = elementMD.getElement();
+ MarkupElement element = (MarkupElement)i.next();
writer.write(element.toString(contextPath));
}
}
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/portlet/TransactionInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/portlet/TransactionInterceptor.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/portlet/TransactionInterceptor.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -24,12 +24,11 @@
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.common.transaction.Transactions;
-import org.jboss.portal.portlet.impl.jsr168.info.ContainerPortletInfo;
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
-import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.container.PortletContainerInvoker;
+import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.core.portlet.info.CorePortletInfo;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -44,11 +43,11 @@
Transactions.Type txType = Transactions.TYPE_NOT_SUPPORTED;
// Override tx type if found
- ContainerPortletInfo portlet = (ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
- JBossPortletMetaData portletMD = portlet.getContainer().getJBossMetaData();
- if (portletMD != null)
+ PortletContainer container = (PortletContainer)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER);
+ CorePortletInfo info = (CorePortletInfo)container.getInfo();
+ if (info != null)
{
- txType = portletMD.getTxType();
+ txType = info.getTxType();
}
//
Modified: trunk/core/src/main/org/jboss/portal/core/impl/api/node/PortalNodeImpl.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/api/node/PortalNodeImpl.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/core/src/main/org/jboss/portal/core/impl/api/node/PortalNodeImpl.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -106,7 +106,7 @@
* @param parentNode the parent node of this node
* @param object the wrapped portal object
*/
- protected PortalNodeImpl(PortalNodeImpl parentNode, PortalObject object)
+ private PortalNodeImpl(PortalNodeImpl parentNode, PortalObject object)
{
this.portalAuthorizationManager = parentNode.portalAuthorizationManager;
this.parentNode = parentNode;
@@ -355,16 +355,25 @@
{
Map childrenMap = new HashMap();
+ // See if we have recursive permission on the provided node that will avoid to make a check for each of them
+ boolean allVisible = portalAuthorizationManager.checkPermission(new PortalObjectPermission(objectNode.object.getId(), PortalObjectPermission.VIEW_RECURSIVE_ACTION));
+
//
for (Iterator i = tmp.iterator(); i.hasNext();)
{
PortalObject childObject = (PortalObject)i.next();
- // Prepare to check
- PortalObjectPermission perm = new PortalObjectPermission(childObject.getId(), PortalObjectPermission.VIEW_MASK);
+ // It is visible if the parent has recursive view enabled
+ boolean visible = allVisible;
+ // Check for the particular node
+ if (!visible)
+ {
+ visible = portalAuthorizationManager.checkPermission(new PortalObjectPermission(childObject.getId(), PortalObjectPermission.VIEW_MASK));
+ }
+
// We only add it if the user can view the node
- if (portalAuthorizationManager.checkPermission(perm))
+ if (visible)
{
PortalNodeImpl child = new PortalNodeImpl(objectNode, childObject);
childrenMap.put(child.getName(), child);
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -77,9 +77,9 @@
this(true);
}
- public PortalObjectImpl(boolean hibernate)
+ public PortalObjectImpl(boolean initState)
{
- this.declaredPropertyMap = hibernate ? null : new HashMap();
+ this.declaredPropertyMap = initState ? null : new HashMap();
this.listener = null;
}
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/portal/TransientPortalObjectContainer.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/portal/TransientPortalObjectContainer.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/portal/TransientPortalObjectContainer.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -46,21 +46,12 @@
//
ctx = new Context();
- }
- public boolean createRootObject()
- {
- if (root != null)
- {
- return false;
- }
-
//
root = new ObjectNode(ctx, "", "");
- ContextImpl ctx = new ContextImpl();
+ ContextImpl ctx = new ContextImpl(false);
root.setObject(ctx);
ctx.setObjectNode(root);
- return true;
}
/** @see PortalObjectContainer#getAuthorizationDomain() */
Added: trunk/core/src/main/org/jboss/portal/core/impl/portlet/info/AjaxInfoImpl.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/portlet/info/AjaxInfoImpl.java (rev 0)
+++ trunk/core/src/main/org/jboss/portal/core/impl/portlet/info/AjaxInfoImpl.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.impl.portlet.info;
+
+import org.jboss.portal.core.portlet.info.AjaxInfo;
+import org.jboss.portal.core.metadata.portlet.AjaxMetaData;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class AjaxInfoImpl implements AjaxInfo
+{
+
+ /** . */
+ private boolean partialRefresh;
+
+ public AjaxInfoImpl(AjaxMetaData ajaxMD)
+ {
+ partialRefresh = !Boolean.FALSE.equals(ajaxMD.getPartialRefresh());
+ }
+
+ public boolean getPartialRefresh()
+ {
+ return partialRefresh;
+ }
+}
Added: trunk/core/src/main/org/jboss/portal/core/impl/portlet/info/CorePortletInfoFactory.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/portlet/info/CorePortletInfoFactory.java (rev 0)
+++ trunk/core/src/main/org/jboss/portal/core/impl/portlet/info/CorePortletInfoFactory.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.impl.portlet.info;
+
+import org.jboss.portal.portlet.impl.jsr168.spi.PortletInfoFactory;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
+import org.jboss.portal.common.i18n.ResourceBundleManager;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class CorePortletInfoFactory implements PortletInfoFactory
+{
+ public PortletInfo createPortletInfo(
+ PortletMetaData portletMD,
+ JBossPortletMetaData jbossPortletMD,
+ ResourceBundleManager resourceBundleManager)
+ {
+ return new CorePortletInfoImpl(portletMD, jbossPortletMD, resourceBundleManager);
+ }
+}
Added: trunk/core/src/main/org/jboss/portal/core/impl/portlet/info/CorePortletInfoImpl.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/portlet/info/CorePortletInfoImpl.java (rev 0)
+++ trunk/core/src/main/org/jboss/portal/core/impl/portlet/info/CorePortletInfoImpl.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,80 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.impl.portlet.info;
+
+import org.jboss.portal.core.portlet.info.CorePortletInfo;
+import org.jboss.portal.core.portlet.info.AjaxInfo;
+import org.jboss.portal.core.portlet.info.MarkupHeaderInfo;
+import org.jboss.portal.core.metadata.portlet.JBossPortletMetaData;
+import org.jboss.portal.core.metadata.portlet.AjaxMetaData;
+import org.jboss.portal.core.metadata.portlet.HeaderContentMetaData;
+import org.jboss.portal.portlet.impl.jsr168.info.ContainerPortletInfo;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
+import org.jboss.portal.common.i18n.ResourceBundleManager;
+import org.jboss.portal.common.transaction.Transactions;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class CorePortletInfoImpl extends ContainerPortletInfo implements CorePortletInfo
+{
+
+ /** . */
+ private final Transactions.Type txType;
+
+ /** . */
+ private final AjaxInfoImpl ajax;
+
+ /** . */
+ private final MarkupHeaderInfoImpl markupHeader;
+
+ public CorePortletInfoImpl(PortletMetaData portletMD, org.jboss.portal.portlet.metadata.JBossPortletMetaData jbossPortletMD, ResourceBundleManager bundleMgr)
+ {
+ super(portletMD, jbossPortletMD, bundleMgr);
+
+ //
+ AjaxMetaData ajaxMD = ((JBossPortletMetaData)jbossPortletMD).getAjax();
+ HeaderContentMetaData headerContentMD = ((JBossPortletMetaData)jbossPortletMD).getHeaderContent();
+
+ //
+ this.txType = jbossPortletMD.getTxType();
+ this.ajax = ajaxMD != null ? new AjaxInfoImpl(ajaxMD) : null;
+ this.markupHeader = headerContentMD != null ? new MarkupHeaderInfoImpl(headerContentMD) : null;
+ }
+
+ public Transactions.Type getTxType()
+ {
+ return txType;
+ }
+
+ public AjaxInfo getAjax()
+ {
+ return ajax;
+ }
+
+ public MarkupHeaderInfo getMarkupHeader()
+ {
+ return markupHeader;
+ }
+}
Added: trunk/core/src/main/org/jboss/portal/core/impl/portlet/info/MarkupHeaderInfoImpl.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/portlet/info/MarkupHeaderInfoImpl.java (rev 0)
+++ trunk/core/src/main/org/jboss/portal/core/impl/portlet/info/MarkupHeaderInfoImpl.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,61 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.impl.portlet.info;
+
+import org.jboss.portal.core.portlet.info.MarkupHeaderInfo;
+import org.jboss.portal.core.metadata.portlet.HeaderContentMetaData;
+import org.jboss.portal.core.metadata.portlet.ElementMetaData;
+
+import java.util.Collection;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class MarkupHeaderInfoImpl implements MarkupHeaderInfo
+{
+
+ /** . */
+ private final Collection markupElements;
+
+ public MarkupHeaderInfoImpl(HeaderContentMetaData headerContentMD)
+ {
+ ArrayList markupElements = new ArrayList(headerContentMD.getElements().size());
+ for (Iterator i = headerContentMD.getElements().iterator();i.hasNext();)
+ {
+ ElementMetaData elementMD = (ElementMetaData)i.next();
+ markupElements.add(elementMD.getElement());
+ }
+
+ //
+ this.markupElements = Collections.unmodifiableCollection(markupElements);
+ }
+
+ public Collection getMarkupElements()
+ {
+ return markupElements;
+ }
+}
Added: trunk/core/src/main/org/jboss/portal/core/portlet/info/AjaxInfo.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/portlet/info/AjaxInfo.java (rev 0)
+++ trunk/core/src/main/org/jboss/portal/core/portlet/info/AjaxInfo.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,32 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.portlet.info;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface AjaxInfo
+{
+ boolean getPartialRefresh();
+}
Added: trunk/core/src/main/org/jboss/portal/core/portlet/info/CorePortletInfo.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/portlet/info/CorePortletInfo.java (rev 0)
+++ trunk/core/src/main/org/jboss/portal/core/portlet/info/CorePortletInfo.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.portlet.info;
+
+import org.jboss.portal.common.transaction.Transactions;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface CorePortletInfo
+{
+ /**
+ *
+ * @return
+ */
+ Transactions.Type getTxType();
+
+ /**
+ *
+ * @return
+ */
+ AjaxInfo getAjax();
+
+ /**
+ *
+ * @return
+ */
+ MarkupHeaderInfo getMarkupHeader();
+}
Added: trunk/core/src/main/org/jboss/portal/core/portlet/info/MarkupHeaderInfo.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/portlet/info/MarkupHeaderInfo.java (rev 0)
+++ trunk/core/src/main/org/jboss/portal/core/portlet/info/MarkupHeaderInfo.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,34 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.portlet.info;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface MarkupHeaderInfo
+{
+ Collection getMarkupElements();
+}
Modified: trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -23,19 +23,20 @@
package org.jboss.portal.test.core.model.portal;
import junit.framework.TestSuite;
-import org.jboss.portal.core.impl.model.portal.PersistentPortalObjectContainer;
import org.jboss.portal.core.model.portal.PortalContainer;
import org.jboss.portal.core.model.portal.Page;
import org.jboss.portal.core.model.portal.Portal;
import org.jboss.portal.core.model.portal.PortalObject;
import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.PortalObjectContainer;
import org.jboss.portal.core.model.content.ContentType;
import org.jboss.portal.core.model.content.spi.handler.ContentState;
import org.jboss.portal.test.core.PortalBaseTestCase;
import org.jboss.portal.test.core.model.content.SimpleContent;
import org.jboss.portal.test.framework.embedded.DataSourceSupport;
import org.jboss.portal.common.test.TestParametrization;
+import org.jboss.portal.common.test.TestParameterValue;
import org.jboss.portal.common.test.junit.JUnitAdapter;
import org.jboss.portal.common.test.junit.POJOJUnitTest;
import org.jboss.portal.common.junit.TransactionAssert;
@@ -60,7 +61,7 @@
{
/** . */
- private PersistentPortalObjectContainer container;
+ private PortalObjectContainer container;
public static TestSuite suite() throws Exception
{
@@ -76,15 +77,17 @@
protected String getConfigLocation()
{
- return "org/jboss/portal/test/core/model/portal/jboss-beans.xml";
+ TestParametrization parametrization = JUnitAdapter.getParametrization();
+ TestParameterValue paramValue = parametrization.getParameterValue("ConfigLocation");
+ return (String)paramValue.get();
}
- public PersistentPortalObjectContainer getPortalObjectContainer()
+ public PortalObjectContainer getPortalObjectContainer()
{
return container;
}
- public void setPortalObjectContainer(PersistentPortalObjectContainer container)
+ public void setPortalObjectContainer(PortalObjectContainer container)
{
this.container = container;
}
Modified: trunk/core/src/main/org/jboss/portlet/JBossAPIFactory.java
===================================================================
--- trunk/core/src/main/org/jboss/portlet/JBossAPIFactory.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/core/src/main/org/jboss/portlet/JBossAPIFactory.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portlet;
-import org.jboss.portal.portlet.impl.jsr168.APIFactory;
+import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory;
import org.jboss.portal.portlet.impl.jsr168.api.ActionRequestImpl;
import org.jboss.portal.portlet.impl.jsr168.api.ActionResponseImpl;
import org.jboss.portal.portlet.impl.jsr168.api.RenderRequestImpl;
@@ -34,7 +34,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public class JBossAPIFactory implements APIFactory
+public class JBossAPIFactory implements PortletAPIFactory
{
public ActionRequestImpl createActionRequest(ActionInvocation invocation)
{
Modified: trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-05-09 09:27:25 UTC (rev 7226)
@@ -1131,7 +1131,8 @@
optional-attribute-name="PortletInstancesEntityResolver"
proxy-type="attribute">portal:service=EntityResolver</depends>
<attribute name="StandardJBossApplicationMetaDataLocation">conf/standardjboss-portlet.xml</attribute>
- <attribute name="APIFactoryClassName">org.jboss.portlet.JBossAPIFactory</attribute>
+ <attribute name="PortletAPIFactoryClassName">org.jboss.portlet.JBossAPIFactory</attribute>
+ <attribute name="PortletInfoFactoryClassName">org.jboss.portal.core.impl.portlet.info.CorePortletInfoFactory</attribute>
<!-- Set to false in clustered mode, otherwise set to true -->
<attribute name="CreateInstances">@portal.single@</attribute>
</mbean>
Added: trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/model/portal/persistent-jboss-beans.xml
===================================================================
--- trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/model/portal/persistent-jboss-beans.xml (rev 0)
+++ trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/model/portal/persistent-jboss-beans.xml 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
+ xmlns="urn:jboss:bean-deployer">
+
+ <bean name="DataSourceConfig" class="org.jboss.portal.test.framework.embedded.DataSourceSupport$Config">
+ <constructor factoryMethod="getBean">
+ <factory bean="BeanFactory"/>
+ <parameter>DataSourceConfig</parameter>
+ </constructor>
+ </bean>
+
+ <bean name="HibernateConfig" class="org.jboss.portal.test.framework.embedded.HibernateSupport$Config">
+ <constructor factoryMethod="getBean">
+ <factory bean="BeanFactory"/>
+ <parameter>HibernateConfig</parameter>
+ </constructor>
+ </bean>
+
+ <bean name="JNDISupport" class="org.jboss.portal.test.framework.embedded.JNDISupport">
+ </bean>
+
+ <bean name="TransactionManagerSupport" class="org.jboss.portal.test.framework.embedded.TransactionManagerSupport">
+ </bean>
+
+ <bean name="ConnectionManagerSupport" class="org.jboss.portal.test.framework.embedded.ConnectionManagerSupport">
+ <property name="transactionManager"><inject bean="TransactionManagerSupport" property="transactionManager"/></property>
+ </bean>
+
+ <bean name="DataSourceSupport" class="org.jboss.portal.test.framework.embedded.DataSourceSupport">
+ <property name="transactionManager"><inject bean="TransactionManagerSupport" property="transactionManager"/></property>
+ <property name="connectionManagerReference"><inject bean="ConnectionManagerSupport" property="connectionManagerReference"/></property>
+ <property name="config"><inject bean="DataSourceConfig"/></property>
+ </bean>
+
+ <bean name="HibernateSupport" class="org.jboss.portal.test.framework.embedded.HibernateSupport">
+ <property name="config"><inject bean="HibernateConfig"/></property>
+ <property name="mappings">
+ <list elementClass="java.lang.String">
+ <value>conf/hibernate/portal/domain.hbm.xml</value>
+ </list>
+ </property>
+ <property name="jNDIName">java:/SessionFactory</property>
+ </bean>
+
+ <bean name="AuthorizationDomainRegistry" class="org.jboss.portal.security.impl.JBossAuthorizationDomainRegistryImpl">
+ </bean>
+
+ <bean name="AuthorizationManagerFactory" class="org.jboss.portal.security.impl.jacc.JACCPortalAuthorizationManagerFactory">
+ <property name="authorizationDomainRegistry"><inject bean="AuthorizationDomainRegistry"/></property>
+ </bean>
+
+ <bean name="ContentProviderRegistry" class="org.jboss.portal.test.core.model.content.SimpleContentProviderRegistry">
+ </bean>
+
+ <bean name="PortletContentProvider" class="org.jboss.portal.test.core.model.content.SimpleContentProvider">
+ <constructor>
+ <parameter>portlet</parameter>
+ </constructor>
+ <property name="registry"><inject bean="ContentProviderRegistry"/></property>
+ </bean>
+
+ <bean name="PortalObjectContainer" class="org.jboss.portal.core.impl.model.portal.PersistentPortalObjectContainer">
+ <property name="sessionFactoryJNDIName">java:/SessionFactory</property>
+ <property name="authorizationDomainRegistry"><inject bean="AuthorizationDomainRegistry"/></property>
+ <property name="portalAuthorizationManagerFactory"><inject bean="AuthorizationManagerFactory"/></property>
+ <property name="contentProviderRegistry"><inject bean="ContentProviderRegistry"/></property>
+ </bean>
+
+ <bean name="TestBean" class="org.jboss.portal.test.core.model.portal.PortalObjectContainerTestCase">
+ <constructor factoryMethod="getBean">
+ <factory bean="BeanFactory"/>
+ <parameter>TestBean</parameter>
+ </constructor>
+ <property name="hibernate"><inject bean="HibernateSupport"/></property>
+ <property name="portalObjectContainer"><inject bean="PortalObjectContainer"/></property>
+ </bean>
+</deployment>
Added: trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/model/portal/transient-jboss-beans.xml
===================================================================
--- trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/model/portal/transient-jboss-beans.xml (rev 0)
+++ trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/model/portal/transient-jboss-beans.xml 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
+ xmlns="urn:jboss:bean-deployer">
+
+ <bean name="DataSourceConfig" class="org.jboss.portal.test.framework.embedded.DataSourceSupport$Config">
+ <constructor factoryMethod="getBean">
+ <factory bean="BeanFactory"/>
+ <parameter>DataSourceConfig</parameter>
+ </constructor>
+ </bean>
+
+ <bean name="HibernateConfig" class="org.jboss.portal.test.framework.embedded.HibernateSupport$Config">
+ <constructor factoryMethod="getBean">
+ <factory bean="BeanFactory"/>
+ <parameter>HibernateConfig</parameter>
+ </constructor>
+ </bean>
+
+ <bean name="JNDISupport" class="org.jboss.portal.test.framework.embedded.JNDISupport">
+ </bean>
+
+ <bean name="TransactionManagerSupport" class="org.jboss.portal.test.framework.embedded.TransactionManagerSupport">
+ </bean>
+
+ <bean name="ConnectionManagerSupport" class="org.jboss.portal.test.framework.embedded.ConnectionManagerSupport">
+ <property name="transactionManager"><inject bean="TransactionManagerSupport" property="transactionManager"/></property>
+ </bean>
+
+ <bean name="DataSourceSupport" class="org.jboss.portal.test.framework.embedded.DataSourceSupport">
+ <property name="transactionManager"><inject bean="TransactionManagerSupport" property="transactionManager"/></property>
+ <property name="connectionManagerReference"><inject bean="ConnectionManagerSupport" property="connectionManagerReference"/></property>
+ <property name="config"><inject bean="DataSourceConfig"/></property>
+ </bean>
+
+ <bean name="HibernateSupport" class="org.jboss.portal.test.framework.embedded.HibernateSupport">
+ <property name="config"><inject bean="HibernateConfig"/></property>
+ <property name="mappings">
+ <list elementClass="java.lang.String">
+ <value>conf/hibernate/portal/domain.hbm.xml</value>
+ </list>
+ </property>
+ <property name="jNDIName">java:/SessionFactory</property>
+ </bean>
+
+ <bean name="AuthorizationDomainRegistry" class="org.jboss.portal.security.impl.JBossAuthorizationDomainRegistryImpl">
+ </bean>
+
+ <bean name="AuthorizationManagerFactory" class="org.jboss.portal.security.impl.jacc.JACCPortalAuthorizationManagerFactory">
+ <property name="authorizationDomainRegistry"><inject bean="AuthorizationDomainRegistry"/></property>
+ </bean>
+
+ <bean name="ContentProviderRegistry" class="org.jboss.portal.test.core.model.content.SimpleContentProviderRegistry">
+ </bean>
+
+ <bean name="PortletContentProvider" class="org.jboss.portal.test.core.model.content.SimpleContentProvider">
+ <constructor>
+ <parameter>portlet</parameter>
+ </constructor>
+ <property name="registry"><inject bean="ContentProviderRegistry"/></property>
+ </bean>
+
+ <bean name="PortalObjectContainer" class="org.jboss.portal.core.impl.model.portal.TransientPortalObjectContainer">
+<!--
+ <property name="authorizationDomainRegistry"><inject bean="AuthorizationDomainRegistry"/></property>
+ <property name="portalAuthorizationManagerFactory"><inject bean="AuthorizationManagerFactory"/></property>
+-->
+ <property name="contentProviderRegistry"><inject bean="ContentProviderRegistry"/></property>
+ </bean>
+
+ <bean name="TestBean" class="org.jboss.portal.test.core.model.portal.PortalObjectContainerTestCase">
+ <constructor factoryMethod="getBean">
+ <factory bean="BeanFactory"/>
+ <parameter>TestBean</parameter>
+ </constructor>
+ <property name="hibernate"><inject bean="HibernateSupport"/></property>
+ <property name="portalObjectContainer"><inject bean="PortalObjectContainer"/></property>
+ </bean>
+</deployment>
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -28,7 +28,6 @@
import org.jboss.portal.portlet.container.PortletContainerInvoker;
import org.jboss.portal.web.spi.ServletContainerContext;
import org.jboss.portal.web.RequestDispatchCallback;
-import org.jboss.portal.portlet.impl.jsr168.info.ContainerPortletInfo;
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.spi.RequestContext;
@@ -64,7 +63,7 @@
protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
- PortletContainer container = ((ContainerPortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
+ PortletContainer container = (PortletContainer)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER);
PortletApplication portletApplication = container.getApplication();
RequestContext reqCtx = invocation.getRequestContext();
ServletContext targetCtx = portletApplication.getContext().getServletContext();
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -29,6 +29,7 @@
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.container.PortletContainerInvoker;
+import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.common.util.ContentInfo;
import java.util.HashSet;
@@ -69,7 +70,8 @@
String contentType = si.getContentType().toString();
// Get the modes for this content type
- PortletInfo containerInfo = (PortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
+ PortletContainer container = (PortletContainer)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER);
+ PortletInfo containerInfo = container.getInfo();
CapabilitiesInfo capabilities = containerInfo.getCapabilities();
// Add all the modes
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortletSessionSynchronizationInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortletSessionSynchronizationInterceptor.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortletSessionSynchronizationInterceptor.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -30,6 +30,7 @@
import org.jboss.portal.portlet.session.SessionListener;
import org.jboss.portal.portlet.session.SubSession;
import org.jboss.portal.portlet.container.PortletContainerInvoker;
+import org.jboss.portal.portlet.container.PortletContainer;
import java.util.List;
@@ -41,7 +42,8 @@
{
protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
- PortletInfo portletInfo = (PortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
+ PortletContainer container = (PortletContainer)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER);
+ PortletInfo portletInfo = container.getInfo();
SessionInfo sessionInfo = portletInfo.getSession();
if (sessionInfo != null && Boolean.TRUE.equals(sessionInfo.getDistributed()))
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -32,6 +32,7 @@
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.container.PortletContainerInvoker;
+import org.jboss.portal.portlet.container.PortletContainer;
import org.apache.log4j.Logger;
/**
@@ -62,7 +63,8 @@
FragmentResponse fragmentResult = (FragmentResponse)response;
// Get config
- PortletInfo info = (PortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
+ PortletContainer container = (PortletContainer)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER);
+ PortletInfo info = container.getInfo();
CacheInfo cacheInfo = info.getCache();
// Update the fragment cache info from the meta info
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -25,6 +25,7 @@
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.portlet.TransportGuarantee;
import org.jboss.portal.portlet.container.PortletContainerInvoker;
+import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.SecurityInfo;
import org.jboss.portal.portlet.invocation.PortletInterceptor;
@@ -43,7 +44,8 @@
protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
- PortletInfo containerInfo = (PortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
+ PortletContainer container = (PortletContainer)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER);
+ PortletInfo containerInfo = container.getInfo();
SecurityInfo securityInfo = containerInfo.getSecurity();
SecurityContext securityContext = invocation.getSecurityContext();
boolean invoke = true;
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -28,12 +28,10 @@
import org.jboss.portal.portlet.container.PortletApplication;
import org.jboss.portal.portlet.container.PortletApplicationContext;
import org.jboss.portal.portlet.container.PortletContainerInvoker;
-import org.jboss.portal.portlet.impl.jsr168.info.ContainerPortletInfo;
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.invocation.response.UnavailableResponse;
-import org.jboss.portal.portlet.info.PortletInfo;
/**
* This aspect has two responsabilities :<br/> <ul> <li>continue the request only if the portlet container valve is
@@ -49,7 +47,7 @@
{
protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
- PortletContainer container = ((ContainerPortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
+ PortletContainer container = (PortletContainer)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER);
Valve valve = container.getValve();
// Try to aquire the valve
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainer.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainer.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainer.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -25,11 +25,9 @@
import org.jboss.portal.common.concurrent.Valve;
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.impl.jsr168.info.ContentTypes;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -53,22 +51,6 @@
PortletInfo getInfo();
/**
- * todo : remove that and have rather a way to expose runtime information meta data � la PortletInfo.
- *
- * Return specific JBoss Portlet buildtime meta data.
- *
- * @return the JBoss specific buildtime meta data
- */
- JBossPortletMetaData getJBossMetaData();
-
- /**
- * Return the content types understood by the container.
- *
- * @return the content types
- */
- ContentTypes getContentTypes();
-
- /**
* Return the portlet application of this container.
*
* @return the application
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -57,8 +57,8 @@
public class PortletContainerInvoker implements PortletInvoker, PortletApplicationRegistryListener
{
- /** The key under which the portlet container info are stored in the request scope of the invocation. */
- public static final String PORTLET_CONTAINER_INFO = "PORTLET_CONTAINER_INFO";
+ /** The key under which the portlet container is stored in the request scope of the invocation. */
+ public static final String PORTLET_CONTAINER = "PORTLET_CONTAINER";
/** . */
private PortletApplicationRegistry registry;
@@ -82,8 +82,7 @@
portletInvocation.setHandler(null);
//
- ContainerPortletInfo info = (ContainerPortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
- PortletContainer container = info.getContainer();
+ PortletContainer container = (PortletContainer)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER);
return container.dispatch(portletInvocation);
}
finally
@@ -184,9 +183,10 @@
public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException, InvocationException
{
+ // Get portlet container
PortletContext ctx = invocation.getTarget();
- Portlet portlet = getPortlet(ctx);
- ContainerPortletInfo info = (ContainerPortletInfo)portlet.getInfo();
+ PortletImpl portlet = (PortletImpl)getPortlet(ctx);
+ PortletContainer container = portlet.container;
//
InvocationHandler prevHandler = invocation.getHandler();
@@ -194,7 +194,7 @@
{
invocation.setHandler(handler);
- invocation.setAttribute(PortletInvocation.INVOCATION_SCOPE, PORTLET_CONTAINER_INFO, info);
+ invocation.setAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER, container);
return (PortletInvocationResponse)invocation.invoke(stackFactory.getInterceptorStack());
}
catch (Exception e)
@@ -215,7 +215,7 @@
finally
{
invocation.setHandler(prevHandler);
- invocation.removeAttribute(PortletInvocation.INVOCATION_SCOPE, PORTLET_CONTAINER_INFO);
+ invocation.removeAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER);
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -22,7 +22,8 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.container;
-import org.jboss.portal.portlet.impl.jsr168.APIFactory;
+import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory;
+import org.jboss.portal.portlet.impl.jsr168.spi.PortletInfoFactory;
import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
import org.jboss.portal.portlet.impl.jsr168.metadata.PortletApplicationMetaData;
@@ -45,39 +46,44 @@
{
/** . */
- private PortletApplicationRegistry registry;
+ private final PortletAPIFactory portletAPIFactory;
/** . */
- private APIFactory apiFactory;
+ private final PortletInfoFactory portletInfoFactory;
/** . */
- private PortletApplicationMetaData portletAppMD;
+ private final PortletApplicationMetaData portletAppMD;
/** . */
- private JBossApplicationMetaData jbossAppMD;
+ private final JBossApplicationMetaData jbossAppMD;
/** . */
- private PortletApplicationImpl portletApp;
+ private final ServletContext servletContext;
/** . */
- private ServletContext servletContext;
+ private final ClassLoader classLoader;
/** . */
- private ClassLoader classLoader;
+ private PortletApplicationImpl portletApp;
/** . */
+ private PortletApplicationRegistry registry;
+
+ /** . */
private PortletApplicationRegistrationContext registrationContext;
public PortletApplicationContextImpl(
PortletApplicationRegistry registry,
- APIFactory apiFactory,
+ PortletAPIFactory portletAPIFactory,
+ PortletInfoFactory portletInfoFactory,
PortletApplicationMetaData portletAppMD,
JBossApplicationMetaData jbossAppMD,
ServletContext servletContext,
ClassLoader classLoader)
{
this.registry = registry;
- this.apiFactory = apiFactory;
+ this.portletAPIFactory = portletAPIFactory;
+ this.portletInfoFactory = portletInfoFactory;
this.portletAppMD = portletAppMD;
this.jbossAppMD = jbossAppMD;
this.servletContext = servletContext;
@@ -93,7 +99,7 @@
public void startPortletApplication() throws Exception
{
- portletApp = new PortletApplicationImpl(portletAppMD, jbossAppMD, this, apiFactory);
+ portletApp = new PortletApplicationImpl(portletAppMD, jbossAppMD, this, portletAPIFactory, portletInfoFactory);
portletApp.start();
//
Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/APIFactory.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/APIFactory.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/APIFactory.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -1,53 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.impl.jsr168;
-
-import org.jboss.portal.portlet.invocation.ActionInvocation;
-import org.jboss.portal.portlet.invocation.RenderInvocation;
-import org.jboss.portal.portlet.impl.jsr168.api.RenderRequestImpl;
-import org.jboss.portal.portlet.impl.jsr168.api.ActionRequestImpl;
-import org.jboss.portal.portlet.impl.jsr168.api.ActionResponseImpl;
-import org.jboss.portal.portlet.impl.jsr168.api.RenderResponseImpl;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public interface APIFactory
-{
- /**
- */
- ActionRequestImpl createActionRequest(ActionInvocation invocation);
-
- /**
- */
- ActionResponseImpl createActionResponse(ActionInvocation invocation, ActionRequestImpl actionRequest);
-
- /**
- */
- RenderRequestImpl createRenderRequest(RenderInvocation invocation);
-
- /**
- */
- RenderResponseImpl createRenderResponse(RenderInvocation invocation, RenderRequestImpl renderRequest);
-}
Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/APIFactoryImpl.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/APIFactoryImpl.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/APIFactoryImpl.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -1,57 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.impl.jsr168;
-
-import org.jboss.portal.portlet.invocation.ActionInvocation;
-import org.jboss.portal.portlet.invocation.RenderInvocation;
-import org.jboss.portal.portlet.impl.jsr168.api.ActionResponseImpl;
-import org.jboss.portal.portlet.impl.jsr168.api.ActionRequestImpl;
-import org.jboss.portal.portlet.impl.jsr168.api.RenderRequestImpl;
-import org.jboss.portal.portlet.impl.jsr168.api.RenderResponseImpl;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class APIFactoryImpl implements APIFactory
-{
- public ActionRequestImpl createActionRequest(ActionInvocation invocation)
- {
- return new ActionRequestImpl(invocation);
- }
-
- public ActionResponseImpl createActionResponse(ActionInvocation invocation, ActionRequestImpl actionRequest)
- {
- return new ActionResponseImpl(invocation, actionRequest);
- }
-
- public RenderRequestImpl createRenderRequest(RenderInvocation invocation)
- {
- return new RenderRequestImpl(invocation);
- }
-
- public RenderResponseImpl createRenderResponse(RenderInvocation invocation, RenderRequestImpl renderRequest)
- {
- return new RenderResponseImpl(invocation, renderRequest);
- }
-}
Copied: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletAPIFactoryImpl.java (from rev 7199, trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/APIFactoryImpl.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletAPIFactoryImpl.java (rev 0)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletAPIFactoryImpl.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.jsr168;
+
+import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.invocation.RenderInvocation;
+import org.jboss.portal.portlet.impl.jsr168.api.ActionResponseImpl;
+import org.jboss.portal.portlet.impl.jsr168.api.ActionRequestImpl;
+import org.jboss.portal.portlet.impl.jsr168.api.RenderRequestImpl;
+import org.jboss.portal.portlet.impl.jsr168.api.RenderResponseImpl;
+import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class PortletAPIFactoryImpl implements PortletAPIFactory
+{
+ public ActionRequestImpl createActionRequest(ActionInvocation invocation)
+ {
+ return new ActionRequestImpl(invocation);
+ }
+
+ public ActionResponseImpl createActionResponse(ActionInvocation invocation, ActionRequestImpl actionRequest)
+ {
+ return new ActionResponseImpl(invocation, actionRequest);
+ }
+
+ public RenderRequestImpl createRenderRequest(RenderInvocation invocation)
+ {
+ return new RenderRequestImpl(invocation);
+ }
+
+ public RenderResponseImpl createRenderResponse(RenderInvocation invocation, RenderRequestImpl renderRequest)
+ {
+ return new RenderResponseImpl(invocation, renderRequest);
+ }
+}
Property changes on: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletAPIFactoryImpl.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -24,6 +24,8 @@
import org.jboss.portal.portlet.impl.jsr168.api.PortletContextImpl;
import org.jboss.portal.portlet.impl.jsr168.metadata.PortletApplicationMetaData;
+import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory;
+import org.jboss.portal.portlet.impl.jsr168.spi.PortletInfoFactory;
import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
import org.jboss.portal.portlet.container.PortletApplication;
import org.jboss.portal.portlet.container.PortletApplicationContext;
@@ -43,18 +45,24 @@
{
/** . */
- protected LinkedHashMap portlets;
+ protected final PortletApplicationMetaData metaData;
/** . */
- protected PortletApplicationMetaData metaData;
+ protected final JBossApplicationMetaData jbossMetaData;
/** . */
- protected JBossApplicationMetaData jbossMetaData;
+ protected final PortletApplicationContext context;
/** . */
- protected PortletApplicationContext context;
+ protected final PortletAPIFactory portletAPIFactory;
/** . */
+ protected final PortletInfoFactory portletInfoFactory;
+
+ /** . */
+ protected LinkedHashMap portlets;
+
+ /** . */
protected PortletContext portletContext;
/** . */
@@ -66,18 +74,17 @@
/** . */
protected Map windowStates;
- /** . */
- protected APIFactory apiFactory;
-
public PortletApplicationImpl(
PortletApplicationMetaData metaData,
JBossApplicationMetaData jbossMetaData,
PortletApplicationContext context,
- APIFactory apiFactory)
+ PortletAPIFactory portletAPIFactory,
+ PortletInfoFactory portletInfoFactory)
{
this.metaData = metaData;
this.jbossMetaData = jbossMetaData;
- this.apiFactory = apiFactory;
+ this.portletAPIFactory = portletAPIFactory;
+ this.portletInfoFactory = portletInfoFactory;
this.portlets = new LinkedHashMap();
this.context = context;
}
@@ -87,11 +94,16 @@
return metaData.getId();
}
- public APIFactory getAPIFactory()
+ public PortletAPIFactory getPortletAPIFactory()
{
- return apiFactory;
+ return portletAPIFactory;
}
+ public PortletInfoFactory getPortletInfoFactory()
+ {
+ return portletInfoFactory;
+ }
+
public PortletApplicationMetaData getMetaData()
{
return metaData;
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -28,16 +28,14 @@
import org.jboss.portal.portlet.impl.jsr168.api.RenderResponseImpl;
import org.jboss.portal.portlet.impl.jsr168.api.RenderRequestImpl;
import org.jboss.portal.portlet.impl.jsr168.api.ActionRequestImpl;
-import org.jboss.portal.portlet.impl.jsr168.PortletResourceBundleFactory;
import org.jboss.portal.portlet.container.PortletInitializationException;
import org.jboss.portal.portlet.container.PortletApplication;
import org.jboss.portal.portlet.container.PortletContainer;
-import org.jboss.portal.portlet.impl.jsr168.info.ContentTypes;
-import org.jboss.portal.portlet.impl.jsr168.info.ContainerPortletInfo;
import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
import org.jboss.portal.portlet.impl.jsr168.metadata.PortletPreferencesMetaData;
import org.jboss.portal.portlet.impl.jsr168.metadata.SecurityRoleRefMetaData;
import org.jboss.portal.portlet.impl.jsr168.metadata.ParameterMetaData;
+import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory;
import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
@@ -95,12 +93,6 @@
/** The portlet instance. */
protected Portlet portlet;
- /** . */
- protected ContentTypes contentTypes;
-
- /** . */
- protected ResourceBundleManager bundleMgr;
-
/** The invocation valve. */
protected final Valve valve;
@@ -217,24 +209,19 @@
initParameters.put(parameterMD.getName(), parameterMD.getValue());
}
- // Portlet config object
+ // Resource bundle manager
ResourceBundleManager bundleMgr = PortletResourceBundleFactory.createResourceBundleManager(application.getContext().getClassLoader(), metaData.getLanguages());
- //
+ // Portlet config object
PortletConfig config = new PortletConfigImpl(
metaData.getName(),
application.getPortletContext(),
initParameters,
bundleMgr);
- //
- ContentTypes contentTypes = new ContentTypes();
- contentTypes.setMetadata(metaData.getContentTypes());
- contentTypes.start();
+ // Create meta data
+ PortletInfo info = application.getPortletInfoFactory().createPortletInfo(metaData, jbossMetaData, bundleMgr);
- //
- PortletInfo info = new ContainerPortletInfo(this, bundleMgr, contentTypes);
-
// Finally initialize the porlet instance
try
{
@@ -250,8 +237,6 @@
this.portlet = portlet;
this.config = config;
this.securityRoleRefsMap = Collections.unmodifiableMap(securityRoleRefsMap);
- this.contentTypes = contentTypes;
- this.bundleMgr = bundleMgr;
this.info = info;
this.started = true;
@@ -306,16 +291,12 @@
// Destroy the portlet object
destroyPortlet(portlet);
- // Stop the plugins (static)
- contentTypes.stop();
-
// Update state
preferencesValidator = null;
className = null;
portlet = null;
securityRoleRefsMap = null;
config = null;
- contentTypes = null;
userDataConstraints = null;
info = null;
}
@@ -331,11 +312,6 @@
return portlet;
}
- public ContentTypes getContentTypes()
- {
- return contentTypes;
- }
-
public Map getSecurityRoleRefsMap()
{
return securityRoleRefsMap;
@@ -469,7 +445,7 @@
protected PortletInvocationResponse invokeAction(ActionInvocation invocation) throws IOException, PortletException
{
- APIFactory factory = application.getAPIFactory();
+ PortletAPIFactory factory = application.getPortletAPIFactory();
ActionRequestImpl areq = factory.createActionRequest(invocation);
ActionResponseImpl aresp = factory.createActionResponse(invocation, areq);
HttpServletRequest dreq = invocation.getDispatchedRequest();
@@ -494,7 +470,7 @@
protected PortletInvocationResponse invokeRender(RenderInvocation invocation) throws IOException, PortletException
{
- APIFactory factory = application.getAPIFactory();
+ PortletAPIFactory factory = application.getPortletAPIFactory();
RenderRequestImpl rreq = factory.createRenderRequest(invocation);
RenderResponseImpl rresp = factory.createRenderResponse(invocation, rreq);
HttpServletRequest dreq = invocation.getDispatchedRequest();
@@ -513,9 +489,6 @@
dreq.removeAttribute(APIConstants.JAVAX_PORTLET_RESPONSE);
dreq.removeAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_INVOCATION);
}
-
return rresp.getResult();
}
-
-
}
Added: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletInfoFactoryImpl.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletInfoFactoryImpl.java (rev 0)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletInfoFactoryImpl.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.jsr168;
+
+import org.jboss.portal.portlet.impl.jsr168.spi.PortletInfoFactory;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
+import org.jboss.portal.portlet.impl.jsr168.info.ContainerPortletInfo;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
+import org.jboss.portal.common.i18n.ResourceBundleManager;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletInfoFactoryImpl implements PortletInfoFactory
+{
+ public PortletInfo createPortletInfo(PortletMetaData portletMD, JBossPortletMetaData jbossPortletMD, ResourceBundleManager resourceBundleManager)
+ {
+ return new ContainerPortletInfo(portletMD, jbossPortletMD, resourceBundleManager);
+ }
+}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -26,14 +26,11 @@
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.portlet.PortletParameters;
import org.jboss.portal.portlet.container.PortletContainerInvoker;
-import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
import org.jboss.portal.portlet.impl.jsr168.PortletUtils;
import org.jboss.portal.portlet.impl.jsr168.PortletRequestAttributes;
import org.jboss.portal.portlet.impl.jsr168.info.ContainerPreferencesInfo;
-import org.jboss.portal.portlet.impl.jsr168.info.ContainerPortletInfo;
-import org.jboss.portal.portlet.impl.jsr168.info.ContentTypes;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.spi.RequestContext;
@@ -81,7 +78,6 @@
protected InstanceContext instanceContext;
protected PortletPreferences preferences;
protected PortletContainerImpl container;
- protected ContentTypes contentTypes;
protected HttpServletRequest dreq;
protected PortalContext portalContext;
protected PortletSessionImpl psession;
@@ -101,8 +97,7 @@
this.securityContext = invocation.getSecurityContext();
this.requestContext = invocation.getRequestContext();
this.instanceContext = invocation.getInstanceContext();
- this.container = (PortletContainerImpl)((ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
- this.contentTypes = container.getContentTypes();
+ this.container = (PortletContainerImpl)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER);
this.dreq = invocation.getDispatchedRequest();
this.portalContext = new PortalContextImpl(invocation.getPortalContext());
this.parameters = null;
@@ -306,7 +301,7 @@
public boolean isUserInRole(String roleName)
{
// Get the map role name to role link
- Map securityRoleRefsMap = ((PortletContainerImpl)((ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer()).getSecurityRoleRefsMap();
+ Map securityRoleRefsMap = container.getSecurityRoleRefsMap();
// Process the role link
String roleLink = (String)securityRoleRefsMap.get(roleName);
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerCapabilities.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerCapabilities.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerCapabilities.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -24,13 +24,14 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
-import org.jboss.portal.common.i18n.ResourceBundleManager;
import org.jboss.portal.portlet.info.CapabilitiesInfo;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
+import java.util.Locale;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -49,15 +50,29 @@
WINDOW_STATES = Collections.unmodifiableSet(WINDOW_STATES);
}
+ /** . */
private Set supportedLocales;
+
+ /** . */
private ContentTypes contentTypes;
- private ResourceBundleManager bundleMgr;
- public ContainerCapabilities(Set supportedLocales, ResourceBundleManager bundleMgr, ContentTypes contentTypes)
+ public ContainerCapabilities(PortletMetaData portletMD)
{
+ ContentTypes contentTypes = new ContentTypes();
+ contentTypes.setMetadata(portletMD.getContentTypes());
+ contentTypes.start();
+
+ // Add Locale.ENGLISH to supported locales if no locales was provided
+ // todo: should we always include it (i.e. even when other locales are present)?
+ HashSet supportedLocales = new HashSet(portletMD.getLanguages().getSupportedLocales());
+ if (supportedLocales.isEmpty())
+ {
+ supportedLocales.add(Locale.ENGLISH);
+ }
+
+ //
this.supportedLocales = supportedLocales;
this.contentTypes = contentTypes;
- this.bundleMgr = bundleMgr;
}
public Set getMimeTypes()
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPortletInfo.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPortletInfo.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPortletInfo.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -22,9 +22,6 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.jsr168.info;
-import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
-import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
-import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
import org.jboss.portal.portlet.info.CacheInfo;
import org.jboss.portal.portlet.info.CapabilitiesInfo;
@@ -33,13 +30,9 @@
import org.jboss.portal.portlet.info.PreferencesInfo;
import org.jboss.portal.portlet.info.SecurityInfo;
import org.jboss.portal.portlet.info.SessionInfo;
-import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
import org.jboss.portal.common.i18n.ResourceBundleManager;
-import java.util.HashSet;
-import java.util.Locale;
-
/**
* For now implementation that use the portlet container directly.
*
@@ -50,7 +43,6 @@
public class ContainerPortletInfo implements PortletInfo
{
- private PortletContainer container;
private ContainerCapabilities capabilities;
private ContainerPreferencesInfo preferences;
private ContainerMetaInfo meta;
@@ -60,49 +52,19 @@
private Boolean remotable;
public ContainerPortletInfo(
- PortletContainerImpl container,
- ResourceBundleManager bundleMgr,
- ContentTypes contentTypes)
+ PortletMetaData portletMD,
+ JBossPortletMetaData jbossPortletMD,
+ ResourceBundleManager bundleMgr)
{
- PortletMetaData portletMD = container.getMetaData();
- JBossPortletMetaData jbossPortletMD = container.getJBossMetaData();
- PortletApplicationImpl pwa = (PortletApplicationImpl)container.getApplication();
- JBossApplicationMetaData jbossAppMD = pwa.getJBossMetaData();
-
- //
- this.container = container;
-
- // Add Locale.ENGLISH to supported locales if no locales was provided
- // todo: should we always include it (i.e. even when other locales are present)?
- HashSet supportedLocales = new HashSet(container.getMetaData().getLanguages().getSupportedLocales());
- if (supportedLocales.isEmpty())
- {
- supportedLocales.add(Locale.ENGLISH);
- }
-
- this.capabilities = new ContainerCapabilities(supportedLocales, bundleMgr, contentTypes);
+ this.capabilities = new ContainerCapabilities(portletMD);
this.preferences = portletMD.getPreferences() != null ? new ContainerPreferencesInfo(portletMD, bundleMgr) : new ContainerPreferencesInfo();
this.meta = new ContainerMetaInfo(portletMD, bundleMgr);
this.security = new ContainerSecurityInfo(portletMD);
this.cache = new ContainerCacheInfo(portletMD, jbossPortletMD);
- this.session = new ContainerSessionInfo(container);
-
- if (jbossPortletMD != null)
- {
- this.remotable = jbossPortletMD.getRemotable();
- }
- if (this.remotable == null && jbossAppMD != null)
- {
- this.remotable = jbossAppMD.getRemotable();
- }
-
+ this.session = new ContainerSessionInfo(jbossPortletMD);
+ this.remotable = jbossPortletMD.getRemotable() != null ? jbossPortletMD.getRemotable() : Boolean.FALSE;
}
- public PortletContainer getContainer()
- {
- return container;
- }
-
public CapabilitiesInfo getCapabilities()
{
return capabilities;
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerSessionInfo.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerSessionInfo.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerSessionInfo.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -35,9 +35,8 @@
private Boolean distributed;
- ContainerSessionInfo(PortletContainer portletContainer)
+ ContainerSessionInfo(JBossPortletMetaData md)
{
- JBossPortletMetaData md = portletContainer.getJBossMetaData();
if (md != null)
{
distributed = md.getDistributed();
Copied: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletAPIFactory.java (from rev 7199, trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/APIFactory.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletAPIFactory.java (rev 0)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletAPIFactory.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.jsr168.spi;
+
+import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.invocation.RenderInvocation;
+import org.jboss.portal.portlet.impl.jsr168.api.RenderRequestImpl;
+import org.jboss.portal.portlet.impl.jsr168.api.ActionRequestImpl;
+import org.jboss.portal.portlet.impl.jsr168.api.ActionResponseImpl;
+import org.jboss.portal.portlet.impl.jsr168.api.RenderResponseImpl;
+
+/**
+ * Factory for portlet API implementation.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public interface PortletAPIFactory
+{
+ /**
+ */
+ ActionRequestImpl createActionRequest(ActionInvocation invocation);
+
+ /**
+ */
+ ActionResponseImpl createActionResponse(ActionInvocation invocation, ActionRequestImpl actionRequest);
+
+ /**
+ */
+ RenderRequestImpl createRenderRequest(RenderInvocation invocation);
+
+ /**
+ */
+ RenderResponseImpl createRenderResponse(RenderInvocation invocation, RenderRequestImpl renderRequest);
+}
Property changes on: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletAPIFactory.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletInfoFactory.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletInfoFactory.java (rev 0)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletInfoFactory.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -0,0 +1,51 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.jsr168.spi;
+
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
+import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
+import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
+import org.jboss.portal.common.i18n.ResourceBundleManager;
+
+/**
+ * Enables the creation of custom portlet info implementations.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface PortletInfoFactory
+{
+ /**
+ * Create a new portlet info from the provided meta data.
+ *
+ * @param portletMD the portlet meta data
+ * @param jbossPortletMD
+ * @param resourceBundleManager the resource bundle manager
+ * @return the runtime portlet meta data
+ */
+ PortletInfo createPortletInfo(
+ PortletMetaData portletMD,
+ JBossPortletMetaData jbossPortletMD,
+ ResourceBundleManager resourceBundleManager);
+}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/metadata/JBossPortletMetaData.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/metadata/JBossPortletMetaData.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/metadata/JBossPortletMetaData.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -25,17 +25,30 @@
import org.jboss.portal.common.transaction.Transactions;
/**
+ * Specific metadata specified to jboss portlet container.
+ *
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
public class JBossPortletMetaData implements Cloneable
{
+ /** . */
private String name;
+
+ /** . */
private Boolean remotable;
+
+ /** . */
private SecurityConstraintMetaData securityConstraint;
+
+ /** . */
private Integer cacheRefType;
+
+ /** . */
private Transactions.Type txType;
+
+ /** . */
private Boolean distributed;
public String getName()
@@ -98,6 +111,9 @@
this.txType = txType;
}
+ /**
+ * Merge the current meta data with portlet application.
+ */
public void merge(JBossApplicationMetaData application)
{
if (remotable == null)
@@ -106,6 +122,9 @@
}
}
+ /**
+ * Merge the current meta data with a specified one.
+ */
public void merge(JBossPortletMetaData portlet)
{
if (remotable == null)
Modified: trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java
===================================================================
--- trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -141,7 +141,8 @@
{
portletApplicationContext = new PortletApplicationContextImpl(
factory.getWebAppRegistry(),
- factory.getAPIFactory(),
+ factory.getPortletAPIFactory(),
+ factory.getPortletInfoFactory(),
portletAppMD,
jbossAppMD,
pwa.getServletContext(),
Modified: trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeploymentFactory.java
===================================================================
--- trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeploymentFactory.java 2007-05-08 23:08:48 UTC (rev 7225)
+++ trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeploymentFactory.java 2007-05-09 09:27:25 UTC (rev 7226)
@@ -27,8 +27,10 @@
import org.jboss.portal.portlet.container.PortletApplicationRegistry;
import org.jboss.portal.portlet.deployment.JBossApplicationMetaDataFactory;
import org.jboss.portal.portlet.deployment.ValueTrimmingFilter;
-import org.jboss.portal.portlet.impl.jsr168.APIFactory;
-import org.jboss.portal.portlet.impl.jsr168.APIFactoryImpl;
+import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory;
+import org.jboss.portal.portlet.impl.jsr168.spi.PortletInfoFactory;
+import org.jboss.portal.portlet.impl.jsr168.PortletAPIFactoryImpl;
+import org.jboss.portal.portlet.impl.jsr168.PortletInfoFactoryImpl;
import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
import org.jboss.portal.portlet.security.PortletSecurityService;
import org.jboss.portal.server.config.ServerConfig;
@@ -64,12 +66,15 @@
protected ServerConfig config;
/** . */
- protected String apiFactoryClassName;
+ protected String portletAPIFactoryClassName;
/** . */
- protected APIFactory apiFactory;
+ protected String portletInfoFactoryClassName;
/** . */
+ protected PortletAPIFactory portletAPIFactory;
+
+ /** . */
protected PortletSecurityService portletSecurityService;
/** . */
@@ -81,6 +86,9 @@
/** . */
protected EntityResolver jbossPortletEntityResolver;
+ /** . */
+ protected PortletInfoFactory portletInfoFactory;
+
public EntityResolver getJBossPortletEntityResolver()
{
return jbossPortletEntityResolver;
@@ -101,16 +109,26 @@
this.config = config;
}
- public String getAPIFactoryClassName()
+ public String getPortletAPIFactoryClassName()
{
- return apiFactoryClassName;
+ return portletAPIFactoryClassName;
}
- public void setAPIFactoryClassName(String apiFactoryClassName)
+ public void setPortletAPIFactoryClassName(String apiFactoryClassName)
{
- this.apiFactoryClassName = apiFactoryClassName;
+ this.portletAPIFactoryClassName = apiFactoryClassName;
}
+ public String getPortletInfoFactoryClassName()
+ {
+ return portletInfoFactoryClassName;
+ }
+
+ public void setPortletInfoFactoryClassName(String portletInfoFactoryClassName)
+ {
+ this.portletInfoFactoryClassName = portletInfoFactoryClassName;
+ }
+
public PortletApplicationRegistry getWebAppRegistry()
{
return portletApplicationRegistry;
@@ -136,11 +154,16 @@
return standardJBossApplicationMetaData;
}
- public APIFactory getAPIFactory()
+ public PortletAPIFactory getPortletAPIFactory()
{
- return apiFactory;
+ return portletAPIFactory;
}
+ public PortletInfoFactory getPortletInfoFactory()
+ {
+ return portletInfoFactory;
+ }
+
public boolean acceptFile(URL url)
{
String urlAsFile = url.getFile();
@@ -158,21 +181,38 @@
//
try
{
- apiFactory = new APIFactoryImpl();
+ portletAPIFactory = new PortletAPIFactoryImpl();
// Try to load
- if (apiFactoryClassName != null)
+ if (portletAPIFactoryClassName != null)
{
- Class apiFactoryClass = Thread.currentThread().getContextClassLoader().loadClass(apiFactoryClassName);
- apiFactory = (APIFactory)apiFactoryClass.newInstance();
+ Class portletAPIFactoryClass = Thread.currentThread().getContextClassLoader().loadClass(portletAPIFactoryClassName);
+ portletAPIFactory = (PortletAPIFactory)portletAPIFactoryClass.newInstance();
}
}
catch (Exception e)
{
- log.error("Cannot create portlet APIFactory=" + apiFactoryClassName + " will use default one instead", e);
+ log.error("Cannot create portlet PortletAPIFactory=" + portletAPIFactoryClassName + " will use default one instead", e);
}
//
+ try
+ {
+ portletInfoFactory = new PortletInfoFactoryImpl();
+
+ // Try to load
+ if (portletInfoFactoryClassName != null)
+ {
+ Class portletInfoFactoryClass = Thread.currentThread().getContextClassLoader().loadClass(portletInfoFactoryClassName);
+ portletInfoFactory = (PortletInfoFactory)portletInfoFactoryClass.newInstance();
+ }
+ }
+ catch (Exception e)
+ {
+ log.error("Cannot create portlet PortletAPIFactory=" + portletAPIFactoryClassName + " will use default one instead", e);
+ }
+
+ //
loadStandardJBossApplicationMetaData();
//
@@ -210,7 +250,7 @@
super.stop();
//
- apiFactory = null;
+ portletAPIFactory = null;
}
public PortletSecurityService getPortletSecurityService()
18 years, 12 months
JBoss Portal SVN: r7225 - trunk/wsrp/src/main/org/jboss/portal/wsrp/servlet.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-05-08 19:08:48 -0400 (Tue, 08 May 2007)
New Revision: 7225
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/servlet/WSDLPortFixFilter.java
Log:
- JBPORTAL-1390: Use ThreadLocal for a better (correct!) cache handling.
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/servlet/WSDLPortFixFilter.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/servlet/WSDLPortFixFilter.java 2007-05-08 22:58:55 UTC (rev 7224)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/servlet/WSDLPortFixFilter.java 2007-05-08 23:08:48 UTC (rev 7225)
@@ -54,8 +54,7 @@
*/
public class WSDLPortFixFilter implements Filter
{
- private String processedWSDL;
- private StringWriter cachedWriter;
+ private static final ThreadLocal local = new ThreadLocal();
public void init(FilterConfig filterConfig) throws ServletException
{
@@ -87,21 +86,22 @@
}
// create the processed wsdl if required and cache the value
- synchronized (this)
+ CachedDataHolder holder = (CachedDataHolder)local.get();
+ if (holder == null)
{
- if (processedWSDL == null)
- {
- processedWSDL = replaceURLsBy(wsdl, new PortReplacementGenerator(req.getServerPort()));
- cachedWriter = new StringWriter(processedWSDL.length());
- cachedWriter.write(processedWSDL);
- }
+ holder = new CachedDataHolder();
+ holder.processedWSDL = replaceURLsBy(wsdl, new PortReplacementGenerator(req.getServerPort()));
+ StringWriter cachedWriter = new StringWriter(holder.processedWSDL.length());
+ cachedWriter.write(holder.processedWSDL);
+ holder.cachedWriter = cachedWriter;
+ local.set(holder);
}
resp.setContentType("text/xml");
- resp.setContentLength(cachedWriter.toString().length());
+ resp.setContentLength(holder.cachedWriter.toString().length());
- resp.getWriter().print(cachedWriter.toString());
+ resp.getWriter().print(holder.cachedWriter.toString());
}
else
{
@@ -183,6 +183,12 @@
}
}
+ private class CachedDataHolder
+ {
+ private String processedWSDL;
+ private StringWriter cachedWriter;
+ }
+
// === Code duplicated from URLTools for easier inclusion === //
private static final Pattern LINK = Pattern.compile("(?:location)\\s*=\\s*('|\")\\s*([^'\"]*)\\s*('|\")",
18 years, 12 months
JBoss Portal SVN: r7224 - trunk/wsrp/src/main/org/jboss/portal/wsrp/services.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-05-08 18:58:55 -0400 (Tue, 08 May 2007)
New Revision: 7224
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java
Log:
- Increased time out to 10 seconds.
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java 2007-05-08 22:44:23 UTC (rev 7223)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java 2007-05-08 22:58:55 UTC (rev 7224)
@@ -193,6 +193,7 @@
private URL wsdlURL;
private String latestImportURI;
private final Logger log = Logger.getLogger(getClass());
+ private static final int TIME_OUT_MS = 10000;
public WSDLLocatorImpl(URL wsdlFile)
{
@@ -209,7 +210,7 @@
thread.start();
// Wait for the thread to finish but don't wait longer than the specified time
- long delayMillis = 5000;
+ long delayMillis = TIME_OUT_MS;
try
{
thread.join(delayMillis);
18 years, 12 months
JBoss Portal SVN: r7223 - docs/trunk/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-05-08 18:44:23 -0400 (Tue, 08 May 2007)
New Revision: 7223
Modified:
docs/trunk/referenceGuide/en/modules/configuration.xml
Log:
- Updated with correct Tomcat version.
Modified: docs/trunk/referenceGuide/en/modules/configuration.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/configuration.xml 2007-05-08 17:07:07 UTC (rev 7222)
+++ docs/trunk/referenceGuide/en/modules/configuration.xml 2007-05-08 22:44:23 UTC (rev 7223)
@@ -29,7 +29,7 @@
number manually.
</para>
<para>To change it, you need to edit the file
- <literal>$JBOSS_HOME/server/default/deploy/jbossweb-tomcat50.sar/server.xml</literal>
+ <literal>$JBOSS_HOME/server/default/deploy/jbossweb-tomcat55.sar/server.xml</literal>
and change the port value of the HTTP Connector. You can also change the value of the SSL
port, by default it is set to 8443. Remember to uncomment the following when you have
configured it:
18 years, 12 months
JBoss Portal SVN: r7222 - trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-05-08 13:07:07 -0400 (Tue, 08 May 2007)
New Revision: 7222
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
Log:
- JBPORTAL-715: fixed incorrect showing of modifyRegistration
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-05-08 05:38:51 UTC (rev 7221)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-05-08 17:07:07 UTC (rev 7222)
@@ -713,7 +713,9 @@
public void modifyRegistration() throws PortletInvokerException
{
- if (isRegistered())
+ Boolean consistentWithExpectations = persistentRegistrationInfo.isConsistentWithProducerExpectations();
+ if (persistentRegistrationInfo != null && persistentRegistrationInfo.getRegistrationHandle() != null
+ && consistentWithExpectations != null && !consistentWithExpectations.booleanValue())
{
try
{
18 years, 12 months
JBoss Portal SVN: r7221 - in trunk/wsrp/src: main/org/jboss/portal/wsrp/admin/ui and 3 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-05-08 01:38:51 -0400 (Tue, 08 May 2007)
New Revision: 7221
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml
Log:
- Fixed incorrect mapping of registration properties which wouldn't be properly updated when the parent RegistrationInfo was modified.
- JBPORTAL-715: more work on modifyRegistration (detection of when calling modifyRegistration is not properly done yet).
- Added RegistrationInfo.isConsistentWithProducerExpectations and improved computing of whether a Registration is valid or not (replaced incorrect state).
- ServiceDescription is now computed on each request in ProducerInfo since it wasn't worth maintaining a state for it.
- Added more test cases.
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java 2007-05-07 14:44:07 UTC (rev 7220)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java 2007-05-08 05:38:51 UTC (rev 7221)
@@ -26,12 +26,15 @@
import junit.framework.TestCase;
import org.jboss.portal.wsrp.WSRPConstants;
import org.jboss.portal.wsrp.WSRPTypeFactory;
+import org.jboss.portal.wsrp.consumer.RefreshResult;
import org.jboss.portal.wsrp.consumer.RegistrationInfo;
import org.jboss.portal.wsrp.consumer.RegistrationProperty;
import org.jboss.portal.wsrp.core.PropertyDescription;
+import org.jboss.portal.wsrp.core.RegistrationContext;
import org.jboss.portal.wsrp.core.ServiceDescription;
import java.util.Map;
+import java.util.Set;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
@@ -56,12 +59,40 @@
assertNotNull(info.getRegistrationData());
assertNull(info.getRegistrationHandle());
assertNull(info.getRegistrationState());
+
+ // before refresh, refresh is needed...
+ assertTrue(info.isRefreshNeeded());
+ // we don't know if the the local info is consistent with the producer expectations...
+ assertNull(info.isConsistentWithProducerExpectations());
+ // we don't know if the registration is required...
+ assertNull(info.isRegistrationRequired());
+ // and we don't know if the registration is valid
+ assertNull(info.isRegistrationValid());
+
+ try
+ {
+ info.isRegistrationDeterminedNotRequired();
+ fail("refresh hasn't been called, isRegistrationDeterminedNotRequired should fail");
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+
+ try
+ {
+ info.isRegistrationDeterminedRequired();
+ fail("refresh hasn't been called, isRegistrationDeterminedRequired should fail");
+ }
+ catch (IllegalStateException expected)
+ {
+ }
}
- /*public void testSetGetRegistrationProperty()
+ public void testSetGetRegistrationProperty()
{
String key = "foo";
info.setRegistrationPropertyValue(key, "bar");
+ assertNull(info.isConsistentWithProducerExpectations());
Map properties = info.getRegistrationProperties();
assertFalse(properties.isEmpty());
Set names = info.getRegistrationPropertyNames();
@@ -71,37 +102,36 @@
assertNotNull(properties.get(key));
assertEquals(properties.get(key), info.getRegistrationProperty(key));
assertEquals("bar", info.getRegistrationProperty(key).getValue());
- }*/
+ }
public void testRefreshNoRegistration()
{
- // before refresh registration status is undetermined
- assertNull(info.isRegistrationRequired());
- assertFalse(info.isRegistrationValid());
-
+ // no registration expected
ServiceDescription sd = createServiceDescription(false, 0);
- RegistrationInfo.RegistrationRefreshResult result = info.refresh(sd, producerId, true, false);
+ RefreshResult result = info.refresh(sd, producerId, true, false);
assertNotNull(result);
assertFalse(result.hasIssues());
+ assertTrue(info.isConsistentWithProducerExpectations().booleanValue());
assertFalse(info.isRegistrationRequired().booleanValue());
assertTrue(info.isRegistrationDeterminedNotRequired());
assertFalse(info.isRegistrationDeterminedRequired());
- assertTrue(info.isRegistrationValid());
+ assertTrue(info.isRegistrationValid().booleanValue());
result = info.refresh(sd, producerId, false, false);
assertNotNull(result);
assertFalse(result.hasIssues());
+ assertTrue(info.isConsistentWithProducerExpectations().booleanValue());
assertFalse(info.isRegistrationRequired().booleanValue());
assertTrue(info.isRegistrationDeterminedNotRequired());
assertFalse(info.isRegistrationDeterminedRequired());
- assertTrue(info.isRegistrationValid());
+ assertTrue(info.isRegistrationValid().booleanValue());
}
public void testRefreshRegistrationDefaultRegistrationNoLocalInfo()
{
// before refresh registration status is undetermined
assertNull(info.isRegistrationRequired());
- assertFalse(info.isRegistrationValid());
+ assertNull(info.isRegistrationValid());
RegistrationInfo.RegistrationRefreshResult result = info.refresh(
createServiceDescription(true, 0), producerId, true, false);
@@ -110,7 +140,7 @@
assertTrue(info.isRegistrationRequired().booleanValue());
assertTrue(info.isRegistrationDeterminedRequired());
assertFalse(info.isRegistrationDeterminedNotRequired());
- assertFalse(info.isRegistrationValid());
+ assertFalse(info.isRegistrationValid().booleanValue());
}
public void testRefreshRegistrationDefaultRegistrationExtraLocalInfo()
@@ -189,34 +219,53 @@
public void testForceRefreshRegistration()
{
- RegistrationInfo.RegistrationRefreshResult result = info.refresh(
- createServiceDescription(true, 0), producerId, false, false);
+ //
+ RefreshResult result = info.refresh(createServiceDescription(true, 0), producerId, false, false);
assertNotNull(result);
assertFalse(result.hasIssues());
- assertFalse(info.isRegistrationValid());
+ assertFalse(info.isRegistrationValid().booleanValue());
// Modifying a property renders the info dirty and hence should be refreshed
info.setRegistrationPropertyValue("foo", "bar");
result = info.refresh(createServiceDescription(true, 0), producerId, false, false);
assertTrue(result.hasIssues());
- assertFalse(info.isRegistrationValid());
+ assertFalse(info.isRegistrationValid().booleanValue());
info.removeRegistrationProperty("foo");
result = info.refresh(createServiceDescription(true, 0), producerId, false, false);
assertFalse(result.hasIssues());
- assertFalse(info.isRegistrationValid());
+ assertFalse(info.isRegistrationValid().booleanValue());
// producer has changed but we're not forcing refresh so registration should still be invalid
result = info.refresh(createServiceDescription(false, 0), producerId, false, false);
assertFalse(result.hasIssues());
- assertFalse(info.isRegistrationValid());
+ assertFalse(info.isRegistrationValid().booleanValue());
- // force refresh
+ // force refresh, registration should now be valid
result = info.refresh(createServiceDescription(false, 0), producerId, false, true);
assertFalse(result.hasIssues());
- assertTrue(info.isRegistrationValid());
+ assertTrue(info.isRegistrationValid().booleanValue());
}
+ public void testSetRegistrationContext()
+ {
+ assertNull(info.isConsistentWithProducerExpectations());
+ assertNull(info.getRegistrationHandle());
+
+ String registrationHandle = "registrationHandle";
+ info.setRegistrationContext(WSRPTypeFactory.createRegistrationContext(registrationHandle));
+ RegistrationContext registrationContext = info.getRegistrationContext();
+ assertNotNull(registrationContext);
+ assertEquals(registrationHandle, registrationContext.getRegistrationHandle());
+ assertNull(registrationContext.getRegistrationState());
+ assertTrue(info.isConsistentWithProducerExpectations().booleanValue());
+ assertTrue(info.isRegistrationValid().booleanValue());
+ assertFalse(info.isRefreshNeeded());
+ assertTrue(info.isRegistrationRequired().booleanValue());
+ assertTrue(info.isRegistrationDeterminedRequired());
+ assertFalse(info.isRegistrationDeterminedNotRequired());
+ }
+
private ServiceDescription createServiceDescription(boolean requiresRegistration, int numberOfProperties)
{
ServiceDescription sd = WSRPTypeFactory.createServiceDescription(requiresRegistration);
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2007-05-07 14:44:07 UTC (rev 7220)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2007-05-08 05:38:51 UTC (rev 7221)
@@ -181,7 +181,11 @@
public boolean isRegistrationValid()
{
- return getProducerInfo().getRegistrationInfo().isRegistrationValid();
+ if (isRegistrationChecked())
+ {
+ return getProducerInfo().getRegistrationInfo().isRegistrationValid().booleanValue();
+ }
+ throw new IllegalStateException("Need to check the registration before determining if it's valid!");
}
public ProducerInfo getProducerInfo()
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-05-07 14:44:07 UTC (rev 7220)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-05-08 05:38:51 UTC (rev 7221)
@@ -99,12 +99,6 @@
/** Time at which the cache expires */
private long expirationTimeMillis;
- /** The service description request sent to producer before registration happens. */
- private final GetServiceDescription unregisteredServiceDescriptionRequest;
-
- /** The service description sent to producer. */
- private GetServiceDescription serviceDescriptionRequest;
-
private ConsumerRegistry registry;
private static final String REGISTER_MEANING = "Should clients ask for a new service description?";
private static final String REFRESH_MEANING = "Did just refresh?";
@@ -121,7 +115,6 @@
public ProducerInfo()
{
- unregisteredServiceDescriptionRequest = initUnregisteredServiceDescriptionRequest();
persistentEndpointInfo = new EndpointConfigurationInfo(this);
}
@@ -167,7 +160,13 @@
public boolean isRegistered()
{
- return persistentRegistrationInfo != null && persistentRegistrationInfo.isRegistrationValid();
+ if (persistentRegistrationInfo != null)
+ {
+ Boolean valid = persistentRegistrationInfo.isRegistrationValid();
+ return valid != null && valid.booleanValue();
+ }
+
+ return false;
}
public boolean isRegistrationRequired()
@@ -277,17 +276,27 @@
if (serviceDescription.isRequiresRegistration())
{
// attempt to register and determine if the current service description can be used to extract POPs
- RefreshResult registrationResult = register(serviceDescription, forceRefresh);
- if (registrationResult.specificCode())
+ RefreshResult registrationResult = internalRefreshRegistration(serviceDescription, true);
+ String status = registrationResult.getStatus();
+ if (status != null)
{
- // registration occurred, so we should ask for a new service description
- serviceDescription = getServiceDescription(false);
+ result.appendToStatus(status);
}
- // extract the POPs
- extractOfferedPortlets(serviceDescription);
+ if (!registrationResult.hasIssues())
+ {
+ registrationResult = register(serviceDescription, forceRefresh);
+ if (registrationResult.specificCode())
+ {
+ // registration occurred, so we should ask for a new service description
+ serviceDescription = getServiceDescription(false);
+ }
- String status = registrationResult.getStatus();
+ // extract the POPs
+ extractOfferedPortlets(serviceDescription);
+ }
+
+ status = registrationResult.getStatus();
if (status != null)
{
result.appendToStatus(status);
@@ -301,7 +310,6 @@
{
log.debug("Registration not required");
persistentRegistrationInfo = new RegistrationInfo(this, false);
- setServiceDescriptionRequest(getUnregisteredServiceDescriptionRequest());
extractOfferedPortlets(serviceDescription);
return result;
}
@@ -503,18 +511,8 @@
private ServiceDescription getServiceDescription(boolean asUnregistered) throws PortletInvokerException
{
- GetServiceDescription request;
- if (asUnregistered)
- {
- request = getUnregisteredServiceDescriptionRequest();
- }
- else
- {
- request = getServiceDescriptionRequest();
- request.setRegistrationContext(getRegistrationContext());
- }
+ GetServiceDescription request = getServiceDescriptionRequest(asUnregistered);
-
ServiceDescription serviceDescription;
try
{
@@ -522,13 +520,11 @@
if (serviceDescription != null)
{
- // from now on (that is until getServiceDescription fails) use this successful request
- setServiceDescriptionRequest(request);
return serviceDescription;
}
else
{
- // fix-me: do something better
+ // todo: do something better
throw new NullPointerException("null service description: deal with it!");
}
}
@@ -545,38 +541,21 @@
}
}
- private void setServiceDescriptionRequest(GetServiceDescription request)
+ private GetServiceDescription getServiceDescriptionRequest(boolean asUnregistred)
{
- serviceDescriptionRequest = request;
- }
-
- private GetServiceDescription getServiceDescriptionRequest()
- {
- return (serviceDescriptionRequest != null) ? serviceDescriptionRequest : getUnregisteredServiceDescriptionRequest();
- }
-
- /**
- * Retrieves the service description request this consumer uses when not registered.
- *
- * @return the service description request this consumer uses when not registered.
- */
- private GetServiceDescription getUnregisteredServiceDescriptionRequest()
- {
- return unregisteredServiceDescriptionRequest;
- }
-
- /**
- * Initializes the service description request this consumer uses when not registered. TODO: Implement
- * customization.
- *
- * @return the service description request this consumer uses when not registered.
- */
- private GetServiceDescription initUnregisteredServiceDescriptionRequest()
- {
+ //todo: might need to implement customization of default service description
GetServiceDescription gsd = WSRPTypeFactory.createGetServiceDescription();
gsd.setDesiredLocales(WSRPConstants.DEFAULT_LOCALES);
- return gsd;
+ if (asUnregistred)
+ {
+ return gsd;
+ }
+ else
+ {
+ gsd.setRegistrationContext(getRegistrationContext());
+ return gsd;
+ }
}
public RegistrationContext getRegistrationContext()
@@ -654,7 +633,7 @@
persistentRegistrationInfo = new RegistrationInfo(this);
}
- if (forceRefresh || !isRegistered())
+ if (!isRegistered())
{
if (serviceDescription == null)
@@ -738,9 +717,14 @@
{
try
{
- ModifyRegistration modifyRegistration = WSRPTypeFactory.createModifyRegistration(getRegistrationContext(),
+ RegistrationContext registrationContext = getRegistrationContext();
+ ModifyRegistration modifyRegistration = WSRPTypeFactory.createModifyRegistration(registrationContext,
persistentRegistrationInfo.getRegistrationData());
RegistrationState state = persistentEndpointInfo.getRegistrationService().modifyRegistration(modifyRegistration);
+
+ // force refresh of internal RegistrationInfo state
+ persistentRegistrationInfo.setRegistrationValidInternalState();
+
if (state != null)
{
persistentRegistrationInfo.setRegistrationState(state.getRegistrationState());
@@ -760,15 +744,20 @@
public RefreshResult refreshRegistrationInfo(boolean mergeWithLocalInfo) throws PortletInvokerException
{
+ return internalRefreshRegistration(getServiceDescription(true), mergeWithLocalInfo);
+ }
+
+ private RefreshResult internalRefreshRegistration(ServiceDescription serviceDescription, boolean mergeWithLocalInfo) throws PortletInvokerException
+ {
if (persistentRegistrationInfo == null)
{
persistentRegistrationInfo = new RegistrationInfo(this);
}
- RegistrationInfo.RegistrationRefreshResult result;
+ RefreshResult result;
try
{
- result = persistentRegistrationInfo.refresh(getServiceDescription(true), persistentId, mergeWithLocalInfo, true);
+ result = persistentRegistrationInfo.refresh(serviceDescription, persistentId, mergeWithLocalInfo, true);
}
finally
{
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-05-07 14:44:07 UTC (rev 7220)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-05-08 05:38:51 UTC (rev 7221)
@@ -62,7 +62,7 @@
private Map persistentRegistrationProperties;
private transient Boolean requiresRegistration;
- private transient Boolean isRegistrationValid;
+ private transient Boolean consistentWithProducerExpectations;
private transient RegistrationData registrationData;
private transient boolean dirty;
@@ -84,7 +84,6 @@
persistentConsumerName = WSRPConstants.DEFAULT_CONSUMER_NAME;
}
-
public Long getKey()
{
return key;
@@ -115,6 +114,28 @@
this.persistentRegistrationState = registrationState;
}
+ public boolean isRefreshNeeded()
+ {
+ return dirty || requiresRegistration == null;
+ }
+
+ public Boolean isRegistrationValid()
+ {
+ if (consistentWithProducerExpectations == null || requiresRegistration == null)
+ {
+ return null;
+ }
+
+ boolean hasRegisteredIfNeeded =
+ (persistentRegistrationHandle != null && isRegistrationDeterminedRequired()) || isRegistrationDeterminedNotRequired();
+ return Boolean.valueOf(consistentWithProducerExpectations.booleanValue() && hasRegisteredIfNeeded);
+ }
+
+ public Boolean isConsistentWithProducerExpectations()
+ {
+ return consistentWithProducerExpectations;
+ }
+
/**
* Determines whether the associated Producer requires registration.
*
@@ -133,10 +154,16 @@
*
* @return <code>true</code> if and only if the associated Producer has been queried and mandates registration,
* <code>false</code> otherwise.
+ * @throws IllegalStateException if {@link #refresh} has not yet been called
*/
public boolean isRegistrationDeterminedRequired()
{
- return requiresRegistration != null && requiresRegistration.booleanValue();
+ if (requiresRegistration == null)
+ {
+ throw new IllegalStateException("Registration status not yet known: call refresh first!");
+ }
+
+ return requiresRegistration.booleanValue();
}
/**
@@ -145,10 +172,16 @@
*
* @return <code>true</code> if and only if the associated Producer has been queried and does NOT mandate
* registration, <code>false</code> otherwise.
+ * @throws IllegalStateException if {@link #refresh} has not yet been called
*/
public boolean isRegistrationDeterminedNotRequired()
{
- return requiresRegistration != null && !requiresRegistration.booleanValue();
+ if (requiresRegistration == null)
+ {
+ throw new IllegalStateException("Registration status not yet known: call refresh first!");
+ }
+
+ return !requiresRegistration.booleanValue();
}
public boolean hasLocalInfo()
@@ -273,18 +306,6 @@
/**
* @param serviceDescription
* @param producerId
- * @return <code>true</code> if the associated producer is ready to be interacted with as far as registration is
- * concerned, <code>false</code> otherwise.
- */
- boolean initialize(ServiceDescription serviceDescription, String producerId)
- {
- return !refresh(serviceDescription, producerId, false, false).hasIssues();
- }
-
-
- /**
- * @param serviceDescription
- * @param producerId
* @param mergeWithLocalInfo
* @param forceRefresh
* @return
@@ -385,7 +406,7 @@
}
// if issues have been detected, mark the registration as invalid (but do not reset the data)
- isRegistrationValid = Boolean.valueOf(!result.hasIssues());
+ consistentWithProducerExpectations = Boolean.valueOf(!result.hasIssues());
String msg = "Registration configuration is " + (result.hasIssues() ? "NOT" : "") + " valid";
result.appendToStatus(msg);
@@ -497,13 +518,9 @@
persistentRegistrationHandle = null;
persistentRegistrationState = null;
requiresRegistration = null;
+ consistentWithProducerExpectations = null;
}
- public boolean isRegistrationValid()
- {
- return isRegistrationValid != null && isRegistrationValid.booleanValue();
- }
-
public void setRegistrationContext(RegistrationContext registrationContext)
{
ParameterValidation.throwIllegalArgExceptionIfNull(registrationContext, "RegistrationContext");
@@ -511,8 +528,16 @@
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(handle, "registration handle", "RegistrationContext");
persistentRegistrationHandle = handle;
persistentRegistrationState = registrationContext.getRegistrationState();
+ setRegistrationValidInternalState();
}
+ void setRegistrationValidInternalState()
+ {
+ consistentWithProducerExpectations = Boolean.TRUE; // since we have a registration context, we're consistent with the Producer
+ requiresRegistration = Boolean.TRUE; // we know we require registration
+ dirty = false; // our state is clean :)
+ }
+
public RegistrationContext getRegistrationContext()
{
if (persistentRegistrationHandle != null)
@@ -527,11 +552,6 @@
}
}
- public boolean isRefreshNeeded()
- {
- return dirty || requiresRegistration == null || isRegistrationValid == null;
- }
-
public class RegistrationRefreshResult extends RefreshResult
{
public RegistrationRefreshResult()
@@ -568,6 +588,7 @@
{
oldValue = newValue;
dirty = true;
+ consistentWithProducerExpectations = null;
}
return oldValue;
Modified: trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml 2007-05-07 14:44:07 UTC (rev 7220)
+++ trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml 2007-05-08 05:38:51 UTC (rev 7221)
@@ -79,7 +79,7 @@
<map name="persistentRegistrationProperties" cascade="all,delete-orphan" lazy="false" access="field">
<cache usage="@portal.hibernate.cache.usage@"/>
<key column="REG_PK" not-null="true"/>
- <map-key type="string" column="name"/>
+ <map-key type="string" formula="name"/>
<one-to-many class="org.jboss.portal.wsrp.consumer.RegistrationProperty"/>
</map>
</class>
@@ -91,7 +91,7 @@
<param name="sequence">wsrpconsumer_seq</param>
</generator>
</id>
- <property name="name" type="java.lang.String" not-null="true" unique="false" insert="false" update="false"/>
+ <property name="name" type="java.lang.String" not-null="true"/>
<property name="value" type="java.lang.String"/>
<property name="invalid" type="boolean"/>
<property name="lang" type="java.lang.String" not-null="true"/>
Modified: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-05-07 14:44:07 UTC (rev 7220)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-05-08 05:38:51 UTC (rev 7221)
@@ -73,14 +73,14 @@
</c:choose>
</td>
</tr>
-<c:if test="#{!consumer.refreshNeeded or consumer.localInfoPresent}">
+<c:if test="#{consumer.localInfoPresent or !consumer.refreshNeeded}">
<tr>
<th>Registration information</th>
<td>
<c:choose>
<c:when test="#{consumer.localInfoPresent}">
<c:choose>
- <c:when test="#{!empty consumer.producerInfo.registrationInfo.registrationPropertyNames}">
+ <c:when test="#{!empty consumer.producerInfo.registrationInfo.registrationProperties}">
<table border='1' cellspacing='0' class='registration-prop-table'>
<tr>
<th>Name</th>
@@ -168,7 +168,7 @@
</h:commandLink>
<h:commandLink action="#{consumersMgr.registerConsumer}" styleClass="portlet-form-button"
- rendered="#{consumer.active and consumer.registrationRequired}"
+ rendered="#{!consumer.refreshNeeded and consumer.active and consumer.registrationRequired}"
value="#{consumer.registered ? 'Deregister' : 'Register'}">
<f:param name="id" value="#{consumer.id}"/>
<f:param name="register" value="#{!consumer.registered}"/>
18 years, 12 months
JBoss Portal SVN: r7220 - in trunk/core/src: resources/portal-core-war/WEB-INF/jsp/user and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-05-07 10:44:07 -0400 (Mon, 07 May 2007)
New Revision: 7220
Modified:
trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java
trunk/core/src/resources/portal-core-war/WEB-INF/jsp/user/editUserRoles.jsp
Log:
Fix: JBPORTAL-1385 After assigning new role to a user, the User Portlet is left in a Maximized State
Slightly changed, now the wondows stays in maximize but list the users so that changes are directly seen
Modified: trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java 2007-05-07 14:28:08 UTC (rev 7219)
+++ trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java 2007-05-07 14:44:07 UTC (rev 7220)
@@ -408,6 +408,9 @@
PortletURL rolesURL = resp.createRenderURL();
rolesURL.setParameter(getOperationName(), OP_SHOWADDROLESTOUSER);
rolesURL.setParameter("userid", "" + user.getId());
+ rolesURL.setParameter("usernamefilter", usernameFilter);
+ rolesURL.setParameter("offset", "" + offset);
+ rolesURL.setParameter("usersperpage", "" + usersPerPage);
PortletURL deleteUrl = resp.createActionURL();
deleteUrl.setParameter(getOperationName(), OP_DELETEUSER);
@@ -1033,6 +1036,10 @@
User user = userModule.findUserById(userId);
Set roles = roleModule.findRolesByNames(selectedRoles);
membershipModule.assignRoles(user, roles);
+ response.setRenderParameter(getOperationName(), OP_SHOWLISTUSERS);
+ response.setRenderParameter("usernamefilter", request.getParameter("usernamefilter"));
+ response.setRenderParameter("offset", request.getParameter("offset"));
+ response.setRenderParameter("usersperpage", request.getParameter("usersperpage"));
}
catch (IllegalArgumentException e)
{
Modified: trunk/core/src/resources/portal-core-war/WEB-INF/jsp/user/editUserRoles.jsp
===================================================================
(Binary files differ)
18 years, 12 months
JBoss Portal SVN: r7219 - in trunk/core/src: main/org/jboss/portal/test/core/model/portal and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-05-07 10:28:08 -0400 (Mon, 07 May 2007)
New Revision: 7219
Added:
trunk/core/src/main/org/jboss/portal/test/core/model/content/SimpleContent.java
trunk/core/src/main/org/jboss/portal/test/core/model/content/SimpleContentHandler.java
trunk/core/src/main/org/jboss/portal/test/core/model/content/SimpleContentProvider.java
trunk/core/src/main/org/jboss/portal/test/core/model/content/SimpleContentProviderRegistry.java
Removed:
trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContent.java
trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContentHandler.java
trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContentProvider.java
Modified:
trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/model/portal/jboss-beans.xml
Log:
externalize service assembly of portal object container test case in MC
Deleted: trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContent.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContent.java 2007-05-07 13:38:07 UTC (rev 7218)
+++ trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContent.java 2007-05-07 14:28:08 UTC (rev 7219)
@@ -1,61 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.core.model.content;
-
-import org.jboss.portal.core.model.content.spi.handler.ContentState;
-import org.jboss.portal.core.impl.model.content.AbstractContent;
-import org.jboss.portal.common.i18n.LocalizedString;
-
-import java.util.Locale;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class NullContent extends AbstractContent
-{
-
- /** . */
- private final String contextId;
-
- public NullContent(String contextId, ContentState state)
- {
- super(state);
- this.contextId = contextId;
- }
-
- public String getContextId()
- {
- return contextId;
- }
-
- public ContentState getState()
- {
- return state;
- }
-
- public LocalizedString getDisplayName()
- {
- return new LocalizedString("Null content", Locale.ENGLISH);
- }
-}
Deleted: trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContentHandler.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContentHandler.java 2007-05-07 13:38:07 UTC (rev 7218)
+++ trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContentHandler.java 2007-05-07 14:28:08 UTC (rev 7219)
@@ -1,47 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.core.model.content;
-
-import org.jboss.portal.core.model.content.spi.handler.ContentState;
-import org.jboss.portal.core.model.content.spi.handler.ContentHandler;
-import org.jboss.portal.core.model.content.Content;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class NullContentHandler implements ContentHandler
-{
- public Content newContent(String contextId, ContentState state)
- {
- return new NullContent(contextId, state);
- }
-
- public void contentCreated(String contextId, ContentState state)
- {
- }
-
- public void contentDestroyed(String contextId, ContentState state)
- {
- }
-}
Deleted: trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContentProvider.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContentProvider.java 2007-05-07 13:38:07 UTC (rev 7218)
+++ trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContentProvider.java 2007-05-07 14:28:08 UTC (rev 7219)
@@ -1,74 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.core.model.content;
-
-import org.jboss.portal.core.model.content.spi.ContentProvider;
-import org.jboss.portal.core.model.content.ContentType;
-import org.jboss.portal.core.model.content.spi.handler.ContentHandler;
-import org.jboss.portal.core.model.content.spi.portlet.ContentPortlet;
-import org.jboss.portal.common.i18n.LocalizedString;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class NullContentProvider implements ContentProvider
-{
-
- /** . */
- private final ContentType contentType;
-
- /** . */
- private final NullContentHandler handler;
-
- public NullContentProvider(ContentType contentType)
- {
- this.contentType = contentType;
- this.handler = new NullContentHandler();
- }
-
- public ContentType getContentType()
- {
- return contentType;
- }
-
- public LocalizedString getDisplayName()
- {
- return null;
- }
-
- public LocalizedString getDescription()
- {
- return null;
- }
-
- public ContentHandler getHandler()
- {
- return handler;
- }
-
- public ContentPortlet getPortletInfo()
- {
- return null;
- }
-}
Copied: trunk/core/src/main/org/jboss/portal/test/core/model/content/SimpleContent.java (from rev 7199, trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContent.java)
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/model/content/SimpleContent.java (rev 0)
+++ trunk/core/src/main/org/jboss/portal/test/core/model/content/SimpleContent.java 2007-05-07 14:28:08 UTC (rev 7219)
@@ -0,0 +1,61 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.core.model.content;
+
+import org.jboss.portal.core.model.content.spi.handler.ContentState;
+import org.jboss.portal.core.impl.model.content.AbstractContent;
+import org.jboss.portal.common.i18n.LocalizedString;
+
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class SimpleContent extends AbstractContent
+{
+
+ /** . */
+ private final String contextId;
+
+ public SimpleContent(String contextId, ContentState state)
+ {
+ super(state);
+ this.contextId = contextId;
+ }
+
+ public String getContextId()
+ {
+ return contextId;
+ }
+
+ public ContentState getState()
+ {
+ return state;
+ }
+
+ public LocalizedString getDisplayName()
+ {
+ return new LocalizedString("Null content", Locale.ENGLISH);
+ }
+}
Copied: trunk/core/src/main/org/jboss/portal/test/core/model/content/SimpleContentHandler.java (from rev 7199, trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContentHandler.java)
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/model/content/SimpleContentHandler.java (rev 0)
+++ trunk/core/src/main/org/jboss/portal/test/core/model/content/SimpleContentHandler.java 2007-05-07 14:28:08 UTC (rev 7219)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.core.model.content;
+
+import org.jboss.portal.core.model.content.spi.handler.ContentState;
+import org.jboss.portal.core.model.content.spi.handler.ContentHandler;
+import org.jboss.portal.core.model.content.Content;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class SimpleContentHandler implements ContentHandler
+{
+ public Content newContent(String contextId, ContentState state)
+ {
+ return new SimpleContent(contextId, state);
+ }
+
+ public void contentCreated(String contextId, ContentState state)
+ {
+ }
+
+ public void contentDestroyed(String contextId, ContentState state)
+ {
+ }
+}
Copied: trunk/core/src/main/org/jboss/portal/test/core/model/content/SimpleContentProvider.java (from rev 7199, trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContentProvider.java)
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/model/content/SimpleContentProvider.java (rev 0)
+++ trunk/core/src/main/org/jboss/portal/test/core/model/content/SimpleContentProvider.java 2007-05-07 14:28:08 UTC (rev 7219)
@@ -0,0 +1,103 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.core.model.content;
+
+import org.jboss.portal.core.model.content.spi.ContentProvider;
+import org.jboss.portal.core.model.content.ContentType;
+import org.jboss.portal.core.model.content.spi.handler.ContentHandler;
+import org.jboss.portal.core.model.content.spi.portlet.ContentPortlet;
+import org.jboss.portal.common.i18n.LocalizedString;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class SimpleContentProvider implements ContentProvider
+{
+
+ /** . */
+ private final ContentType contentType;
+
+ /** . */
+ private final SimpleContentHandler handler;
+
+ /** . */
+ private SimpleContentProviderRegistry registry;
+
+ public SimpleContentProvider(ContentType contentType)
+ {
+ this.contentType = contentType;
+ this.handler = new SimpleContentHandler();
+ }
+
+ public SimpleContentProvider(String contentTypeValue)
+ {
+ this.contentType = ContentType.create(contentTypeValue);
+ this.handler = new SimpleContentHandler();
+ }
+
+ public SimpleContentProviderRegistry getRegistry()
+ {
+ return registry;
+ }
+
+ public void setRegistry(SimpleContentProviderRegistry registry)
+ {
+ this.registry = registry;
+ }
+
+ public ContentType getContentType()
+ {
+ return contentType;
+ }
+
+ public LocalizedString getDisplayName()
+ {
+ return null;
+ }
+
+ public LocalizedString getDescription()
+ {
+ return null;
+ }
+
+ public ContentHandler getHandler()
+ {
+ return handler;
+ }
+
+ public ContentPortlet getPortletInfo()
+ {
+ return null;
+ }
+
+ public void start()
+ {
+ registry.addContentProvider(this);
+ }
+
+ public void stop()
+ {
+ registry.removeContentProvider(contentType);
+ }
+}
Added: trunk/core/src/main/org/jboss/portal/test/core/model/content/SimpleContentProviderRegistry.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/model/content/SimpleContentProviderRegistry.java (rev 0)
+++ trunk/core/src/main/org/jboss/portal/test/core/model/content/SimpleContentProviderRegistry.java 2007-05-07 14:28:08 UTC (rev 7219)
@@ -0,0 +1,61 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.core.model.content;
+
+import org.jboss.portal.core.model.content.spi.ContentProviderRegistry;
+import org.jboss.portal.core.model.content.spi.ContentProvider;
+import org.jboss.portal.core.model.content.ContentType;
+import org.jboss.portal.common.util.CopyOnWriteRegistry;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class SimpleContentProviderRegistry implements ContentProviderRegistry
+{
+
+ /** . */
+ private final CopyOnWriteRegistry registry = new CopyOnWriteRegistry();
+
+ public void addContentProvider(ContentProvider provider)
+ {
+ registry.register(provider.getContentType(), provider);
+ }
+
+ public void removeContentProvider(ContentType contentType)
+ {
+ registry.unregister(contentType);
+ }
+
+ public Collection getContentTypes()
+ {
+ return registry.getKeys();
+ }
+
+ public ContentProvider getContentProvider(ContentType contentType)
+ {
+ return (ContentProvider)registry.getRegistration(contentType);
+ }
+}
Modified: trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2007-05-07 13:38:07 UTC (rev 7218)
+++ trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2007-05-07 14:28:08 UTC (rev 7219)
@@ -31,14 +31,9 @@
import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.content.ContentType;
-import org.jboss.portal.core.model.content.spi.ContentProviderRegistry;
-import org.jboss.portal.core.model.content.spi.ContentProvider;
import org.jboss.portal.core.model.content.spi.handler.ContentState;
-import org.jboss.portal.security.impl.JBossAuthorizationDomainRegistryImpl;
-import org.jboss.portal.security.impl.jacc.JACCPortalAuthorizationManagerFactory;
import org.jboss.portal.test.core.PortalBaseTestCase;
-import org.jboss.portal.test.core.model.content.NullContent;
-import org.jboss.portal.test.core.model.content.NullContentProvider;
+import org.jboss.portal.test.core.model.content.SimpleContent;
import org.jboss.portal.test.framework.embedded.DataSourceSupport;
import org.jboss.portal.common.test.TestParametrization;
import org.jboss.portal.common.test.junit.JUnitAdapter;
@@ -53,7 +48,6 @@
import java.util.List;
import java.util.ArrayList;
import java.util.Comparator;
-import java.util.Collection;
/**
* Portal Object Container Test Cases based on the microcontainer architecture
@@ -85,60 +79,25 @@
return "org/jboss/portal/test/core/model/portal/jboss-beans.xml";
}
- JBossAuthorizationDomainRegistryImpl registry;
- JACCPortalAuthorizationManagerFactory factory;
- ContentProviderRegistry contentProviderRegistry;
- ContentProvider contentProvider = new NullContentProvider(ContentType.PORTLET);
-// NullContentHandler handler;
+ public PersistentPortalObjectContainer getPortalObjectContainer()
+ {
+ return container;
+ }
+ public void setPortalObjectContainer(PersistentPortalObjectContainer container)
+ {
+ this.container = container;
+ }
+
public void setUp() throws Exception
{
super.setUp();
- //
- registry = new JBossAuthorizationDomainRegistryImpl();
-
- //
- factory = new JACCPortalAuthorizationManagerFactory();
- factory.setAuthorizationDomainRegistry(registry);
-
- //
- contentProviderRegistry = new ContentProviderRegistry()
- {
- public Collection getContentTypes()
- {
- return Collections.singleton(ContentType.PORTLET);
- }
- public ContentProvider getContentProvider(ContentType contentType)
- {
- return ContentType.PORTLET.equals(contentType) ? contentProvider : null;
- }
- };
-
- //
- container = new PersistentPortalObjectContainer();
- container.setSessionFactoryJNDIName("java:/SessionFactory");
- container.setAuthorizationDomainRegistry(registry);
- container.setPortalAuthorizationManagerFactory(factory);
- container.setContentProviderRegistry(contentProviderRegistry);
-
- //
- registry.start();
- factory.start();
- container.start();
}
public void tearDown() throws Exception
{
super.tearDown();
- container.destroy();
- factory.destroy();
- registry.destroy();
- container = null;
- registry = null;
- factory = null;
- contentProviderRegistry = null;
- contentProvider = null;
}
/** todo same with a transaction wrapping the start method */
@@ -325,7 +284,7 @@
page.setDeclaredProperty("pagename", "pagevalue");
Window window = page.createWindow("window", ContentType.PORTLET, "uri");
window.setDeclaredProperty("windowname", "windowvalue");
- NullContent content = (NullContent)window.getContent();
+ SimpleContent content = (SimpleContent)window.getContent();
assertNotNull(content);
ContentState contentState = content.getState();
assertNotNull(contentState);
@@ -349,7 +308,7 @@
assertNotNull(window);
assertEquals("windowvalue", window.getDeclaredProperty("windowname"));
assertEquals(ContentType.PORTLET, window.getContentType());
- content = (NullContent)window.getContent();
+ content = (SimpleContent)window.getContent();
assertNotNull(content);
contentState = content.getState();
assertNotNull(contentState);
Modified: trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/model/portal/jboss-beans.xml
===================================================================
--- trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/model/portal/jboss-beans.xml 2007-05-07 13:38:07 UTC (rev 7218)
+++ trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/model/portal/jboss-beans.xml 2007-05-07 14:28:08 UTC (rev 7219)
@@ -67,11 +67,36 @@
<property name="jNDIName">java:/SessionFactory</property>
</bean>
+ <bean name="AuthorizationDomainRegistry" class="org.jboss.portal.security.impl.JBossAuthorizationDomainRegistryImpl">
+ </bean>
+
+ <bean name="AuthorizationManagerFactory" class="org.jboss.portal.security.impl.jacc.JACCPortalAuthorizationManagerFactory">
+ <property name="authorizationDomainRegistry"><inject bean="AuthorizationDomainRegistry"/></property>
+ </bean>
+
+ <bean name="ContentProviderRegistry" class="org.jboss.portal.test.core.model.content.SimpleContentProviderRegistry">
+ </bean>
+
+ <bean name="PortletContentProvider" class="org.jboss.portal.test.core.model.content.SimpleContentProvider">
+ <constructor>
+ <parameter>portlet</parameter>
+ </constructor>
+ <property name="registry"><inject bean="ContentProviderRegistry"/></property>
+ </bean>
+
+ <bean name="PortalObjectContainer" class="org.jboss.portal.core.impl.model.portal.PersistentPortalObjectContainer">
+ <property name="sessionFactoryJNDIName">java:/SessionFactory</property>
+ <property name="authorizationDomainRegistry"><inject bean="AuthorizationDomainRegistry"/></property>
+ <property name="portalAuthorizationManagerFactory"><inject bean="AuthorizationManagerFactory"/></property>
+ <property name="contentProviderRegistry"><inject bean="ContentProviderRegistry"/></property>
+ </bean>
+
<bean name="TestBean" class="org.jboss.portal.test.core.model.portal.PortalObjectContainerTestCase">
<constructor factoryMethod="getBean">
<factory bean="BeanFactory"/>
<parameter>TestBean</parameter>
</constructor>
<property name="hibernate"><inject bean="HibernateSupport"/></property>
+ <property name="portalObjectContainer"><inject bean="PortalObjectContainer"/></property>
</bean>
</deployment>
18 years, 12 months