[portal-commits] JBoss Portal SVN: r5873 - in trunk: core/src/main/org/jboss/portal/core/impl/portlet/state core/src/main/org/jboss/portal/test/core/model/instance core/src/main/org/jboss/portal/test/core/state core/src/resources/portal-core-sar/META-INF core/src/resources/portal-core-sar/conf/hibernate/portlet core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/model/instance core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/state portlet/src/main/org/jboss/portal/portlet/impl/state portlet/src/main/org/jboss/portal/portlet/impl/state/producer portlet/src/main/org/jboss/portal/portlet/state portlet/src/main/org/jboss/portal/portlet/state/producer portlet/src/main/org/jboss/portal/test/portlet/state portlet/src/resources/tck-sar/META-INF portlet/src/resources/test-sar/META-INF wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Fri Dec 15 12:31:49 EST 2006


Author: julien at jboss.com
Date: 2006-12-15 12:31:20 -0500 (Fri, 15 Dec 2006)
New Revision: 5873

Added:
   trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentPortletState.java
   trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentPortletStateEntry.java
   trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentPortletStatePersistenceManager.java
   trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/PortletStateContextImpl.java
   trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/PortletStatePersistenceManagerService.java
   trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletState.java
   trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletStateContext.java
   trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletStatePersistenceManager.java
Removed:
   trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentState.java
   trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentStateEntry.java
   trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentStateStore.java
   trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/ProducerPersistenceManagerService.java
   trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/ProducerStateContextImpl.java
   trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPersistenceManager.java
   trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerState.java
   trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerStateContext.java
Modified:
   trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentConsumerGroup.java
   trunk/core/src/main/org/jboss/portal/test/core/model/instance/InstanceContainerTestCase.java
   trunk/core/src/main/org/jboss/portal/test/core/state/ProducerTestCase.java
   trunk/core/src/main/org/jboss/portal/test/core/state/RegistrationPersistenceManagerTestCase.java
   trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
   trunk/core/src/resources/portal-core-sar/conf/hibernate/portlet/domain.hbm.xml
   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/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/state/registration-persistence-manager-beans.xml
   trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/StateConverterService.java
   trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/StateConverterV0.java
   trunk/portlet/src/main/org/jboss/portal/portlet/state/StateConverter.java
   trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.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/portlet/src/main/org/jboss/portal/test/portlet/state/StateConverterV0TestCase.java
   trunk/portlet/src/resources/tck-sar/META-INF/jboss-service.xml
   trunk/portlet/src/resources/test-sar/META-INF/jboss-service.xml
   trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
Log:
Better name for producer state : PortletState

Modified: trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentConsumerGroup.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentConsumerGroup.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentConsumerGroup.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -53,9 +53,9 @@
 
    // Context
 
-   private PersistentStateStore context;
+   private PersistentPortletStatePersistenceManager context;
 
-   public PersistentConsumerGroup(PersistentStateStore context, String name)
+   public PersistentConsumerGroup(PersistentPortletStatePersistenceManager context, String name)
    {
       this.key = null;
       this.persistentName = name;
@@ -77,7 +77,7 @@
 
    public void setContext(Object context)
    {
-      this.context = (PersistentStateStore)context;
+      this.context = (PersistentPortletStatePersistenceManager)context;
    }
 
    // Hibernate

Copied: trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentPortletState.java (from rev 5872, trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentState.java)
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentState.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentPortletState.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -0,0 +1,220 @@
+/******************************************************************************
+ * 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.state;
+
+import org.jboss.portal.common.value.Value;
+import org.jboss.portal.portlet.state.AbstractPropertyMap;
+import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.producer.PortletStateContext;
+import org.jboss.portal.portlet.state.producer.PortletState;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class PersistentPortletState implements PortletStateContext
+{
+
+   /** The primary key. */
+   protected Long key;
+
+   /** The portlet id. */
+   protected String portletId;
+
+   /** The different entries. */
+   protected Map entries;
+
+   /** When the state has been created. */
+   protected Date creationTime;
+
+   /** When the state expires, a null value means there is no expiration date scheduled. */
+   protected Date terminationTime;
+
+   /** For now a registration id, later probably a one to many relationship with a registration entry. */
+   protected Long registrationId;
+
+   /** The clones of this state. */
+   protected Set children;
+
+   /** The state that we cloned from. */
+   protected PersistentPortletState parent;
+
+   /** . */
+   private PortletState ctx;
+
+   public PersistentPortletState()
+   {
+      this.key = null;
+      this.portletId = null;
+      this.entries = null;
+      this.creationTime = null;
+      this.terminationTime = null;
+      this.registrationId = null;
+      this.children = null;
+      this.parent = null;
+      this.ctx = null;
+   }
+
+   public PersistentPortletState(String portletId, PropertyMap propertyMap)
+   {
+      this.key = null;
+      this.portletId = portletId;
+      this.entries = new HashMap();
+      this.creationTime = Calendar.getInstance().getTime();
+      this.terminationTime = null;
+      this.registrationId = null;
+      this.children = new HashSet();
+      this.parent = null;
+      this.ctx = null;
+
+      //
+      for (Iterator i = propertyMap.keySet().iterator(); i.hasNext();)
+      {
+         String key = (String)i.next();
+         Value value = propertyMap.getProperty(key);
+         entries.put(key, new PersistentPortletStateEntry(key, value));
+      }
+   }
+
+   public Long getKey()
+   {
+      return key;
+   }
+
+   public void setKey(Long key)
+   {
+      this.key = key;
+   }
+
+   public String getId()
+   {
+      return key.toString();
+   }
+
+   public String getPortletId()
+   {
+      return portletId;
+   }
+
+   public void setPortletId(String portletId)
+   {
+      this.portletId = portletId;
+   }
+
+   public Map getEntries()
+   {
+      return entries;
+   }
+
+   public void setEntries(Map entries)
+   {
+      this.entries = entries;
+   }
+
+   public Date getCreationTime()
+   {
+      return creationTime;
+   }
+
+   public void setCreationTime(Date creationTime)
+   {
+      this.creationTime = creationTime;
+   }
+
+   public Date getTerminationTime()
+   {
+      return terminationTime;
+   }
+
+   public void setTerminationTime(Date terminationTime)
+   {
+      this.terminationTime = terminationTime;
+   }
+
+   public Long getRegistrationId()
+   {
+      return registrationId;
+   }
+
+   public void setRegistrationId(Long registrationId)
+   {
+      this.registrationId = registrationId;
+   }
+
+   public Set getChildren()
+   {
+      return children;
+   }
+
+   public void setChildren(Set children)
+   {
+      this.children = children;
+   }
+
+   public PersistentPortletState getParent()
+   {
+      return parent;
+   }
+
+   public void setParent(PersistentPortletState parent)
+   {
+      this.parent = parent;
+   }
+
+   //
+
+   public PortletState getState()
+   {
+      if (ctx == null)
+      {
+         PropertyMap props = new AbstractPropertyMap()
+         {
+            protected Map getDelegate()
+            {
+               return entries;
+            }
+
+            protected Object getInternalValue(Object value)
+            {
+               throw new IllegalArgumentException("Immutable");
+            }
+
+            protected Object getExternalValue(Object value)
+            {
+               PersistentPortletStateEntry entry = (PersistentPortletStateEntry)value;
+               return entry.getValue();
+            }
+         };
+         ctx = new PortletState(portletId, props);
+      }
+      return ctx;
+   }
+}


Property changes on: trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentPortletState.java
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Copied: trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentPortletStateEntry.java (from rev 5872, trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentStateEntry.java)
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentStateEntry.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentPortletStateEntry.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -0,0 +1,190 @@
+/******************************************************************************
+ * 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.state;
+
+import org.jboss.portal.common.value.StringValue;
+import org.jboss.portal.common.value.Value;
+
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class PersistentPortletStateEntry implements Serializable
+{
+
+   /** The primary key. */
+   private Long key;
+
+   /** The name. */
+   private String name;
+
+   /** The access mode. */
+   private boolean readOnly;
+
+   /** The preference type. */
+   private int type;
+
+   /** The preference values. */
+   private String[] strings;
+
+   /** The value implementation. */
+   private Value value;
+
+   // This flag is used because the value is made up of strings and type
+   // and it is not possible to update the value when strings or type
+   // is updated, so when strings of type is modified with set dirty
+   private boolean dirty;
+
+   public PersistentPortletStateEntry()
+   {
+      this.key = null;
+      this.name = null;
+      this.readOnly = false;
+      this.type = 0;
+      this.strings = null;
+      this.value = null;
+      this.dirty = false;
+   }
+
+   public PersistentPortletStateEntry(String name, Value value)
+   {
+      if (value == null)
+      {
+         throw new IllegalArgumentException();
+      }
+      this.key = null;
+      this.name = name;
+      this.readOnly = false;
+      this.type = 1;
+      this.strings = value.asStringArray();
+      this.value = value;
+      this.dirty = false;
+   }
+
+   public Long getKey()
+   {
+      return key;
+   }
+
+   public void setKey(Long key)
+   {
+      this.key = key;
+   }
+
+   /**
+    *
+    */
+   public String getName()
+   {
+      return name;
+   }
+
+   /** Called by hibernate. */
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   /**
+    *
+    */
+   public int getType()
+   {
+      return type;
+   }
+
+   /** Called by hibernate. */
+   public void setType(int type)
+   {
+      this.type = type;
+      this.dirty = true;
+   }
+
+   public boolean isReadOnly()
+   {
+      return readOnly;
+   }
+
+   public void setReadOnly(boolean readOnly)
+   {
+      this.readOnly = readOnly;
+   }
+
+   /**
+    *
+    */
+   public String[] getStrings()
+   {
+      return strings;
+   }
+
+   /** Called by hibernate. */
+   public void setStrings(String[] strings)
+   {
+      this.strings = strings;
+      this.dirty = true;
+   }
+
+   public Value getValue()
+   {
+      if (dirty)
+      {
+         value = new StringValue(strings);
+         dirty = false;
+      }
+      return value;
+   }
+
+   /**
+    *
+    */
+   public void setValue(Value value)
+   {
+      this.value = value;
+      this.strings = value.asStringArray();
+   }
+
+   /** Provide a default impl. */
+   public String toString()
+   {
+      StringBuffer buffer = new StringBuffer("[").append(name).append(",");
+      if (strings == null)
+      {
+         buffer.append("null,");
+      }
+      else
+      {
+         buffer.append("(");
+         for (int i = 0; i < strings.length; i++)
+         {
+            String s = strings[i];
+            buffer.append(i > 0 ? "," : "").append(s);
+         }
+         buffer.append("),");
+      }
+      buffer.append(value).append("]");
+      return buffer.toString();
+   }
+}


