Author: julien(a)jboss.com
Date: 2007-03-12 12:48:34 -0400 (Mon, 12 Mar 2007)
New Revision: 6643
Added:
trunk/common/src/main/org/jboss/portal/common/util/MapAccessor.java
Removed:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/StateConverterService.java
Modified:
trunk/cms/build.xml
trunk/common/src/main/org/jboss/portal/common/util/ParameterMap.java
trunk/common/src/main/org/jboss/portal/common/util/TypedMap.java
trunk/common/src/main/org/jboss/portal/test/common/ParameterMapTestCase.java
trunk/common/src/main/org/jboss/portal/test/common/TypedMapTestCase.java
trunk/core/build.xml
trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentPortletState.java
trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentRegistration.java
trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/model/instance/jboss-beans.xml
trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/state/jboss-beans.xml
trunk/portlet/src/main/org/jboss/portal/portlet/PortletParameters.java
trunk/portlet/src/main/org/jboss/portal/portlet/state/AbstractPropertyMap.java
trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyMap.java
trunk/portlet/src/main/org/jboss/portal/portlet/state/SimplePropertyMap.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java
trunk/server/src/main/org/jboss/portal/server/AbstractServerURL.java
trunk/server/src/main/org/jboss/portal/server/impl/ServerInvocationContextImpl.java
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
Log:
- added MapAccessor in common package which allows to decouple the map object from the
TypedMap class
- removed a bunch of TypedMap subclasses that were nedded in order to implement the
getDelegate()
- removed StateConverterService, instead use StateConverterV0, which also remove the need
to have PropertyMap extends Serializable
- added http common classpath in test cases were needed
Modified: trunk/cms/build.xml
===================================================================
--- trunk/cms/build.xml 2007-03-12 15:48:06 UTC (rev 6642)
+++ trunk/cms/build.xml 2007-03-12 16:48:34 UTC (rev 6643)
@@ -353,6 +353,7 @@
<path refid="antlr.antlr.classpath"/>
<path refid="asm.asm.classpath"/>
<path refid="cglib.cglib.classpath"/>
+ <path refid="apache.httpclient.classpath"/>
<path refid="jboss.portal-common.classpath"/>
<path refid="jboss.portal-test.classpath"/>
<path refid="jboss.portal-server.classpath"/>
@@ -441,6 +442,7 @@
<path refid="antlr.antlr.classpath"/>
<path refid="asm.asm.classpath"/>
<path refid="cglib.cglib.classpath"/>
+ <path refid="apache.httpclient.classpath"/>
<path refid="jboss.portal-common.classpath"/>
<path refid="jboss.portal-test.classpath"/>
<path refid="jboss.portal-search.classpath"/>
Added: trunk/common/src/main/org/jboss/portal/common/util/MapAccessor.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/MapAccessor.java
(rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/util/MapAccessor.java 2007-03-12
16:48:34 UTC (rev 6643)
@@ -0,0 +1,41 @@
+/******************************************************************************
+ * 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.util;
+
+import java.util.Map;
+
+/**
+ * An interface which defines how a map can be accessed.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface MapAccessor
+{
+ /**
+ * Return the accessed map.
+ *
+ * @return a non null map
+ */
+ Map getMap();
+}
Modified: trunk/common/src/main/org/jboss/portal/common/util/ParameterMap.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/ParameterMap.java 2007-03-12
15:48:06 UTC (rev 6642)
+++ trunk/common/src/main/org/jboss/portal/common/util/ParameterMap.java 2007-03-12
16:48:34 UTC (rev 6643)
@@ -23,6 +23,7 @@
package org.jboss.portal.common.util;
import java.util.Arrays;
+import java.util.Map;
/**
* A decorator that enforce the map content to be <String,String[]>
@@ -30,7 +31,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public abstract class ParameterMap extends TypedMap
+public class ParameterMap extends TypedMap
{
/** If true returned values will be cloned when returned to the client. */
@@ -39,17 +40,34 @@
/** If true returned values will be cloned when provided by the client. */
private boolean cloneExternalValue;
- protected ParameterMap(boolean cloneInternalValue, boolean cloneExternalValue)
+ public ParameterMap(MapAccessor accessor, boolean cloneInternalValue, boolean
cloneExternalValue)
{
+ super(accessor);
+
+ //
this.cloneInternalValue = cloneInternalValue;
this.cloneExternalValue = cloneExternalValue;
}
- protected ParameterMap()
+ public ParameterMap(Map delegate, boolean cloneInternalValue, boolean
cloneExternalValue)
{
- this(false, false);
+ super(delegate);
+
+ //
+ this.cloneInternalValue = cloneInternalValue;
+ this.cloneExternalValue = cloneExternalValue;
}
+ public ParameterMap(MapAccessor accessor)
+ {
+ this(accessor, false, false);
+ }
+
+ public ParameterMap(Map delegate)
+ {
+ this(delegate, false, false);
+ }
+
/**
* Return true if values returned by the map are cloned.
*
Modified: trunk/common/src/main/org/jboss/portal/common/util/TypedMap.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/TypedMap.java 2007-03-12 15:48:06
UTC (rev 6642)
+++ trunk/common/src/main/org/jboss/portal/common/util/TypedMap.java 2007-03-12 16:48:34
UTC (rev 6643)
@@ -40,9 +40,40 @@
public abstract class TypedMap implements Map
{
- protected abstract Map getDelegate();
+ /** The map accessor. */
+ protected final MapAccessor accessor;
+ protected TypedMap(MapAccessor accessor)
+ {
+ if (accessor == null)
+ {
+ throw new IllegalArgumentException("Need a valid accessor");
+ }
+ this.accessor = accessor;
+ }
+
+ protected TypedMap(final Map delegate)
+ {
+ accessor = new MapAccessor()
+ {
+ public Map getMap()
+ {
+ return delegate;
+ }
+ };
+ }
+
/**
+ * Return the map provided by the accessor.
+ *
+ * @return the delegate map
+ */
+ protected final Map getDelegate()
+ {
+ return accessor.getMap();
+ }
+
+ /**
* Override to check the validity of the key, the default implementation is an empty
method.
*
* @throws ClassCastException if the class of the specified key prevents it from being
stored in this map
Modified: trunk/common/src/main/org/jboss/portal/test/common/ParameterMapTestCase.java
===================================================================
---
trunk/common/src/main/org/jboss/portal/test/common/ParameterMapTestCase.java 2007-03-12
15:48:06 UTC (rev 6642)
+++
trunk/common/src/main/org/jboss/portal/test/common/ParameterMapTestCase.java 2007-03-12
16:48:34 UTC (rev 6643)
@@ -37,25 +37,16 @@
public class ParameterMapTestCase extends TestCase
{
- public static class TestParameterMap extends ParameterMap
- {
- private final Map delegate = new HashMap();
- protected Map getDelegate()
- {
- return delegate;
- }
- }
-
public void testPut()
{
- ParameterMap pm = new TestParameterMap();
+ ParameterMap pm = new ParameterMap(new HashMap());
pm.put("foo", new String[]{"bar"});
// ExtendedAssert.assertEquals(new String[]{"bar"},
(Object[])pm.get("foo"));
}
public void testEntry()
{
- ParameterMap pm = new TestParameterMap();
+ ParameterMap pm = new ParameterMap(new HashMap());
pm.put("foo", new String[]{"bar"});
Set entries = pm.entrySet();
assertNotNull(entries);
@@ -70,7 +61,7 @@
public void testPutThrowsException()
{
- ParameterMap pm = new TestParameterMap();
+ ParameterMap pm = new ParameterMap(new HashMap());
try
{
pm.put(new Object(), new String[]{"bar"});
@@ -107,7 +98,7 @@
public void testEntrySetValueThrowsException()
{
- ParameterMap pm = new TestParameterMap();
+ ParameterMap pm = new ParameterMap(new HashMap());
pm.put("foo", new String[]{"bar"});
Set entries = pm.entrySet();
assertNotNull(entries);
Modified: trunk/common/src/main/org/jboss/portal/test/common/TypedMapTestCase.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/test/common/TypedMapTestCase.java 2007-03-12
15:48:06 UTC (rev 6642)
+++ trunk/common/src/main/org/jboss/portal/test/common/TypedMapTestCase.java 2007-03-12
16:48:34 UTC (rev 6643)
@@ -386,7 +386,7 @@
{
/** . */
- final Map delegate = new HashMap();
+ final Map delegate;
/** . */
boolean internalValueReturnsNull = false;
@@ -394,9 +394,12 @@
/** . */
boolean externalValueReturnsNull = false;
- protected Map getDelegate()
+ public StringToIntegerMap()
{
- return delegate;
+ super(new HashMap());
+
+ //
+ delegate = getDelegate();
}
protected void assertKeyValidity(Object key) throws ClassCastException
Modified: trunk/core/build.xml
===================================================================
--- trunk/core/build.xml 2007-03-12 15:48:06 UTC (rev 6642)
+++ trunk/core/build.xml 2007-03-12 16:48:34 UTC (rev 6643)
@@ -615,6 +615,7 @@
<path refid="jboss.jbossxb.classpath"/>
<path refid="oswego.concurrent.classpath"/>
<path refid="jboss.microcontainer.classpath"/>
+ <path refid="apache.httpclient.classpath"/>
<path refid="aop.classpath"/>
<path refid="dom4j.dom4j.classpath"/>
<path refid="cglib.cglib.classpath"/>
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentPortletState.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentPortletState.java 2007-03-12
15:48:06 UTC (rev 6642)
+++
trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentPortletState.java 2007-03-12
16:48:34 UTC (rev 6643)
@@ -195,13 +195,8 @@
{
if (ctx == null)
{
- PropertyMap props = new AbstractPropertyMap()
+ PropertyMap props = new AbstractPropertyMap(entries)
{
- protected Map getDelegate()
- {
- return entries;
- }
-
protected Object getInternalValue(Object value)
{
throw new IllegalArgumentException("Immutable");
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentRegistration.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentRegistration.java 2007-03-12
15:48:06 UTC (rev 6642)
+++
trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentRegistration.java 2007-03-12
16:48:34 UTC (rev 6643)
@@ -24,6 +24,7 @@
import org.jboss.portal.common.NotYetImplemented;
import org.jboss.portal.common.util.TypedMap;
+import org.jboss.portal.common.util.MapAccessor;
import org.jboss.portal.registration.Consumer;
import org.jboss.portal.registration.Registration;
import org.jboss.portal.registration.RegistrationStatus;
@@ -252,9 +253,9 @@
public class Properties extends TypedMap
{
- protected Map getDelegate()
+ public Properties()
{
- return persistentProperties;
+ super(persistentProperties);
}
protected void assertKeyValidity(Object key) throws ClassCastException
Modified:
trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/model/instance/jboss-beans.xml
===================================================================
---
trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/model/instance/jboss-beans.xml 2007-03-12
15:48:06 UTC (rev 6642)
+++
trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/model/instance/jboss-beans.xml 2007-03-12
16:48:34 UTC (rev 6643)
@@ -83,7 +83,7 @@
<property
name="jNDIName">java:/PortletSessionFactory</property>
</bean>
- <bean name="StateConverter"
class="org.jboss.portal.portlet.impl.state.StateConverterService">
+ <bean name="StateConverter"
class="org.jboss.portal.portlet.impl.state.StateConverterV0">
</bean>
<bean name="StateManagementPolicy"
class="org.jboss.portal.portlet.impl.state.StateManagementPolicyService">
<property name="persistLocally"><inject
bean="TestCaseConfig" property="persistLocally"/></property>
Modified:
trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/state/jboss-beans.xml
===================================================================
---
trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/state/jboss-beans.xml 2007-03-12
15:48:06 UTC (rev 6642)
+++
trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/state/jboss-beans.xml 2007-03-12
16:48:34 UTC (rev 6643)
@@ -67,7 +67,7 @@
<property name="jNDIName">java:/SessionFactory</property>
</bean>
- <bean name="StateConverter"
class="org.jboss.portal.portlet.impl.state.StateConverterService">
+ <bean name="StateConverter"
class="org.jboss.portal.portlet.impl.state.StateConverterV0">
</bean>
<bean name="StateManagementPolicy"
class="org.jboss.portal.core.impl.portlet.state.StateManagementPolicyImpl">
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/PortletParameters.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/PortletParameters.java 2007-03-12
15:48:06 UTC (rev 6642)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/PortletParameters.java 2007-03-12
16:48:34 UTC (rev 6643)
@@ -42,32 +42,13 @@
/** The serialVersionUID */
private static final long serialVersionUID = -8529807471117491810L;
- /** The data. */
- private Map map;
-
/** Creates an empty parameter set. */
public PortletParameters()
{
- this.map = new HashMap();
+ super(new HashMap());
}
/**
- * Copy constructor.
- *
- * @throws IllegalArgumentException if the parameters is null
- */
- public PortletParameters(PortletParameters parameters) throws
IllegalArgumentException
- {
- if (parameters == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- this.map = new HashMap(parameters.map);
- }
-
- /**
* Copy the parameter map to initialize the object state.
*
* @throws IllegalArgumentException if the parameter map is null or not valid
@@ -79,23 +60,18 @@
*/
public PortletParameters(Map parameterMap) throws NullPointerException,
ClassCastException, IllegalArgumentException
{
+ super(new HashMap());
+
+ //
if (parameterMap == null)
{
throw new IllegalArgumentException("No null map accepted");
}
//
- this.map = new HashMap();
-
- //
replace(parameterMap);
}
- protected Map getDelegate()
- {
- return map;
- }
-
/**
* Append the content of the argument map to that map. If both maps contains an entry
sharing the same key, then the
* string arrays or the two entries will be concatenated into a single array. Each
entry present on the argument map
@@ -123,13 +99,14 @@
}
// Merge or use appended values
+ Map delegate = getDelegate();
while (--index >= 0)
{
String appendedName = appendedNames[index];
String[] appendedValue = appendedValues[index];
//
- String[] value = (String[])map.get(appendedName);
+ String[] value = (String[])delegate.get(appendedName);
if (value != null)
{
String[] tmp = new String[value.length + appendedValue.length];
@@ -139,30 +116,28 @@
}
//
- map.put(appendedName, appendedValue);
+ delegate.put(appendedName, appendedValue);
}
}
public String toString()
{
StringBuffer buffer = new StringBuffer("Parameters[");
- if (map != null)
+ Map delegate = getDelegate();
+ for (Iterator i = delegate.entrySet().iterator(); i.hasNext();)
{
- for (Iterator i = map.entrySet().iterator(); i.hasNext();)
+ Map.Entry entry = (Map.Entry)i.next();
+ String name = (String)entry.getKey();
+ String[] values = (String[])entry.getValue();
+ buffer.append(name);
+ for (int j = 0; j < values.length; j++)
{
- Map.Entry entry = (Map.Entry)i.next();
- String name = (String)entry.getKey();
- String[] values = (String[])entry.getValue();
- buffer.append(name);
- for (int j = 0; j < values.length; j++)
- {
- buffer.append(j > 0 ? ',' : '=').append(values[j]);
- }
- if (i.hasNext())
- {
- buffer.append(" | ");
- }
+ buffer.append(j > 0 ? ',' : '=').append(values[j]);
}
+ if (i.hasNext())
+ {
+ buffer.append(" | ");
+ }
}
buffer.append(']');
return buffer.toString();
Deleted:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/StateConverterService.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/StateConverterService.java 2007-03-12
15:48:06 UTC (rev 6642)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/StateConverterService.java 2007-03-12
16:48:34 UTC (rev 6643)
@@ -1,62 +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.state;
-
-import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.jems.as.system.AbstractJBossService;
-import org.jboss.portal.portlet.state.StateConverter;
-import org.jboss.portal.portlet.state.producer.PortletState;
-
-import java.io.IOException;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class StateConverterService extends AbstractJBossService implements
StateConverter
-{
-
- public byte[] marshall(PortletState state)
- {
- try
- {
- return Tools.serialize(state);
- }
- catch (IOException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- public PortletState unmarshall(byte[] marshalledState)
- {
- try
- {
- return (PortletState)Tools.unserialize(marshalledState);
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
-}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/state/AbstractPropertyMap.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/state/AbstractPropertyMap.java 2007-03-12
15:48:06 UTC (rev 6642)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/state/AbstractPropertyMap.java 2007-03-12
16:48:34 UTC (rev 6643)
@@ -23,8 +23,11 @@
package org.jboss.portal.portlet.state;
import org.jboss.portal.common.util.TypedMap;
+import org.jboss.portal.common.util.MapAccessor;
import org.jboss.portal.common.value.Value;
+import java.util.Map;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
@@ -32,9 +35,16 @@
public abstract class AbstractPropertyMap extends TypedMap implements PropertyMap
{
- /** The serialVersionUID */
- private static final long serialVersionUID = -5889928820592375820L;
+ protected AbstractPropertyMap(MapAccessor accessor)
+ {
+ super(accessor);
+ }
+ protected AbstractPropertyMap(Map delegate)
+ {
+ super(delegate);
+ }
+
/**
* Only accept non null string objects.
*
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyMap.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyMap.java 2007-03-12
15:48:06 UTC (rev 6642)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyMap.java 2007-03-12
16:48:34 UTC (rev 6643)
@@ -24,14 +24,13 @@
import org.jboss.portal.common.value.Value;
-import java.io.Serializable;
import java.util.Map;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 3287 $
+ * @version $Revision$
*/
-public interface PropertyMap extends Map, Serializable
+public interface PropertyMap extends Map
{
/**
* Return the value for the given key or null if it does not exist.
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/state/SimplePropertyMap.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/state/SimplePropertyMap.java 2007-03-12
15:48:06 UTC (rev 6642)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/state/SimplePropertyMap.java 2007-03-12
16:48:34 UTC (rev 6643)
@@ -24,51 +24,41 @@
import java.util.HashMap;
import java.util.Map;
+import java.io.Serializable;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 3287 $
+ * @version $Revision$
*/
-public class SimplePropertyMap extends AbstractPropertyMap
+public class SimplePropertyMap extends AbstractPropertyMap
{
- /** The serialVersionUID */
- private static final long serialVersionUID = -5889928820592375820L;
-
- protected Map getDelegate()
+ public SimplePropertyMap()
{
- return values;
+ this(new HashMap());
}
- /** . */
- protected final Map values;
-
public SimplePropertyMap(int size)
{
this(new HashMap(size));
}
- public SimplePropertyMap()
+ public SimplePropertyMap(PropertyMap that)
{
this(new HashMap());
- }
- public SimplePropertyMap(PropertyMap that)
- {
- this();
+ //
if (that == null)
{
throw new IllegalArgumentException();
}
+
+ //
putAll(that);
}
public SimplePropertyMap(Map map)
{
- if (map == null)
- {
- throw new IllegalArgumentException();
- }
- this.values = map;
+ super(map);
}
}
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java 2007-03-12
15:48:06 UTC (rev 6642)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java 2007-03-12
16:48:34 UTC (rev 6643)
@@ -26,8 +26,8 @@
import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.support.info.PortletInfoSupport;
-import org.jboss.portal.portlet.impl.state.StateConverterService;
import org.jboss.portal.portlet.impl.state.StateManagementPolicyService;
+import org.jboss.portal.portlet.impl.state.StateConverterV0;
import org.jboss.portal.portlet.impl.state.consumer.ConsumerPersistenceManagerService;
import
org.jboss.portal.portlet.impl.state.producer.PortletStatePersistenceManagerService;
import org.jboss.portal.portlet.invocation.ActionInvocation;
@@ -35,6 +35,7 @@
import org.jboss.portal.portlet.state.AccessMode;
import org.jboss.portal.portlet.state.PropertyChange;
import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.StateConverter;
import org.jboss.portal.portlet.state.consumer.ConsumerPortletInvoker;
import org.jboss.portal.portlet.state.producer.ProducerPortletInvoker;
import org.jboss.portal.portlet.test.ActionContextImpl;
@@ -81,7 +82,7 @@
protected StateManagementPolicyService stateManagementPolicy;
/** . */
- protected StateConverterService stateConverter;
+ protected StateConverter stateConverter;
protected void setUp() throws Exception
{
@@ -91,7 +92,7 @@
container = new PortletInvokerSupport();
portletStatePersistenceManager = new PortletStatePersistenceManagerService();
stateManagementPolicy = new StateManagementPolicyService();
- stateConverter = new StateConverterService();
+ stateConverter = new StateConverterV0();
//
stateManagementPolicy.setPersistLocally(persistLocally);
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java 2007-03-12
15:48:06 UTC (rev 6642)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java 2007-03-12
16:48:34 UTC (rev 6643)
@@ -25,14 +25,15 @@
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.impl.state.StateConverterService;
import org.jboss.portal.portlet.impl.state.StateManagementPolicyService;
+import org.jboss.portal.portlet.impl.state.StateConverterV0;
import
org.jboss.portal.portlet.impl.state.producer.PortletStatePersistenceManagerService;
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.state.AccessMode;
import org.jboss.portal.portlet.state.PropertyChange;
import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.StateConverter;
import org.jboss.portal.portlet.state.producer.ProducerPortletInvoker;
import org.jboss.portal.portlet.test.ActionContextImpl;
import org.jboss.portal.portlet.test.InstanceContextImpl;
@@ -73,7 +74,7 @@
protected StateManagementPolicyService stateManagementPolicy;
/** . */
- protected StateConverterService stateConverter;
+ protected StateConverter stateConverter;
protected void setUp() throws Exception
{
@@ -81,7 +82,7 @@
container = new PortletInvokerSupport();
persistenceManager = new PortletStatePersistenceManagerService();
stateManagementPolicy = new StateManagementPolicyService();
- stateConverter = new StateConverterService();
+ stateConverter = new StateConverterV0();
//
stateManagementPolicy.setPersistLocally(persistLocally);
Modified: trunk/server/src/main/org/jboss/portal/server/AbstractServerURL.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/server/AbstractServerURL.java 2007-03-12
15:48:06 UTC (rev 6642)
+++ trunk/server/src/main/org/jboss/portal/server/AbstractServerURL.java 2007-03-12
16:48:34 UTC (rev 6643)
@@ -41,13 +41,7 @@
private Map parameters = new HashMap();
/** . */
- private ParameterMap map = new ParameterMap()
- {
- protected Map getDelegate()
- {
- return parameters;
- }
- };
+ private ParameterMap map = new ParameterMap(parameters);
public void setPortalRequestPath(String portalRequestPath)
{
Modified:
trunk/server/src/main/org/jboss/portal/server/impl/ServerInvocationContextImpl.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/server/impl/ServerInvocationContextImpl.java 2007-03-12
15:48:06 UTC (rev 6642)
+++
trunk/server/src/main/org/jboss/portal/server/impl/ServerInvocationContextImpl.java 2007-03-12
16:48:34 UTC (rev 6643)
@@ -110,8 +110,8 @@
this.portalRequestPath = portalRequestPath;
this.portalContextPath = portalContextPath;
this.portalHost = portalHost;
- this.queryParameterMap = new InternalParameterMap(queryParameterMap);
- this.bodyParameterMap = bodyParameterMap != null ? new
InternalParameterMap(bodyParameterMap) : null;
+ this.queryParameterMap = new ParameterMap(queryParameterMap);
+ this.bodyParameterMap = bodyParameterMap != null ? new
ParameterMap(bodyParameterMap) : null;
this.urlContext = urlContext;
this.mediaType = mediaType;
this.buffers = new Buffer[16];
@@ -283,21 +283,4 @@
return s;
}
}
-
- private static class InternalParameterMap extends ParameterMap
- {
-
- /** . */
- private Map delegate;
-
- public InternalParameterMap(Map delegate)
- {
- this.delegate = delegate;
- }
-
- protected Map getDelegate()
- {
- return delegate;
- }
- }
}
Modified:
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2007-03-12
15:48:06 UTC (rev 6642)
+++
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2007-03-12
16:48:34 UTC (rev 6643)
@@ -123,7 +123,7 @@
<attribute name="PersistLocally">true</attribute>
</mbean>
<mbean
- code="org.jboss.portal.portlet.impl.state.StateConverterService"
+ code="org.jboss.portal.portlet.impl.state.StateConverterV0"
name="portal:service=StateConverter,type=Producer"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">