Property changes on: trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentPortletStateEntry.java
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Copied: trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentPortletStatePersistenceManager.java (from rev 5872, trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentStateStore.java)
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentStateStore.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentPortletStatePersistenceManager.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -0,0 +1,513 @@
+/******************************************************************************
+ * 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.state;
+
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.jboss.portal.common.value.Value;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.jems.hibernate.ObjectContextualizer;
+import org.jboss.portal.portlet.state.InvalidStateIdException;
+import org.jboss.portal.portlet.state.NoSuchStateException;
+import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.SimplePropertyMap;
+import org.jboss.portal.portlet.state.producer.PortletStatePersistenceManager;
+import org.jboss.portal.portlet.state.producer.PortletStateContext;
+import org.jboss.portal.registration.Consumer;
+import org.jboss.portal.registration.ConsumerGroup;
+import org.jboss.portal.registration.DuplicateRegistrationException;
+import org.jboss.portal.registration.NoSuchRegistrationException;
+import org.jboss.portal.registration.Registration;
+import org.jboss.portal.registration.RegistrationException;
+import org.jboss.portal.registration.RegistrationPersistenceManager;
+import org.jboss.portal.registration.RegistrationStatus;
+
+import javax.naming.InitialContext;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class PersistentPortletStatePersistenceManager extends AbstractJBossService implements PortletStatePersistenceManager, RegistrationPersistenceManager
+{
+
+   /** . */
+   protected SessionFactory sessionFactory;
+
+   /** . */
+   protected String sessionFactoryJNDIName;
+
+   /** . */
+   protected ObjectContextualizer contextualizer;
+
+   public String getSessionFactoryJNDIName()
+   {
+      return sessionFactoryJNDIName;
+   }
+
+   public void setSessionFactoryJNDIName(String sessionFactoryJNDIName)
+   {
+      this.sessionFactoryJNDIName = sessionFactoryJNDIName;
+   }
+
+   public PortletStateContext loadState(String id) throws InvalidStateIdException, NoSuchStateException
+   {
+      Session session = getCurrentSession();
+      return loadState(session, id);
+   }
+
+   public String createState(String portletId, PropertyMap propertyMap)
+   {
+      if (portletId == null)
+      {
+         throw new IllegalArgumentException("id cannot be null");
+      }
+      if (propertyMap == null)
+      {
+         throw new IllegalArgumentException("No null value map accepted");
+      }
+
+      //
+      Session session = getCurrentSession();
+
+      // Create the persistent state
+      PersistentPortletState context = new PersistentPortletState(portletId, propertyMap);
+      session.save(context);
+      session.flush();
+
+      //
+      return context.getId();
+   }
+
+   public String cloneState(String stateId, PropertyMap propertyMap) throws InvalidStateIdException, NoSuchStateException
+   {
+      if (stateId == null)
+      {
+         throw new IllegalArgumentException("id cannot be null");
+      }
+      if (propertyMap == null)
+      {
+         throw new IllegalArgumentException("value map cannot be null");
+      }
+
+      //
+      Session session = getCurrentSession();
+      PersistentPortletState parentContext = loadState(session, stateId);
+
+      // Create the persistent state
+      PersistentPortletState context = new PersistentPortletState(parentContext.getPortletId(), propertyMap);
+      session.persist(context);
+
+      // Make the association
+      context.setParent(parentContext);
+      parentContext.getChildren().add(context);
+      session.update(parentContext);
+
+      //
+      session.flush();
+
+      //
+      return context.getId();
+   }
+
+   public String cloneState(String stateId) throws IllegalArgumentException, NoSuchStateException, InvalidStateIdException
+   {
+      if (stateId == null)
+      {
+         throw new IllegalArgumentException("id cannot be null");
+      }
+
+      //
+      Session session = getCurrentSession();
+      PersistentPortletState parentContext = loadState(session, stateId);
+
+      // Create the persistent state
+      PersistentPortletState context = new PersistentPortletState(parentContext.getPortletId(), new SimplePropertyMap(parentContext.getState().getProperties()));
+      session.persist(context);
+
+      // Make the association
+      context.setParent(parentContext);
+      parentContext.getChildren().add(context);
+      session.update(parentContext);
+
+      //
+      session.flush();
+
+      //
+      return context.getId();
+   }
+
+   public void updateState(String stateId, PropertyMap propertyMap) throws InvalidStateIdException, NoSuchStateException
+   {
+      Session session = getCurrentSession();
+      PersistentPortletState context = loadState(session, stateId);
+
+      //
+      context.entries.clear();
+      for (Iterator i = propertyMap.keySet().iterator(); i.hasNext();)
+      {
+         String key = (String)i.next();
+         Value value = propertyMap.getProperty(key);
+         PersistentPortletStateEntry entry = new PersistentPortletStateEntry(key, value);
+         context.entries.put(key, entry);
+      }
+
+      //
+      session.update(context);
+   }
+
+   public void destroyState(String stateId) throws InvalidStateIdException, NoSuchStateException
+   {
+      if (stateId == null)
+      {
+         throw new IllegalArgumentException("No null state id accepted");
+      }
+
+      //
+      Session session = getCurrentSession();
+      PersistentPortletState context = loadState(session, stateId);
+
+      // Efficiently set the children parent to null
+      String update = "update PersistentPortletState p set p.parent=NULL where p.parent=:parent";
+      Query query = session.createQuery(update).setLong("parent", context.getKey().longValue());
+      query.executeUpdate();
+
+      // Delete the state
+      session.delete(context);
+      session.flush();
+   }
+
+   protected void startService() throws Exception
+   {
+      sessionFactory = (SessionFactory)new InitialContext().lookup(sessionFactoryJNDIName);
+      contextualizer = new ObjectContextualizer(this);
+      contextualizer.attach(sessionFactory);
+   }
+
+   protected void stopService() throws Exception
+   {
+      contextualizer = null;
+      sessionFactory = null;
+   }
+
+   protected Session getCurrentSession()
+   {
+      return sessionFactory.getCurrentSession();
+   }
+
+   private PersistentPortletState loadState(Session session, String stateId) throws NoSuchStateException, InvalidStateIdException
+   {
+      if (stateId == null)
+      {
+         throw new IllegalArgumentException("id cannot be null");
+      }
+
+      try
+      {
+         Long key = new Long(stateId);
+         PersistentPortletState context = (PersistentPortletState)session.get(PersistentPortletState.class, key);
+
+         //
+         if (context == null)
+         {
+            throw new NoSuchStateException(stateId);
+         }
+
+         //
+         return context;
+      }
+      catch (NumberFormatException e)
+      {
+         throw new InvalidStateIdException(e, stateId);
+      }
+   }
+
+   // RegistrationPersistenceManager ***********************************************************************************
+
+
+   public Consumer createConsumer(String consumerId, String consumerName) throws RegistrationException
+   {
+      if (consumerId == null)
+      {
+         throw new IllegalArgumentException("No null consumer id accepted");
+      }
+      if (consumerName == null)
+      {
+         throw new IllegalArgumentException("No null consumer name accepted");
+      }
+
+      // Get hibernate session
+      Session session = getCurrentSession();
+
+      //
+      PersistentConsumer consumer = new PersistentConsumer(consumerId, consumerName);
+      session.persist(consumer);
+
+      //
+      return consumer;
+   }
+
+   public ConsumerGroup getConsumerGroup(String name) throws RegistrationException
+   {
+      // Get hibernate session
+      Session session = getCurrentSession();
+
+      //
+      return findGroupByName(session, name);
+   }
+
+   public ConsumerGroup createConsumerGroup(String name) throws RegistrationException
+   {
+      if (name == null)
+      {
+         throw new IllegalArgumentException("No null name accepted");
+      }
+
+      // Get hibernate session
+      Session session = getCurrentSession();
+      PersistentConsumerGroup group = null;
+
+      // Detect duplicate
+      if (findGroupByName(session, name) != null)
+      {
+         throw new DuplicateRegistrationException("Group " + name + " already exists");
+      }
+
+      // Create and persist
+      group = new PersistentConsumerGroup(this, name);
+      session.persist(group);
+
+      //
+      return group;
+   }
+
+   public void removeConsumerGroup(String name) throws RegistrationException
+   {
+      // Get hibernate session
+      Session session = getCurrentSession();
+
+      //
+      PersistentConsumerGroup group = getGroupByName(session, name);
+
+      //
+      session.delete(group);
+   }
+
+   public void removeConsumer(String consumerId) throws RegistrationException
+   {
+      // Get hibernate session
+      Session session = getCurrentSession();
+
+      //
+      PersistentConsumer consumer = getConsumerById(session, consumerId);
+
+      //
+      session.delete(consumer);
+   }
+
+   public void removeRegistration(String registrationId) throws RegistrationException
+   {
+      if (registrationId == null)
+      {
+         throw new IllegalArgumentException("No null registration id accepted");
+      }
+
+      // Get hibernate session
+      Session session = getCurrentSession();
+
+      //
+      PersistentRegistration registration = getRegistrationById(session, registrationId);
+
+      // Get related consumer
+      PersistentConsumer consumer = registration.getRelatedConsumer();
+
+      // Destroy relationship
+      consumer.getRelatedRegistrations().remove(registration);
+      registration.setRelatedConsumer(null);
+
+      // Delete the registration
+      session.delete(registration);
+      session.flush();
+   }
+
+   public Consumer getConsumerById(String consumerId) throws RegistrationException
+   {
+      // Get hibernate session
+      Session session = getCurrentSession();
+
+      //
+      return findConsumerById(session, consumerId);
+   }
+
+   public Registration addRegistrationFor(String consumerId, Map registrationProperties) throws RegistrationException
+   {
+      if (registrationProperties == null)
+      {
+         throw new IllegalArgumentException("No null registration properties accepted");
+      }
+
+      // Get hibernate session
+      Session session = getCurrentSession();
+
+      // Perform lookup
+      PersistentConsumer consumer = getConsumerById(session, consumerId);
+
+      // Create and persist registration and build relationship
+      PersistentRegistration registration = new PersistentRegistration(registrationProperties, RegistrationStatus.PENDING);
+      registration.setRelatedConsumer(consumer);
+      consumer.getRelatedRegistrations().add(registration);
+      session.persist(registration);
+      session.saveOrUpdate(consumer);
+
+      //
+      return registration;
+   }
+
+   public Registration getRegistration(String registrationId)
+   {
+      // Get hibernate session
+      Session session = getCurrentSession();
+
+      //
+      return findRegistrationById(session, registrationId);
+   }
+
+   public Consumer addConsumerToGroupNamed(String consumerId, String groupName) throws RegistrationException
+   {
+      Consumer consumer = getConsumerById(consumerId);
+
+      // Build relationship
+      ConsumerGroup group = getConsumerGroup(groupName);
+      consumer.setGroup(group);
+
+      //
+      return consumer;
+   }
+
+   public Collection getConsumerGroups()
+   {
+      Session session = getCurrentSession();
+      Query query = session.createQuery("from PersistentConsumerGroup");
+      return query.list();
+   }
+
+   public Collection getConsumers()
+   {
+      Session session = getCurrentSession();
+      Query query = session.createQuery("from PersistentConsumer");
+      return query.list();
+   }
+
+   private PersistentRegistration getRegistrationById(Session session, String registrationId) throws IllegalArgumentException, NoSuchRegistrationException
+   {
+      PersistentRegistration registration = findRegistrationById(session, registrationId);
+
+      //
+      if (registration == null)
+      {
+         throw new NoSuchRegistrationException("Cant find a consumer with the id " + registrationId);
+      }
+
+      //
+      return registration;
+   }
+
+   private PersistentRegistration findRegistrationById(Session session, String registrationId) throws IllegalArgumentException
+   {
+      if (registrationId == null)
+      {
+         throw new IllegalArgumentException("No null consumer id accepted");
+      }
+
+      try
+      {
+         // Parse the key
+         Long key = new Long(registrationId);
+
+         // Perform lookup
+         return (PersistentRegistration)session.get(PersistentRegistration.class, key);
+      }
+      catch (NumberFormatException e)
+      {
+         throw new IllegalArgumentException("Bad registration id format " + registrationId);
+      }
+   }
+
+   private PersistentConsumer getConsumerById(Session session, String consumerId) throws IllegalArgumentException, NoSuchRegistrationException
+   {
+      PersistentConsumer consumer = findConsumerById(session, consumerId);
+
+      //
+      if (consumer == null)
+      {
+         throw new NoSuchRegistrationException("Cant find a consumer with the id " + consumerId);
+      }
+
+      //
+      return consumer;
+   }
+
+   private PersistentConsumer findConsumerById(Session session, String consumerId) throws IllegalArgumentException
+   {
+      if (consumerId == null)
+      {
+         throw new IllegalArgumentException("No null consumer id accepted");
+      }
+
+      //
+      Query query = session.createQuery("from PersistentConsumer where persistentId=:consumerId");
+      query.setString("consumerId", consumerId);
+      return (PersistentConsumer)query.uniqueResult();
+   }
+
+   private PersistentConsumerGroup getGroupByName(Session session, String groupName) throws IllegalArgumentException, NoSuchRegistrationException
+   {
+      PersistentConsumerGroup group = findGroupByName(session, groupName);
+
+      //
+      if (group == null)
+      {
+         throw new NoSuchRegistrationException("Cant find a group with the name " + groupName);
+      }
+
+      //
+      return group;
+   }
+
+   private PersistentConsumerGroup findGroupByName(Session session, String groupName) throws IllegalArgumentException
+   {
+      if (groupName == null)
+      {
+         throw new IllegalArgumentException("No null group name accepted");
+      }
+
+      //
+      Query query = session.createQuery("from PersistentConsumerGroup where persistentName=:groupName");
+      query.setString("groupName", groupName);
+      return (PersistentConsumerGroup)query.uniqueResult();
+   }
+}


Property changes on: trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentPortletStatePersistenceManager.java
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Deleted: trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentState.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentState.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentState.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -1,220 +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.core.impl.portlet.state;
-
-import org.jboss.portal.common.value.Value;
-import org.jboss.portal.portlet.state.AbstractPropertyMap;
-import org.jboss.portal.portlet.state.PropertyMap;
-import org.jboss.portal.portlet.state.producer.ProducerStateContext;
-import org.jboss.portal.portlet.state.producer.ProducerState;
-
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class PersistentState implements ProducerStateContext
-{
-
-   /** The primary key. */
-   protected Long key;
-
-   /** The portlet id. */
-   protected String portletId;
-
-   /** The different entries. */
-   protected Map entries;
-
-   /** When the state has been created. */
-   protected Date creationTime;
-
-   /** When the state expires, a null value means there is no expiration date scheduled. */
-   protected Date terminationTime;
-
-   /** For now a registration id, later probably a one to many relationship with a registration entry. */
-   protected Long registrationId;
-
-   /** The clones of this state. */
-   protected Set children;
-
-   /** The state that we cloned from. */
-   protected PersistentState parent;
-
-   /** . */
-   private ProducerState ctx;
-
-   public PersistentState()
-   {
-      this.key = null;
-      this.portletId = null;
-      this.entries = null;
-      this.creationTime = null;
-      this.terminationTime = null;
-      this.registrationId = null;
-      this.children = null;
-      this.parent = null;
-      this.ctx = null;
-   }
-
-   public PersistentState(String portletId, PropertyMap propertyMap)
-   {
-      this.key = null;
-      this.portletId = portletId;
-      this.entries = new HashMap();
-      this.creationTime = Calendar.getInstance().getTime();
-      this.terminationTime = null;
-      this.registrationId = null;
-      this.children = new HashSet();
-      this.parent = null;
-      this.ctx = null;
-
-      //
-      for (Iterator i = propertyMap.keySet().iterator(); i.hasNext();)
-      {
-         String key = (String)i.next();
-         Value value = propertyMap.getProperty(key);
-         entries.put(key, new PersistentStateEntry(key, value));
-      }
-   }
-
-   public Long getKey()
-   {
-      return key;
-   }
-
-   public void setKey(Long key)
-   {
-      this.key = key;
-   }
-
-   public String getId()
-   {
-      return key.toString();
-   }
-
-   public String getPortletId()
-   {
-      return portletId;
-   }
-
-   public void setPortletId(String portletId)
-   {
-      this.portletId = portletId;
-   }
-
-   public Map getEntries()
-   {
-      return entries;
-   }
-
-   public void setEntries(Map entries)
-   {
-      this.entries = entries;
-   }
-
-   public Date getCreationTime()
-   {
-      return creationTime;
-   }
-
-   public void setCreationTime(Date creationTime)
-   {
-      this.creationTime = creationTime;
-   }
-
-   public Date getTerminationTime()
-   {
-      return terminationTime;
-   }
-
-   public void setTerminationTime(Date terminationTime)
-   {
-      this.terminationTime = terminationTime;
-   }
-
-   public Long getRegistrationId()
-   {
-      return registrationId;
-   }
-
-   public void setRegistrationId(Long registrationId)
-   {
-      this.registrationId = registrationId;
-   }
-
-   public Set getChildren()
-   {
-      return children;
-   }
-
-   public void setChildren(Set children)
-   {
-      this.children = children;
-   }
-
-   public PersistentState getParent()
-   {
-      return parent;
-   }
-
-   public void setParent(PersistentState parent)
-   {
-      this.parent = parent;
-   }
-
-   //
-
-   public ProducerState getState()
-   {
-      if (ctx == null)
-      {
-         PropertyMap props = new AbstractPropertyMap()
-         {
-            protected Map getDelegate()
-            {
-               return entries;
-            }
-
-            protected Object getInternalValue(Object value)
-            {
-               throw new IllegalArgumentException("Immutable");
-            }
-
-            protected Object getExternalValue(Object value)
-            {
-               PersistentStateEntry entry = (PersistentStateEntry)value;
-               return entry.getValue();
-            }
-         };
-         ctx = new ProducerState(portletId, props);
-      }
-      return ctx;
-   }
-}

Deleted: trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentStateEntry.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentStateEntry.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentStateEntry.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -1,190 +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.core.impl.portlet.state;
-
-import org.jboss.portal.common.value.StringValue;
-import org.jboss.portal.common.value.Value;
-
-import java.io.Serializable;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class PersistentStateEntry implements Serializable
-{
-
-   /** The primary key. */
-   private Long key;
-
-   /** The name. */
-   private String name;
-
-   /** The access mode. */
-   private boolean readOnly;
-
-   /** The preference type. */
-   private int type;
-
-   /** The preference values. */
-   private String[] strings;
-
-   /** The value implementation. */
-   private Value value;
-
-   // This flag is used because the value is made up of strings and type
-   // and it is not possible to update the value when strings or type
-   // is updated, so when strings of type is modified with set dirty
-   private boolean dirty;
-
-   public PersistentStateEntry()
-   {
-      this.key = null;
-      this.name = null;
-      this.readOnly = false;
-      this.type = 0;
-      this.strings = null;
-      this.value = null;
-      this.dirty = false;
-   }
-
-   public PersistentStateEntry(String name, Value value)
-   {
-      if (value == null)
-      {
-         throw new IllegalArgumentException();
-      }
-      this.key = null;
-      this.name = name;
-      this.readOnly = false;
-      this.type = 1;
-      this.strings = value.asStringArray();
-      this.value = value;
-      this.dirty = false;
-   }
-
-   public Long getKey()
-   {
-      return key;
-   }
-
-   public void setKey(Long key)
-   {
-      this.key = key;
-   }
-
-   /**
-    *
-    */
-   public String getName()
-   {
-      return name;
-   }
-
-   /** Called by hibernate. */
-   public void setName(String name)
-   {
-      this.name = name;
-   }
-
-   /**
-    *
-    */
-   public int getType()
-   {
-      return type;
-   }
-
-   /** Called by hibernate. */
-   public void setType(int type)
-   {
-      this.type = type;
-      this.dirty = true;
-   }
-
-   public boolean isReadOnly()
-   {
-      return readOnly;
-   }
-
-   public void setReadOnly(boolean readOnly)
-   {
-      this.readOnly = readOnly;
-   }
-
-   /**
-    *
-    */
-   public String[] getStrings()
-   {
-      return strings;
-   }
-
-   /** Called by hibernate. */
-   public void setStrings(String[] strings)
-   {
-      this.strings = strings;
-      this.dirty = true;
-   }
-
-   public Value getValue()
-   {
-      if (dirty)
-      {
-         value = new StringValue(strings);
-         dirty = false;
-      }
-      return value;
-   }
-
-   /**
-    *
-    */
-   public void setValue(Value value)
-   {
-      this.value = value;
-      this.strings = value.asStringArray();
-   }
-
-   /** Provide a default impl. */
-   public String toString()
-   {
-      StringBuffer buffer = new StringBuffer("[").append(name).append(",");
-      if (strings == null)
-      {
-         buffer.append("null,");
-      }
-      else
-      {
-         buffer.append("(");
-         for (int i = 0; i < strings.length; i++)
-         {
-            String s = strings[i];
-            buffer.append(i > 0 ? "," : "").append(s);
-         }
-         buffer.append("),");
-      }
-      buffer.append(value).append("]");
-      return buffer.toString();
-   }
-}

Deleted: trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentStateStore.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentStateStore.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentStateStore.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -1,513 +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.core.impl.portlet.state;
-
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.jboss.portal.common.value.Value;
-import org.jboss.portal.jems.as.system.AbstractJBossService;
-import org.jboss.portal.jems.hibernate.ObjectContextualizer;
-import org.jboss.portal.portlet.state.InvalidStateIdException;
-import org.jboss.portal.portlet.state.NoSuchStateException;
-import org.jboss.portal.portlet.state.PropertyMap;
-import org.jboss.portal.portlet.state.SimplePropertyMap;
-import org.jboss.portal.portlet.state.producer.ProducerPersistenceManager;
-import org.jboss.portal.portlet.state.producer.ProducerStateContext;
-import org.jboss.portal.registration.Consumer;
-import org.jboss.portal.registration.ConsumerGroup;
-import org.jboss.portal.registration.DuplicateRegistrationException;
-import org.jboss.portal.registration.NoSuchRegistrationException;
-import org.jboss.portal.registration.Registration;
-import org.jboss.portal.registration.RegistrationException;
-import org.jboss.portal.registration.RegistrationPersistenceManager;
-import org.jboss.portal.registration.RegistrationStatus;
-
-import javax.naming.InitialContext;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class PersistentStateStore extends AbstractJBossService implements ProducerPersistenceManager, RegistrationPersistenceManager
-{
-
-   /** . */
-   protected SessionFactory sessionFactory;
-
-   /** . */
-   protected String sessionFactoryJNDIName;
-
-   /** . */
-   protected ObjectContextualizer contextualizer;
-
-   public String getSessionFactoryJNDIName()
-   {
-      return sessionFactoryJNDIName;
-   }
-
-   public void setSessionFactoryJNDIName(String sessionFactoryJNDIName)
-   {
-      this.sessionFactoryJNDIName = sessionFactoryJNDIName;
-   }
-
-   public ProducerStateContext loadState(String id) throws InvalidStateIdException, NoSuchStateException
-   {
-      Session session = getCurrentSession();
-      return loadState(session, id);
-   }
-
-   public String createState(String portletId, PropertyMap propertyMap)
-   {
-      if (portletId == null)
-      {
-         throw new IllegalArgumentException("id cannot be null");
-      }
-      if (propertyMap == null)
-      {
-         throw new IllegalArgumentException("No null value map accepted");
-      }
-
-      //
-      Session session = getCurrentSession();
-
-      // Create the persistent state
-      PersistentState context = new PersistentState(portletId, propertyMap);
-      session.save(context);
-      session.flush();
-
-      //
-      return context.getId();
-   }
-
-   public String cloneState(String stateId, PropertyMap propertyMap) throws InvalidStateIdException, NoSuchStateException
-   {
-      if (stateId == null)
-      {
-         throw new IllegalArgumentException("id cannot be null");
-      }
-      if (propertyMap == null)
-      {
-         throw new IllegalArgumentException("value map cannot be null");
-      }
-
-      //
-      Session session = getCurrentSession();
-      PersistentState parentContext = loadState(session, stateId);
-
-      // Create the persistent state
-      PersistentState context = new PersistentState(parentContext.getPortletId(), propertyMap);
-      session.persist(context);
-
-      // Make the association
-      context.setParent(parentContext);
-      parentContext.getChildren().add(context);
-      session.update(parentContext);
-
-      //
-      session.flush();
-
-      //
-      return context.getId();
-   }
-
-   public String cloneState(String stateId) throws IllegalArgumentException, NoSuchStateException, InvalidStateIdException
-   {
-      if (stateId == null)
-      {
-         throw new IllegalArgumentException("id cannot be null");
-      }
-
-      //
-      Session session = getCurrentSession();
-      PersistentState parentContext = loadState(session, stateId);
-
-      // Create the persistent state
-      PersistentState context = new PersistentState(parentContext.getPortletId(), new SimplePropertyMap(parentContext.getState().getProperties()));
-      session.persist(context);
-
-      // Make the association
-      context.setParent(parentContext);
-      parentContext.getChildren().add(context);
-      session.update(parentContext);
-
-      //
-      session.flush();
-
-      //
-      return context.getId();
-   }
-
-   public void updateState(String stateId, PropertyMap propertyMap) throws InvalidStateIdException, NoSuchStateException
-   {
-      Session session = getCurrentSession();
-      PersistentState context = loadState(session, stateId);
-
-      //
-      context.entries.clear();
-      for (Iterator i = propertyMap.keySet().iterator(); i.hasNext();)
-      {
-         String key = (String)i.next();
-         Value value = propertyMap.getProperty(key);
-         PersistentStateEntry entry = new PersistentStateEntry(key, value);
-         context.entries.put(key, entry);
-      }
-
-      //
-      session.update(context);
-   }
-
-   public void destroyState(String stateId) throws InvalidStateIdException, NoSuchStateException
-   {
-      if (stateId == null)
-      {
-         throw new IllegalArgumentException("No null state id accepted");
-      }
-
-      //
-      Session session = getCurrentSession();
-      PersistentState context = loadState(session, stateId);
-
-      // Efficiently set the children parent to null
-      String update = "update PersistentState p set p.parent=NULL where p.parent=:parent";
-      Query query = session.createQuery(update).setLong("parent", context.getKey().longValue());
-      query.executeUpdate();
-
-      // Delete the state
-      session.delete(context);
-      session.flush();
-   }
-
-   protected void startService() throws Exception
-   {
-      sessionFactory = (SessionFactory)new InitialContext().lookup(sessionFactoryJNDIName);
-      contextualizer = new ObjectContextualizer(this);
-      contextualizer.attach(sessionFactory);
-   }
-
-   protected void stopService() throws Exception
-   {
-      contextualizer = null;
-      sessionFactory = null;
-   }
-
-   protected Session getCurrentSession()
-   {
-      return sessionFactory.getCurrentSession();
-   }
-
-   private PersistentState loadState(Session session, String stateId) throws NoSuchStateException, InvalidStateIdException
-   {
-      if (stateId == null)
-      {
-         throw new IllegalArgumentException("id cannot be null");
-      }
-
-      try
-      {
-         Long key = new Long(stateId);
-         PersistentState context = (PersistentState)session.get(PersistentState.class, key);
-
-         //
-         if (context == null)
-         {
-            throw new NoSuchStateException(stateId);
-         }
-
-         //
-         return context;
-      }
-      catch (NumberFormatException e)
-      {
-         throw new InvalidStateIdException(e, stateId);
-      }
-   }
-
-   // RegistrationPersistenceManager ***********************************************************************************
-
-
-   public Consumer createConsumer(String consumerId, String consumerName) throws RegistrationException
-   {
-      if (consumerId == null)
-      {
-         throw new IllegalArgumentException("No null consumer id accepted");
-      }
-      if (consumerName == null)
-      {
-         throw new IllegalArgumentException("No null consumer name accepted");
-      }
-
-      // Get hibernate session
-      Session session = getCurrentSession();
-
-      //
-      PersistentConsumer consumer = new PersistentConsumer(consumerId, consumerName);
-      session.persist(consumer);
-
-      //
-      return consumer;
-   }
-
-   public ConsumerGroup getConsumerGroup(String name) throws RegistrationException
-   {
-      // Get hibernate session
-      Session session = getCurrentSession();
-
-      //
-      return findGroupByName(session, name);
-   }
-
-   public ConsumerGroup createConsumerGroup(String name) throws RegistrationException
-   {
-      if (name == null)
-      {
-         throw new IllegalArgumentException("No null name accepted");
-      }
-
-      // Get hibernate session
-      Session session = getCurrentSession();
-      PersistentConsumerGroup group = null;
-
-      // Detect duplicate
-      if (findGroupByName(session, name) != null)
-      {
-         throw new DuplicateRegistrationException("Group " + name + " already exists");
-      }
-
-      // Create and persist
-      group = new PersistentConsumerGroup(this, name);
-      session.persist(group);
-
-      //
-      return group;
-   }
-
-   public void removeConsumerGroup(String name) throws RegistrationException
-   {
-      // Get hibernate session
-      Session session = getCurrentSession();
-
-      //
-      PersistentConsumerGroup group = getGroupByName(session, name);
-
-      //
-      session.delete(group);
-   }
-
-   public void removeConsumer(String consumerId) throws RegistrationException
-   {
-      // Get hibernate session
-      Session session = getCurrentSession();
-
-      //
-      PersistentConsumer consumer = getConsumerById(session, consumerId);
-
-      //
-      session.delete(consumer);
-   }
-
-   public void removeRegistration(String registrationId) throws RegistrationException
-   {
-      if (registrationId == null)
-      {
-         throw new IllegalArgumentException("No null registration id accepted");
-      }
-
-      // Get hibernate session
-      Session session = getCurrentSession();
-
-      //
-      PersistentRegistration registration = getRegistrationById(session, registrationId);
-
-      // Get related consumer
-      PersistentConsumer consumer = registration.getRelatedConsumer();
-
-      // Destroy relationship
-      consumer.getRelatedRegistrations().remove(registration);
-      registration.setRelatedConsumer(null);
-
-      // Delete the registration
-      session.delete(registration);
-      session.flush();
-   }
-
-   public Consumer getConsumerById(String consumerId) throws RegistrationException
-   {
-      // Get hibernate session
-      Session session = getCurrentSession();
-
-      //
-      return findConsumerById(session, consumerId);
-   }
-
-   public Registration addRegistrationFor(String consumerId, Map registrationProperties) throws RegistrationException
-   {
-      if (registrationProperties == null)
-      {
-         throw new IllegalArgumentException("No null registration properties accepted");
-      }
-
-      // Get hibernate session
-      Session session = getCurrentSession();
-
-      // Perform lookup
-      PersistentConsumer consumer = getConsumerById(session, consumerId);
-
-      // Create and persist registration and build relationship
-      PersistentRegistration registration = new PersistentRegistration(registrationProperties, RegistrationStatus.PENDING);
-      registration.setRelatedConsumer(consumer);
-      consumer.getRelatedRegistrations().add(registration);
-      session.persist(registration);
-      session.saveOrUpdate(consumer);
-
-      //
-      return registration;
-   }
-
-   public Registration getRegistration(String registrationId)
-   {
-      // Get hibernate session
-      Session session = getCurrentSession();
-
-      //
-      return findRegistrationById(session, registrationId);
-   }
-
-   public Consumer addConsumerToGroupNamed(String consumerId, String groupName) throws RegistrationException
-   {
-      Consumer consumer = getConsumerById(consumerId);
-
-      // Build relationship
-      ConsumerGroup group = getConsumerGroup(groupName);
-      consumer.setGroup(group);
-
-      //
-      return consumer;
-   }
-
-   public Collection getConsumerGroups()
-   {
-      Session session = getCurrentSession();
-      Query query = session.createQuery("from PersistentConsumerGroup");
-      return query.list();
-   }
-
-   public Collection getConsumers()
-   {
-      Session session = getCurrentSession();
-      Query query = session.createQuery("from PersistentConsumer");
-      return query.list();
-   }
-
-   private PersistentRegistration getRegistrationById(Session session, String registrationId) throws IllegalArgumentException, NoSuchRegistrationException
-   {
-      PersistentRegistration registration = findRegistrationById(session, registrationId);
-
-      //
-      if (registration == null)
-      {
-         throw new NoSuchRegistrationException("Cant find a consumer with the id " + registrationId);
-      }
-
-      //
-      return registration;
-   }
-
-   private PersistentRegistration findRegistrationById(Session session, String registrationId) throws IllegalArgumentException
-   {
-      if (registrationId == null)
-      {
-         throw new IllegalArgumentException("No null consumer id accepted");
-      }
-
-      try
-      {
-         // Parse the key
-         Long key = new Long(registrationId);
-
-         // Perform lookup
-         return (PersistentRegistration)session.get(PersistentRegistration.class, key);
-      }
-      catch (NumberFormatException e)
-      {
-         throw new IllegalArgumentException("Bad registration id format " + registrationId);
-      }
-   }
-
-   private PersistentConsumer getConsumerById(Session session, String consumerId) throws IllegalArgumentException, NoSuchRegistrationException
-   {
-      PersistentConsumer consumer = findConsumerById(session, consumerId);
-
-      //
-      if (consumer == null)
-      {
-         throw new NoSuchRegistrationException("Cant find a consumer with the id " + consumerId);
-      }
-
-      //
-      return consumer;
-   }
-
-   private PersistentConsumer findConsumerById(Session session, String consumerId) throws IllegalArgumentException
-   {
-      if (consumerId == null)
-      {
-         throw new IllegalArgumentException("No null consumer id accepted");
-      }
-
-      //
-      Query query = session.createQuery("from PersistentConsumer where persistentId=:consumerId");
-      query.setString("consumerId", consumerId);
-      return (PersistentConsumer)query.uniqueResult();
-   }
-
-   private PersistentConsumerGroup getGroupByName(Session session, String groupName) throws IllegalArgumentException, NoSuchRegistrationException
-   {
-      PersistentConsumerGroup group = findGroupByName(session, groupName);
-
-      //
-      if (group == null)
-      {
-         throw new NoSuchRegistrationException("Cant find a group with the name " + groupName);
-      }
-
-      //
-      return group;
-   }
-
-   private PersistentConsumerGroup findGroupByName(Session session, String groupName) throws IllegalArgumentException
-   {
-      if (groupName == null)
-      {
-         throw new IllegalArgumentException("No null group name accepted");
-      }
-
-      //
-      Query query = session.createQuery("from PersistentConsumerGroup where persistentName=:groupName");
-      query.setString("groupName", groupName);
-      return (PersistentConsumerGroup)query.uniqueResult();
-   }
-}

Modified: trunk/core/src/main/org/jboss/portal/test/core/model/instance/InstanceContainerTestCase.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/model/instance/InstanceContainerTestCase.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/core/src/main/org/jboss/portal/test/core/model/instance/InstanceContainerTestCase.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -47,7 +47,7 @@
 import org.jboss.portal.core.impl.model.instance.InstanceCustomizationImpl;
 import org.jboss.portal.core.impl.model.instance.InstanceDefinitionImpl;
 import org.jboss.portal.core.impl.model.instance.PersistentInstanceContainer;
-import org.jboss.portal.core.impl.portlet.state.PersistentStateStore;
+import org.jboss.portal.core.impl.portlet.state.PersistentPortletStatePersistenceManager;
 import org.jboss.portal.core.model.instance.Instance;
 import org.jboss.portal.core.model.instance.InstanceDefinition;
 import org.jboss.portal.portlet.NoSuchPortletException;
@@ -171,7 +171,7 @@
    private PersistentInstanceContainer instanceContainer;
 
    /** . */
-   private PersistentStateStore persistenceManager;
+   private PersistentPortletStatePersistenceManager persistenceManager;
 
    /** . */
    private ProducerPortletInvoker producer;
@@ -264,12 +264,12 @@
       this.instanceContainer = instanceContainer;
    }
 
-   public PersistentStateStore getPersistenceManager()
+   public PersistentPortletStatePersistenceManager getPersistenceManager()
    {
       return persistenceManager;
    }
 
-   public void setPersistenceManager(PersistentStateStore persistenceManager)
+   public void setPersistenceManager(PersistentPortletStatePersistenceManager persistenceManager)
    {
       this.persistenceManager = persistenceManager;
    }
@@ -379,7 +379,7 @@
       TransactionAssert.beginTransaction();
       Session session = instanceHibernateSupport.getCurrentSession();
       assertEquals(0, session.createQuery("from InstanceDefinitionImpl").list().size());
-      assertEquals(0, portletHibernateSupport.getCurrentSession().createQuery("from PersistentState").list().size());
+      assertEquals(0, portletHibernateSupport.getCurrentSession().createQuery("from PersistentPortletState").list().size());
       TransactionAssert.commitTransaction();
    }
 

Modified: trunk/core/src/main/org/jboss/portal/test/core/state/ProducerTestCase.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/state/ProducerTestCase.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/core/src/main/org/jboss/portal/test/core/state/ProducerTestCase.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -38,7 +38,7 @@
 import org.jboss.portal.common.value.StringValue;
 import org.jboss.portal.core.impl.portlet.state.PersistentConsumer;
 import org.jboss.portal.core.impl.portlet.state.PersistentRegistration;
-import org.jboss.portal.core.impl.portlet.state.PersistentStateStore;
+import org.jboss.portal.core.impl.portlet.state.PersistentPortletStatePersistenceManager;
 import org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker;
 import org.jboss.portal.portlet.NoSuchPortletException;
 import org.jboss.portal.portlet.Portlet;
@@ -52,8 +52,8 @@
 import org.jboss.portal.portlet.state.PropertyChange;
 import org.jboss.portal.portlet.state.PropertyMap;
 import org.jboss.portal.portlet.state.SimplePropertyMap;
-import org.jboss.portal.portlet.state.producer.ProducerState;
-import org.jboss.portal.portlet.state.producer.ProducerStateContext;
+import org.jboss.portal.portlet.state.producer.PortletState;
+import org.jboss.portal.portlet.state.producer.PortletStateContext;
 import org.jboss.portal.portlet.support.info.PreferencesInfoSupport;
 import org.jboss.portal.portlet.test.ActionContextImpl;
 import org.jboss.portal.portlet.test.InstanceContextImpl;
@@ -109,7 +109,7 @@
    private HibernateSupport hibernateSupport;
 
    /** . */
-   private PersistentStateStore persistenceManager;
+   private PersistentPortletStatePersistenceManager persistenceManager;
 
    /** . */
    private ProducerPortletInvoker producer;
@@ -132,12 +132,12 @@
       this.hibernateSupport = hibernateSupport;
    }
 
-   public PersistentStateStore getPersistenceManager()
+   public PersistentPortletStatePersistenceManager getPersistenceManager()
    {
       return persistenceManager;
    }
 
-   public void setPersistenceManager(PersistentStateStore persistenceManager)
+   public void setPersistenceManager(PersistentPortletStatePersistenceManager persistenceManager)
    {
       this.persistenceManager = persistenceManager;
    }
@@ -333,7 +333,7 @@
       // Check the clone state
       TransactionAssert.beginTransaction();
       assertTrue(cloneCtx.getId().startsWith("_"));
-      ProducerStateContext cloneState = persistenceManager.loadState(cloneCtx.getId().substring(1));
+      PortletStateContext cloneState = persistenceManager.loadState(cloneCtx.getId().substring(1));
       assertNotNull(cloneState);
       assertEquals(cloneCtx.getId(), "_" + cloneState.getId());
       assertEquals("SimplePortlet", cloneState.getState().getPortletId());
@@ -359,7 +359,7 @@
       // Check the clone clone state
       TransactionAssert.beginTransaction();
       assertTrue(cloneCloneCtx.getId().startsWith("_"));
-      ProducerStateContext cloneCloneState = persistenceManager.loadState(cloneCloneCtx.getId().substring(1));
+      PortletStateContext cloneCloneState = persistenceManager.loadState(cloneCloneCtx.getId().substring(1));
       assertNotNull(cloneCloneState);
       assertEquals(cloneCloneCtx.getId(), "_" + cloneCloneState.getId());
       assertEquals("SimplePortlet", cloneCloneState.getState().getPortletId());
@@ -463,7 +463,7 @@
       TransactionAssert.beginTransaction();
       PortletContext cloneId = instanceContext.getClonedContext();
       assertNotNull(cloneId);
-      ProducerStateContext state = persistenceManager.loadState(cloneId.getId().substring(1));
+      PortletStateContext state = persistenceManager.loadState(cloneId.getId().substring(1));
       assertNotNull(state);
       assertEquals(cloneId.getId().substring(1), state.getId());
       assertEquals("CloningPortlet", state.getState().getPortletId());
@@ -518,7 +518,7 @@
 
       // Modify the state of the CCP
       TransactionAssert.beginTransaction();
-      ProducerState cloningPortletState = persistenceManager.loadState(cloningPortletId.getId().substring(1)).getState();
+      PortletState cloningPortletState = persistenceManager.loadState(cloningPortletId.getId().substring(1)).getState();
       SimplePropertyMap newCloningPortletStateValue = new SimplePropertyMap(cloningPortletState.getProperties());
       newCloningPortletStateValue.setProperty("abc", new StringValue("deff"));
       persistenceManager.updateState(cloningPortletId.getId().substring(1), newCloningPortletStateValue);
@@ -538,7 +538,7 @@
       TransactionAssert.beginTransaction();
       PortletContext cloneId = instanceContext.getClonedContext();
       assertNotNull(cloneId);
-      ProducerStateContext state = persistenceManager.loadState(cloneId.getId().substring(1));
+      PortletStateContext state = persistenceManager.loadState(cloneId.getId().substring(1));
       assertNotNull(state);
       assertEquals(cloneId.getId().substring(1), state.getId());
       assertEquals("CloningPortlet", state.getState().getPortletId());
@@ -568,7 +568,7 @@
       // Check state
       TransactionAssert.beginTransaction();
       assertNull(instanceContext.getClonedContext());
-      ProducerStateContext state = persistenceManager.loadState(cloningPortletId.getId().substring(1));
+      PortletStateContext state = persistenceManager.loadState(cloningPortletId.getId().substring(1));
       assertNotNull(state);
       assertEquals("CloningPortlet", state.getState().getPortletId());
       assertEquals(cloningPortletId.getId().substring(1), state.getId());

Modified: trunk/core/src/main/org/jboss/portal/test/core/state/RegistrationPersistenceManagerTestCase.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/state/RegistrationPersistenceManagerTestCase.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/core/src/main/org/jboss/portal/test/core/state/RegistrationPersistenceManagerTestCase.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -32,7 +32,7 @@
 import org.jboss.portal.common.test.TestParametrization;
 import org.jboss.portal.common.test.junit.JUnitAdapter;
 import org.jboss.portal.common.test.junit.POJOJUnitTest;
-import org.jboss.portal.core.impl.portlet.state.PersistentStateStore;
+import org.jboss.portal.core.impl.portlet.state.PersistentPortletStatePersistenceManager;
 import org.jboss.portal.registration.RegistrationPersistenceManager;
 import org.jboss.portal.test.framework.TestRuntimeContext;
 import org.jboss.portal.test.framework.embedded.DataSourceSupport;
@@ -78,7 +78,7 @@
    private HibernateSupport hibernateSupport;
 
    /** . */
-   private PersistentStateStore persistenceManager;
+   private PersistentPortletStatePersistenceManager persistenceManager;
 
    public String getName()
    {
@@ -95,12 +95,12 @@
       this.hibernateSupport = hibernateSupport;
    }
 
-   public PersistentStateStore getPersistenceManager()
+   public PersistentPortletStatePersistenceManager getPersistenceManager()
    {
       return persistenceManager;
    }
 
-   public void setPersistenceManager(PersistentStateStore persistenceManager)
+   public void setPersistenceManager(PersistentPortletStatePersistenceManager persistenceManager)
    {
       this.persistenceManager = persistenceManager;
    }

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	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml	2006-12-15 17:31:20 UTC (rev 5873)
@@ -859,7 +859,7 @@
 
    <!-- The producer portlet invoker -->
    <mbean
-      code="org.jboss.portal.core.impl.portlet.state.PersistentStateStore"
+      code="org.jboss.portal.core.impl.portlet.state.PersistentPortletStatePersistenceManager"
       name="portal:service=PersistenceManager,type=Producer"
       xmbean-dd=""
       xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">

Modified: trunk/core/src/resources/portal-core-sar/conf/hibernate/portlet/domain.hbm.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/hibernate/portlet/domain.hbm.xml	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/core/src/resources/portal-core-sar/conf/hibernate/portlet/domain.hbm.xml	2006-12-15 17:31:20 UTC (rev 5873)
@@ -27,7 +27,7 @@
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
  <hibernate-mapping>
    <class
-      name="org.jboss.portal.core.impl.portlet.state.PersistentState"
+      name="org.jboss.portal.core.impl.portlet.state.PersistentPortletState"
       table="JBP_PORTLET_STATE">
       <cache usage="@portal.hibernate.cache.usage@"/>
       <id
@@ -69,7 +69,7 @@
          <index
             column="NAME"
             type="java.lang.String"/>
-         <one-to-many class="org.jboss.portal.core.impl.portlet.state.PersistentStateEntry"/>
+         <one-to-many class="org.jboss.portal.core.impl.portlet.state.PersistentPortletStateEntry"/>
       </map>
       <set
          name="children"
@@ -79,18 +79,18 @@
          lazy="extra">
          <cache usage="@portal.hibernate.cache.usage@"/>
          <key column="PARENT_PK"/>
-         <one-to-many class="org.jboss.portal.core.impl.portlet.state.PersistentState"/>
+         <one-to-many class="org.jboss.portal.core.impl.portlet.state.PersistentPortletState"/>
       </set>
       <many-to-one
          name="parent"
          column="PARENT_PK"
-         class="org.jboss.portal.core.impl.portlet.state.PersistentState"
+         class="org.jboss.portal.core.impl.portlet.state.PersistentPortletState"
          cascade="none"
          fetch="select"/>
    </class>
 
    <class
-      name="org.jboss.portal.core.impl.portlet.state.PersistentStateEntry"
+      name="org.jboss.portal.core.impl.portlet.state.PersistentPortletStateEntry"
       table="JBP_PORTLET_STATE_ENTRY">
       <cache usage="@portal.hibernate.cache.usage@"/>
       <id

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	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/model/instance/jboss-beans.xml	2006-12-15 17:31:20 UTC (rev 5873)
@@ -88,7 +88,7 @@
    <bean name="StateManagementPolicy" class="org.jboss.portal.portlet.impl.state.StateManagementPolicyService">
       <property name="persistLocally"><inject bean="TestCaseConfig" property="persistLocally"/></property>
    </bean>
-   <bean name="PersistenceManager" class="org.jboss.portal.core.impl.portlet.state.PersistentStateStore">
+   <bean name="PersistenceManager" class="org.jboss.portal.core.impl.portlet.state.PersistentPortletStatePersistenceManager">
       <property name="sessionFactoryJNDIName">java:/PortletSessionFactory</property>
    </bean>
    <bean name="PortletContainer" class="org.jboss.portal.portlet.test.support.PortletInvokerSupport">

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	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/state/jboss-beans.xml	2006-12-15 17:31:20 UTC (rev 5873)
@@ -74,7 +74,7 @@
       <property name="persistLocally">true</property>
    </bean>
 
-   <bean name="PersistenceManager" class="org.jboss.portal.core.impl.portlet.state.PersistentStateStore">
+   <bean name="PersistenceManager" class="org.jboss.portal.core.impl.portlet.state.PersistentPortletStatePersistenceManager">
       <property name="sessionFactoryJNDIName">java:/SessionFactory</property>
    </bean>
 

Modified: trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/state/registration-persistence-manager-beans.xml
===================================================================
--- trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/state/registration-persistence-manager-beans.xml	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/core/src/resources/portal-core-test-jar/org/jboss/portal/test/core/state/registration-persistence-manager-beans.xml	2006-12-15 17:31:20 UTC (rev 5873)
@@ -67,7 +67,7 @@
       <property name="jNDIName">java:/SessionFactory</property>
    </bean>
 
-   <bean name="PersistenceManager" class="org.jboss.portal.core.impl.portlet.state.PersistentStateStore">
+   <bean name="PersistenceManager" class="org.jboss.portal.core.impl.portlet.state.PersistentPortletStatePersistenceManager">
       <property name="sessionFactoryJNDIName">java:/SessionFactory</property>
    </bean>
 

Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/StateConverterService.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/StateConverterService.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/StateConverterService.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -25,7 +25,7 @@
 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.ProducerState;
+import org.jboss.portal.portlet.state.producer.PortletState;
 
 import java.io.IOException;
 
@@ -36,7 +36,7 @@
 public class StateConverterService extends AbstractJBossService implements StateConverter
 {
 
-   public byte[] marshall(ProducerState state)
+   public byte[] marshall(PortletState state)
    {
       try
       {
@@ -48,11 +48,11 @@
       }
    }
 
-   public ProducerState unmarshall(byte[] marshalledState)
+   public PortletState unmarshall(byte[] marshalledState)
    {
       try
       {
-         return (ProducerState)Tools.unserialize(marshalledState);
+         return (PortletState)Tools.unserialize(marshalledState);
       }
       catch (Exception e)
       {

Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/StateConverterV0.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/StateConverterV0.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/StateConverterV0.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -28,7 +28,7 @@
 import org.jboss.portal.portlet.state.SimplePropertyMap;
 import org.jboss.portal.portlet.state.StateConversionException;
 import org.jboss.portal.portlet.state.StateConverter;
-import org.jboss.portal.portlet.state.producer.ProducerState;
+import org.jboss.portal.portlet.state.producer.PortletState;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -58,7 +58,7 @@
    /** . */
    private static final byte VERSION_ID = 0;
 
-   public byte[] marshall(ProducerState state) throws StateConversionException
+   public byte[] marshall(PortletState state) throws StateConversionException
    {
       if (state == null)
       {
@@ -106,7 +106,7 @@
       }
    }
 
-   public ProducerState unmarshall(byte[] marshalledState) throws StateConversionException
+   public PortletState unmarshall(byte[] marshalledState) throws StateConversionException
    {
       if (marshalledState == null)
       {
@@ -146,7 +146,7 @@
             StringValue value = new StringValue(strings);
             properties.setProperty(key, value);
          }
-         return new ProducerState(portletId, properties);
+         return new PortletState(portletId, properties);
       }
       catch (IOException e)
       {

Copied: trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/PortletStateContextImpl.java (from rev 5872, trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/ProducerStateContextImpl.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/ProducerStateContextImpl.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/PortletStateContextImpl.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -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.portlet.impl.state.producer;
+
+import org.jboss.portal.portlet.state.producer.PortletStateContext;
+import org.jboss.portal.portlet.state.producer.PortletState;
+import org.jboss.portal.portlet.state.PropertyMap;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletStateContextImpl implements PortletStateContext
+{
+
+   /** . */
+   private final String id;
+
+   /** . */
+   private PortletState state;
+
+   public PortletStateContextImpl(String id, String portletId, PropertyMap propertyMap)
+   {
+      this.id = id;
+      this.state = new PortletState(portletId, propertyMap);
+   }
+
+   public String getId()
+   {
+      return id;
+   }
+
+   public PortletState getState()
+   {
+      return state;
+   }
+}

Copied: trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/PortletStatePersistenceManagerService.java (from rev 5872, trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/ProducerPersistenceManagerService.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/ProducerPersistenceManagerService.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/PortletStatePersistenceManagerService.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -0,0 +1,146 @@
+/******************************************************************************
+ * 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.producer;
+
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.portlet.state.InvalidStateIdException;
+import org.jboss.portal.portlet.state.NoSuchStateException;
+import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.SimplePropertyMap;
+import org.jboss.portal.portlet.state.producer.PortletStatePersistenceManager;
+import org.jboss.portal.portlet.state.producer.PortletStateContext;
+import org.jboss.portal.portlet.state.producer.PortletState;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class PortletStatePersistenceManagerService extends AbstractJBossService implements PortletStatePersistenceManager
+{
+
+   /** . */
+   private Map store = new HashMap();
+
+   /** . */
+   private int counter = 0;
+
+
+   public synchronized PortletStateContext loadState(String stateId) throws IllegalArgumentException, NoSuchStateException, InvalidStateIdException
+   {
+      if (stateId == null)
+      {
+         throw new IllegalArgumentException("No null state id accepted");
+      }
+      try
+      {
+         Integer.parseInt(stateId);
+      }
+      catch (NumberFormatException e)
+      {
+         throw new InvalidStateIdException(e, stateId);
+      }
+      PortletStateContext context = (PortletStateContext)store.get(stateId);
+      if (context == null)
+      {
+         throw new NoSuchStateException(stateId);
+      }
+      return context;
+   }
+
+   private synchronized PortletState getState(String stateId) throws NoSuchStateException, InvalidStateIdException
+   {
+      PortletStateContext context = loadState(stateId);
+      return context.getState();
+   }
+
+   public synchronized String createState(String portletId, PropertyMap propertyMap)
+   {
+      if (portletId == null)
+      {
+         throw new IllegalArgumentException("No null portlet id accepted");
+      }
+      if (propertyMap == null)
+      {
+         throw new IllegalArgumentException("No null value map accepted");
+      }
+      String id = Integer.toString(counter++);
+      PortletStateContext state = new PortletStateContextImpl(id, portletId, new SimplePropertyMap(propertyMap));
+      store.put(id, state);
+      return id;
+   }
+
+   public synchronized String cloneState(String stateId, PropertyMap propertyMap) throws NoSuchStateException, InvalidStateIdException
+   {
+      if (propertyMap == null)
+      {
+         throw new IllegalArgumentException();
+      }
+      PortletState stateContext = getState(stateId);
+      return createState(stateContext.getPortletId(), propertyMap);
+   }
+
+   public String cloneState(String stateId) throws IllegalArgumentException, NoSuchStateException, InvalidStateIdException
+   {
+      PortletState state = getState(stateId);
+      return createState(state.getPortletId(), new SimplePropertyMap(state.getProperties()));
+   }
+
+   public synchronized void updateState(String stateId, PropertyMap propertyMap) throws NoSuchStateException, InvalidStateIdException
+   {
+      if (propertyMap == null)
+      {
+         throw new IllegalArgumentException("No null value map");
+      }
+      PortletState ctx = getState(stateId);
+      ctx.getProperties().clear();
+      ctx.getProperties().putAll(propertyMap);
+   }
+
+   public synchronized void destroyState(String stateId) throws InvalidStateIdException, NoSuchStateException
+   {
+      if (stateId == null)
+      {
+         throw new IllegalArgumentException();
+      }
+      try
+      {
+         Integer.parseInt(stateId);
+      }
+      catch (NumberFormatException e)
+      {
+         throw new InvalidStateIdException(e, stateId);
+      }
+      if (store.remove(stateId) == null)
+      {
+         throw new NoSuchStateException(stateId);
+      }
+   }
+
+   public synchronized int getSize()
+   {
+      return store.size();
+   }
+}


Property changes on: trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/PortletStatePersistenceManagerService.java
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/ProducerPersistenceManagerService.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/ProducerPersistenceManagerService.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/ProducerPersistenceManagerService.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -1,146 +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.producer;
-
-import org.jboss.portal.jems.as.system.AbstractJBossService;
-import org.jboss.portal.portlet.state.InvalidStateIdException;
-import org.jboss.portal.portlet.state.NoSuchStateException;
-import org.jboss.portal.portlet.state.PropertyMap;
-import org.jboss.portal.portlet.state.SimplePropertyMap;
-import org.jboss.portal.portlet.state.producer.ProducerPersistenceManager;
-import org.jboss.portal.portlet.state.producer.ProducerStateContext;
-import org.jboss.portal.portlet.state.producer.ProducerState;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class ProducerPersistenceManagerService extends AbstractJBossService implements ProducerPersistenceManager
-{
-
-   /** . */
-   private Map store = new HashMap();
-
-   /** . */
-   private int counter = 0;
-
-
-   public synchronized ProducerStateContext loadState(String stateId) throws IllegalArgumentException, NoSuchStateException, InvalidStateIdException
-   {
-      if (stateId == null)
-      {
-         throw new IllegalArgumentException("No null state id accepted");
-      }
-      try
-      {
-         Integer.parseInt(stateId);
-      }
-      catch (NumberFormatException e)
-      {
-         throw new InvalidStateIdException(e, stateId);
-      }
-      ProducerStateContext context = (ProducerStateContext)store.get(stateId);
-      if (context == null)
-      {
-         throw new NoSuchStateException(stateId);
-      }
-      return context;
-   }
-
-   private synchronized ProducerState getState(String stateId) throws NoSuchStateException, InvalidStateIdException
-   {
-      ProducerStateContext context = loadState(stateId);
-      return context.getState();
-   }
-
-   public synchronized String createState(String portletId, PropertyMap propertyMap)
-   {
-      if (portletId == null)
-      {
-         throw new IllegalArgumentException("No null portlet id accepted");
-      }
-      if (propertyMap == null)
-      {
-         throw new IllegalArgumentException("No null value map accepted");
-      }
-      String id = Integer.toString(counter++);
-      ProducerStateContext state = new ProducerStateContextImpl(id, portletId, new SimplePropertyMap(propertyMap));
-      store.put(id, state);
-      return id;
-   }
-
-   public synchronized String cloneState(String stateId, PropertyMap propertyMap) throws NoSuchStateException, InvalidStateIdException
-   {
-      if (propertyMap == null)
-      {
-         throw new IllegalArgumentException();
-      }
-      ProducerState stateContext = getState(stateId);
-      return createState(stateContext.getPortletId(), propertyMap);
-   }
-
-   public String cloneState(String stateId) throws IllegalArgumentException, NoSuchStateException, InvalidStateIdException
-   {
-      ProducerState state = getState(stateId);
-      return createState(state.getPortletId(), new SimplePropertyMap(state.getProperties()));
-   }
-
-   public synchronized void updateState(String stateId, PropertyMap propertyMap) throws NoSuchStateException, InvalidStateIdException
-   {
-      if (propertyMap == null)
-      {
-         throw new IllegalArgumentException("No null value map");
-      }
-      ProducerState ctx = getState(stateId);
-      ctx.getProperties().clear();
-      ctx.getProperties().putAll(propertyMap);
-   }
-
-   public synchronized void destroyState(String stateId) throws InvalidStateIdException, NoSuchStateException
-   {
-      if (stateId == null)
-      {
-         throw new IllegalArgumentException();
-      }
-      try
-      {
-         Integer.parseInt(stateId);
-      }
-      catch (NumberFormatException e)
-      {
-         throw new InvalidStateIdException(e, stateId);
-      }
-      if (store.remove(stateId) == null)
-      {
-         throw new NoSuchStateException(stateId);
-      }
-   }
-
-   public synchronized int getSize()
-   {
-      return store.size();
-   }
-}

Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/ProducerStateContextImpl.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/ProducerStateContextImpl.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/ProducerStateContextImpl.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -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.state.producer;
-
-import org.jboss.portal.portlet.state.producer.ProducerStateContext;
-import org.jboss.portal.portlet.state.producer.ProducerState;
-import org.jboss.portal.portlet.state.PropertyMap;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class ProducerStateContextImpl implements ProducerStateContext
-{
-
-   /** . */
-   private final String id;
-
-   /** . */
-   private ProducerState state;
-
-   public ProducerStateContextImpl(String id, String portletId, PropertyMap propertyMap)
-   {
-      this.id = id;
-      this.state = new ProducerState(portletId, propertyMap);
-   }
-
-   public String getId()
-   {
-      return id;
-   }
-
-   public ProducerState getState()
-   {
-      return state;
-   }
-}

Modified: trunk/portlet/src/main/org/jboss/portal/portlet/state/StateConverter.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/StateConverter.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/StateConverter.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -22,11 +22,11 @@
  ******************************************************************************/
 package org.jboss.portal.portlet.state;
 
-import org.jboss.portal.portlet.state.producer.ProducerState;
+import org.jboss.portal.portlet.state.producer.PortletState;
 
 /**
  * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
  */
 public interface StateConverter
 {
@@ -38,7 +38,7 @@
     * @throws StateConversionException if marshalling cannot be performed
     * @throws IllegalArgumentException if the state is null
     */
-   byte[] marshall(ProducerState state) throws StateConversionException, IllegalArgumentException;
+   byte[] marshall(PortletState state) throws StateConversionException, IllegalArgumentException;
 
    /**
     * Unmarshall the producer state from a byte array.
@@ -48,5 +48,5 @@
     * @throws StateConversionException if unmarshalling cannot be performed
     * @throws IllegalArgumentException if the argument is null
     */
-   ProducerState unmarshall(byte[] marshalledState) throws StateConversionException, IllegalArgumentException;
+   PortletState unmarshall(byte[] marshalledState) throws StateConversionException, IllegalArgumentException;
 }

Copied: trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletState.java (from rev 5872, trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerState.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerState.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletState.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -0,0 +1,86 @@
+/******************************************************************************
+ * 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.state.producer;
+
+import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.SimplePropertyMap;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class PortletState implements Serializable
+{
+
+   /** . */
+   private String portletId;
+
+   /** . */
+   private PropertyMap properties;
+
+   /** . */
+   private Date terminationTime;
+
+   public PortletState(String portletId)
+   {
+      this(portletId, new SimplePropertyMap());
+   }
+
+   public PortletState(String portletId, PropertyMap properties)
+   {
+      if (portletId == null)
+      {
+         throw new IllegalArgumentException();
+      }
+      if (properties == null)
+      {
+         throw new IllegalArgumentException();
+      }
+      this.portletId = portletId;
+      this.properties = properties;
+      this.terminationTime = null;
+   }
+
+   public String getPortletId()
+   {
+      return portletId;
+   }
+
+   public PropertyMap getProperties()
+   {
+      return properties;
+   }
+
+   public Date getTerminationTime()
+   {
+      return terminationTime;
+   }
+
+   public void setTerminationTime(Date terminationTime)
+   {
+      this.terminationTime = terminationTime;
+   }
+}


Property changes on: trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletState.java
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Copied: trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletStateContext.java (from rev 5872, trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerStateContext.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerStateContext.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletStateContext.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -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.portlet.state.producer;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public interface PortletStateContext
+{
+
+   /**
+    *
+    * @return
+    */
+   String getId();
+
+   /**
+    *
+    * @return
+    */
+   PortletState getState();
+
+}


Property changes on: trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletStateContext.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Copied: trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletStatePersistenceManager.java (from rev 5872, trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPersistenceManager.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPersistenceManager.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletStatePersistenceManager.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -0,0 +1,101 @@
+/******************************************************************************
+ * 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.state.producer;
+
+import org.jboss.portal.portlet.state.InvalidStateIdException;
+import org.jboss.portal.portlet.state.NoSuchStateException;
+import org.jboss.portal.portlet.state.PropertyMap;
+
+/**
+ * An abstraction for enabling state management on the producer side.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public interface PortletStatePersistenceManager
+{
+   /**
+    * Load the state.
+    *
+    * @param stateId the state id
+    * @return the value map or null if it does not exist
+    * @throws IllegalArgumentException if the state id is null
+    * @throws NoSuchStateException     is the specified state does not exist
+    * @throws InvalidStateIdException  if the state id is not valid
+    */
+   PortletStateContext loadState(String stateId) throws IllegalArgumentException, NoSuchStateException, InvalidStateIdException;
+
+   /**
+    * Create the initial state.
+    *
+    * @param portletId the id that this state refers to
+    * @return the id of the state created
+    * @throws IllegalArgumentException if the portlet id is null
+    */
+   String createState(String portletId, PropertyMap propertyMap) throws IllegalArgumentException;
+
+   /**
+    * Clone an existing state.
+    *
+    * @param stateId the id that this state refers to
+    * @return the state id
+    * @throws IllegalArgumentException if the state id is null
+    * @throws NoSuchStateException     is the specified state does not exist
+    * @throws InvalidStateIdException  if the state id is not valid
+    */
+   String cloneState(String stateId) throws IllegalArgumentException, NoSuchStateException, InvalidStateIdException;
+
+   /**
+    * Clone an existing state.
+    *
+    * @param stateId     the id that this state refers to
+    * @param propertyMap the values of the cloned state
+    * @return the state id
+    * @throws IllegalArgumentException if the state id is null or the value is nul
+    * @throws NoSuchStateException     is the specified state does not exist
+    * @throws InvalidStateIdException  if the state id is not valid
+    */
+   String cloneState(String stateId, PropertyMap propertyMap) throws IllegalArgumentException, NoSuchStateException, InvalidStateIdException;
+
+   /**
+    * Update the state.
+    *
+    * @param stateId
+    * @param propertyMap the updated state
+    * @throws IllegalArgumentException if the state id is null or the values are null
+    * @throws NoSuchStateException     is the specified state does not exist
+    * @throws org.jboss.portal.portlet.state.InvalidStateIdException
+    *                                  if the state id is not valid
+    */
+   void updateState(String stateId, PropertyMap propertyMap) throws IllegalArgumentException, NoSuchStateException, InvalidStateIdException;
+
+   /**
+    * Destroy the state.
+    *
+    * @param stateId
+    * @throws IllegalArgumentException if the state id is null
+    * @throws NoSuchStateException     is the specified state does not exist
+    * @throws InvalidStateIdException  if the state id is not valid
+    */
+   void destroyState(String stateId) throws IllegalArgumentException, NoSuchStateException, InvalidStateIdException;
+}


Property changes on: trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletStatePersistenceManager.java
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPersistenceManager.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPersistenceManager.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPersistenceManager.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -1,101 +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.state.producer;
-
-import org.jboss.portal.portlet.state.InvalidStateIdException;
-import org.jboss.portal.portlet.state.NoSuchStateException;
-import org.jboss.portal.portlet.state.PropertyMap;
-
-/**
- * An abstraction for enabling state management on the producer side.
- *
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public interface ProducerPersistenceManager
-{
-   /**
-    * Load the state.
-    *
-    * @param stateId the state id
-    * @return the value map or null if it does not exist
-    * @throws IllegalArgumentException if the state id is null
-    * @throws NoSuchStateException     is the specified state does not exist
-    * @throws InvalidStateIdException  if the state id is not valid
-    */
-   ProducerStateContext loadState(String stateId) throws IllegalArgumentException, NoSuchStateException, InvalidStateIdException;
-
-   /**
-    * Create the initial state.
-    *
-    * @param portletId the id that this state refers to
-    * @return the id of the state created
-    * @throws IllegalArgumentException if the portlet id is null
-    */
-   String createState(String portletId, PropertyMap propertyMap) throws IllegalArgumentException;
-
-   /**
-    * Clone an existing state.
-    *
-    * @param stateId the id that this state refers to
-    * @return the state id
-    * @throws IllegalArgumentException if the state id is null
-    * @throws NoSuchStateException     is the specified state does not exist
-    * @throws InvalidStateIdException  if the state id is not valid
-    */
-   String cloneState(String stateId) throws IllegalArgumentException, NoSuchStateException, InvalidStateIdException;
-
-   /**
-    * Clone an existing state.
-    *
-    * @param stateId     the id that this state refers to
-    * @param propertyMap the values of the cloned state
-    * @return the state id
-    * @throws IllegalArgumentException if the state id is null or the value is nul
-    * @throws NoSuchStateException     is the specified state does not exist
-    * @throws InvalidStateIdException  if the state id is not valid
-    */
-   String cloneState(String stateId, PropertyMap propertyMap) throws IllegalArgumentException, NoSuchStateException, InvalidStateIdException;
-
-   /**
-    * Update the state.
-    *
-    * @param stateId
-    * @param propertyMap the updated state
-    * @throws IllegalArgumentException if the state id is null or the values are null
-    * @throws NoSuchStateException     is the specified state does not exist
-    * @throws org.jboss.portal.portlet.state.InvalidStateIdException
-    *                                  if the state id is not valid
-    */
-   void updateState(String stateId, PropertyMap propertyMap) throws IllegalArgumentException, NoSuchStateException, InvalidStateIdException;
-
-   /**
-    * Destroy the state.
-    *
-    * @param stateId
-    * @throws IllegalArgumentException if the state id is null
-    * @throws NoSuchStateException     is the specified state does not exist
-    * @throws InvalidStateIdException  if the state id is not valid
-    */
-   void destroyState(String stateId) throws IllegalArgumentException, NoSuchStateException, InvalidStateIdException;
-}

Modified: trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -74,7 +74,7 @@
    private PortletInvoker portletInvoker;
 
    /** . */
-   private ProducerPersistenceManager persistenceManager;
+   private PortletStatePersistenceManager persistenceManager;
 
    /** . */
    private StateManagementPolicy stateManagementPolicy;
@@ -92,12 +92,12 @@
       this.portletInvoker = portletInvoker;
    }
 
-   public ProducerPersistenceManager getPersistenceManager()
+   public PortletStatePersistenceManager getPersistenceManager()
    {
       return persistenceManager;
    }
 
-   public void setPersistenceManager(ProducerPersistenceManager ppm)
+   public void setPersistenceManager(PortletStatePersistenceManager ppm)
    {
       this.persistenceManager = ppm;
    }
@@ -141,8 +141,8 @@
          {
             try
             {
-               ProducerState producerState = stateConverter.unmarshall(state);
-               return portletInvoker.getPortlet(PortletContext.createPortletContext(producerState.getPortletId()));
+               PortletState portletState = stateConverter.unmarshall(state);
+               return portletInvoker.getPortlet(PortletContext.createPortletContext(portletState.getPortletId()));
             }
             catch (StateConversionException e)
             {
@@ -159,8 +159,8 @@
          try
          {
             String stateId = portletId.substring(PRODUCER_CLONE_ID_PREFIX.length());
-            ProducerStateContext stateContext = persistenceManager.loadState(stateId);
-            ProducerState state = stateContext.getState();
+            PortletStateContext stateContext = persistenceManager.loadState(stateId);
+            PortletState state = stateContext.getState();
             return portletInvoker.getPortlet(PortletContext.createPortletContext(state.getPortletId()));
          }
          catch (NoSuchStateException e)
@@ -626,7 +626,7 @@
    {
       try
       {
-         ProducerState sstate = new ProducerState(portletId, props);
+         PortletState sstate = new PortletState(portletId, props);
          byte[] marshalledState = stateConverter.marshall(sstate);
          return PortletContext.createStatefulPortletContext(CONSUMER_CLONE_ID, marshalledState);
       }
@@ -683,7 +683,7 @@
             String stateId = portletId.substring(PRODUCER_CLONE_ID_PREFIX.length());
             try
             {
-               ProducerStateContext stateContext = persistenceManager.loadState(stateId);
+               PortletStateContext stateContext = persistenceManager.loadState(stateId);
                return new LocalContext(stateContext.getState().getPortletId(), stateContext.getState().getProperties(), stateContext.getId());
             }
             catch (NoSuchStateException e)
@@ -704,7 +704,7 @@
       {
          try
          {
-            final ProducerState state = stateConverter.unmarshall(bytes);
+            final PortletState state = stateConverter.unmarshall(bytes);
             return new RemoteContext(state.getPortletId(), state.getProperties());
          }
          catch (StateConversionException e)

Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerState.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerState.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerState.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -1,86 +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.state.producer;
-
-import org.jboss.portal.portlet.state.PropertyMap;
-import org.jboss.portal.portlet.state.SimplePropertyMap;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class ProducerState implements Serializable
-{
-
-   /** . */
-   private String portletId;
-
-   /** . */
-   private PropertyMap properties;
-
-   /** . */
-   private Date terminationTime;
-
-   public ProducerState(String portletId)
-   {
-      this(portletId, new SimplePropertyMap());
-   }
-
-   public ProducerState(String portletId, PropertyMap properties)
-   {
-      if (portletId == null)
-      {
-         throw new IllegalArgumentException();
-      }
-      if (properties == null)
-      {
-         throw new IllegalArgumentException();
-      }
-      this.portletId = portletId;
-      this.properties = properties;
-      this.terminationTime = null;
-   }
-
-   public String getPortletId()
-   {
-      return portletId;
-   }
-
-   public PropertyMap getProperties()
-   {
-      return properties;
-   }
-
-   public Date getTerminationTime()
-   {
-      return terminationTime;
-   }
-
-   public void setTerminationTime(Date terminationTime)
-   {
-      this.terminationTime = terminationTime;
-   }
-}

Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerStateContext.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerStateContext.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerStateContext.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -1,44 +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.state.producer;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public interface ProducerStateContext
-{
-
-   /**
-    *
-    * @return
-    */
-   String getId();
-
-   /**
-    *
-    * @return
-    */
-   ProducerState getState();
-
-}

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	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -29,7 +29,7 @@
 import org.jboss.portal.portlet.impl.state.StateConverterService;
 import org.jboss.portal.portlet.impl.state.StateManagementPolicyService;
 import org.jboss.portal.portlet.impl.state.consumer.ConsumerPersistenceManagerService;
-import org.jboss.portal.portlet.impl.state.producer.ProducerPersistenceManagerService;
+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;
@@ -74,7 +74,7 @@
    protected PortletInvokerSupport container;
 
    /** . */
-   protected ProducerPersistenceManagerService producerPersistenceManager;
+   protected PortletStatePersistenceManagerService portletStatePersistenceManager;
 
    /** . */
    protected StateManagementPolicyService stateManagementPolicy;
@@ -88,7 +88,7 @@
       consumerPersistenceManager = new ConsumerPersistenceManagerService();
       producer = new ProducerPortletInvoker();
       container = new PortletInvokerSupport();
-      producerPersistenceManager = new ProducerPersistenceManagerService();
+      portletStatePersistenceManager = new PortletStatePersistenceManagerService();
       stateManagementPolicy = new StateManagementPolicyService();
       stateConverter = new StateConverterService();
 
@@ -97,7 +97,7 @@
 
       //
       producer.setPortletInvoker(container);
-      producer.setPersistenceManager(producerPersistenceManager);
+      producer.setPersistenceManager(portletStatePersistenceManager);
       producer.setStateManagementPolicy(stateManagementPolicy);
       producer.setStateConverter(stateConverter);
 

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	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -27,7 +27,7 @@
 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.producer.ProducerPersistenceManagerService;
+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;
@@ -66,7 +66,7 @@
    protected PortletInvokerSupport container;
 
    /** . */
-   protected ProducerPersistenceManagerService persistenceManager;
+   protected PortletStatePersistenceManagerService persistenceManager;
 
    /** . */
    protected StateManagementPolicyService stateManagementPolicy;
@@ -78,7 +78,7 @@
    {
       producer = new ProducerPortletInvoker();
       container = new PortletInvokerSupport();
-      persistenceManager = new ProducerPersistenceManagerService();
+      persistenceManager = new PortletStatePersistenceManagerService();
       stateManagementPolicy = new StateManagementPolicyService();
       stateConverter = new StateConverterService();
 

Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/state/StateConverterV0TestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/state/StateConverterV0TestCase.java	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/state/StateConverterV0TestCase.java	2006-12-15 17:31:20 UTC (rev 5873)
@@ -29,7 +29,7 @@
 import org.jboss.portal.portlet.state.SimplePropertyMap;
 import org.jboss.portal.portlet.state.StateConversionException;
 import org.jboss.portal.portlet.state.StateConverter;
-import org.jboss.portal.portlet.state.producer.ProducerState;
+import org.jboss.portal.portlet.state.producer.PortletState;
 import org.jboss.portal.portlet.test.ValueMapAssert;
 
 /**
@@ -63,7 +63,7 @@
 
    public void testAlteredMagic() throws StateConversionException
    {
-      byte[] bytes = converter.marshall(new ProducerState("foo"));
+      byte[] bytes = converter.marshall(new PortletState("foo"));
       bytes[0] = (byte)0xCA;
       bytes[1] = (byte)0xFE;
       bytes[2] = (byte)0xBA;
@@ -80,7 +80,7 @@
 
    public void testBadVersionNumber() throws StateConversionException
    {
-      byte[] bytes = converter.marshall(new ProducerState("foo"));
+      byte[] bytes = converter.marshall(new PortletState("foo"));
       bytes[4] = (byte)0x01;
       try
       {
@@ -94,7 +94,7 @@
 
    public void testWorks() throws Exception
    {
-      assertWorks(new ProducerState("foo"));
+      assertWorks(new PortletState("foo"));
 
       //
       PropertyMap props = new SimplePropertyMap();
@@ -105,14 +105,14 @@
       props.setProperty("mn", new StringValue(new String[]{"op", null}));
       props.setProperty("qr", new StringValue(new String[]{null, "st"}));
       props.setProperty("uv", new StringValue(new String[]{"wx", null, "yz"}));
-      assertWorks(new ProducerState("bar", props));
+      assertWorks(new PortletState("bar", props));
    }
 
-   private void assertWorks(ProducerState expectedState) throws Exception
+   private void assertWorks(PortletState expectedState) throws Exception
    {
       byte[] bytes = converter.marshall(expectedState);
       assertNotNull(bytes);
-      ProducerState state = converter.unmarshall(bytes);
+      PortletState state = converter.unmarshall(bytes);
       assertNotNull(state);
 
       //

Modified: trunk/portlet/src/resources/tck-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/portlet/src/resources/tck-sar/META-INF/jboss-service.xml	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/portlet/src/resources/tck-sar/META-INF/jboss-service.xml	2006-12-15 17:31:20 UTC (rev 5873)
@@ -229,7 +229,7 @@
 
    <!-- Preferences -->
    <mbean
-      code="org.jboss.portal.portlet.impl.state.producer.ProducerPersistenceManagerService"
+      code="org.jboss.portal.portlet.impl.state.producer.PortletStatePersistenceManagerService"
       name="portal:service=StateStore,type=Producer"
       xmbean-dd=""
       xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">

Modified: trunk/portlet/src/resources/test-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/portlet/src/resources/test-sar/META-INF/jboss-service.xml	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/portlet/src/resources/test-sar/META-INF/jboss-service.xml	2006-12-15 17:31:20 UTC (rev 5873)
@@ -207,7 +207,7 @@
 
    <!-- The producer portlet invoker -->
    <mbean
-      code="org.jboss.portal.portlet.impl.state.producer.ProducerPersistenceManagerService"
+      code="org.jboss.portal.portlet.impl.state.producer.PortletStatePersistenceManagerService"
       name="portal:service=PersistenceManager,type=Producer"
       xmbean-dd=""
       xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">

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	2006-12-15 16:04:07 UTC (rev 5872)
+++ trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml	2006-12-15 17:31:20 UTC (rev 5873)
@@ -108,7 +108,7 @@
 
    <!-- The producer portlet invoker -->
    <mbean
-      code="org.jboss.portal.portlet.impl.state.producer.ProducerPersistenceManagerService"
+      code="org.jboss.portal.portlet.impl.state.producer.PortletStatePersistenceManagerService"
       name="portal:service=PersistenceManager,type=Producer"
       xmbean-dd=""
       xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">




More information about the portal-commits mailing list