JBoss Portal SVN: r5788 - trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2006-12-10 20:32:38 -0500 (Sun, 10 Dec 2006)
New Revision: 5788
Added:
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/RegistrationLocal.java
Log:
add RegistrationLocal to keep track of the consumer registration assocated with the wsrp invocation
Added: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/RegistrationLocal.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/RegistrationLocal.java 2006-12-11 00:58:34 UTC (rev 5787)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/RegistrationLocal.java 2006-12-11 01:32:38 UTC (rev 5788)
@@ -0,0 +1,48 @@
+/******************************************************************************
+ * 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.wsrp.producer.registration;
+
+import org.jboss.portal.wsrp.producer.registration.api.Registration;
+
+/**
+ * Hold registration provided by the consumer for the duration of the invocation.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class RegistrationLocal
+{
+
+ /** The thread local to keep track of the registration associated with the current thread of execution. */
+ private static final ThreadLocal registrationLocal = new ThreadLocal();
+
+ public static void setRegistration(Registration registration)
+ {
+ registrationLocal.set(registration);
+ }
+
+ public static Registration getRegistration()
+ {
+ return (Registration)registrationLocal.get();
+ }
+}
19 years, 5 months
JBoss Portal SVN: r5787 - in trunk: core core/src/main/org/jboss/portal/core/impl/portlet/state wsrp/src/main/org/jboss/portal/test/wsrp/registration wsrp/src/main/org/jboss/portal/wsrp/producer/registration/api wsrp/src/main/org/jboss/portal/wsrp/producer/registration/impl wsrp/src/main/org/jboss/portal/wsrp/producer/registration/policies
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2006-12-10 19:58:34 -0500 (Sun, 10 Dec 2006)
New Revision: 5787
Added:
trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentConsumer.java
trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentConsumerGroup.java
trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentRegistration.java
Modified:
trunk/core/build.xml
trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentStateStore.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/registration/ConsumerGroupTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/registration/ConsumerTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/registration/RegistrationManagerTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/registration/RegistrationPersistenceManagerTestCase.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/api/Consumer.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/api/ConsumerGroup.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/api/RegistrationPersistenceManager.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/api/RegistrationPolicy.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/impl/ConsumerGroupImpl.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/impl/ConsumerImpl.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/impl/RegistrationManagerImpl.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/impl/RegistrationPersistenceManagerImpl.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/policies/DefaultRegistrationPolicy.java
Log:
- started registration persistence manager implementation, not functional yet
- renamed consumer identity field to consumer id
- did some argument method renaming for consistency
Modified: trunk/core/build.xml
===================================================================
--- trunk/core/build.xml 2006-12-10 21:28:02 UTC (rev 5786)
+++ trunk/core/build.xml 2006-12-11 00:58:34 UTC (rev 5787)
@@ -123,6 +123,7 @@
<path refid="jboss.portal-faces.classpath"/>
<path refid="jboss.portal-cms.classpath"/>
<path refid="jboss.portal-server.classpath"/>
+ <path refid="jboss.portal-wsrp.classpath"/>
<path refid="jboss.portal-portlet.classpath"/>
<path refid="jboss.portal-jems.classpath"/>
<path refid="jboss.portal-federation.classpath"/>
@@ -352,6 +353,7 @@
<fileset dir="${jboss.portal-security.root}/lib" includes="portal-security-lib.jar"/>
<fileset dir="${jboss.portal-samples.root}/lib" includes="portal-samples-lib.jar"/>
<fileset dir="${jboss.portal-identity.root}/lib" includes="portal-identity-lib.jar"/>
+ <fileset dir="${jboss.portal-wsrp.root}/lib" includes="portal-wsrp-lib.jar"/>
<fileset dir="${ehcache.ehcache.lib}" includes="ehcache.jar"/>
<fileset dir="${apache.collections.lib}" includes="commons-collections.jar"/>
<fileset dir="${facelets.facelets.lib}" includes="jsf-facelets.jar"/>
Added: trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentConsumer.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentConsumer.java 2006-12-10 21:28:02 UTC (rev 5786)
+++ trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentConsumer.java 2006-12-11 00:58:34 UTC (rev 5787)
@@ -0,0 +1,213 @@
+/******************************************************************************
+ * 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.wsrp.producer.registration.api.Consumer;
+import org.jboss.portal.wsrp.producer.registration.api.RegistrationStatus;
+import org.jboss.portal.wsrp.producer.registration.api.RegistrationException;
+import org.jboss.portal.wsrp.producer.registration.api.ConsumerGroup;
+import org.jboss.portal.wsrp.producer.registration.api.ConsumerCapabilities;
+import org.jboss.portal.wsrp.producer.registration.api.DuplicateRegistrationException;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Collections;
+import java.util.Set;
+import java.util.HashSet;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PersistentConsumer implements Consumer
+{
+
+ // Persistent fields
+
+ private String key;
+ private String persistentName;
+ private RegistrationStatus persistentStatus;
+ private String persistentAgent;
+
+ // Relationships
+
+ private Set relatedRegistrations;
+ private PersistentConsumerGroup relatedGroup;
+
+ /**
+ * Manager constructor.
+ *
+ * @param id
+ * @param name
+ */
+ PersistentConsumer(String id, String name)
+ {
+ this.key = id;
+ this.persistentName = name;
+ this.persistentStatus = RegistrationStatus.PENDING;
+ this.relatedRegistrations = new HashSet();
+ this.relatedGroup = null;
+ this.persistentAgent = null;
+ }
+
+ /**
+ * Hibernate constructor.
+ */
+ PersistentConsumer()
+ {
+ this.key = null;
+ this.persistentName = null;
+ this.persistentStatus = null;
+ this.relatedRegistrations = null;
+ this.relatedGroup = null;
+ this.persistentAgent = null;
+ }
+
+ // Hibernate
+
+ public String getKey()
+ {
+ return key;
+ }
+
+ public void setKey(String key)
+ {
+ this.key = key;
+ }
+
+ public String getPersistentName()
+ {
+ return persistentName;
+ }
+
+ public void setPersistentName(String persistentName)
+ {
+ this.persistentName = persistentName;
+ }
+
+ public RegistrationStatus getPersistentStatus()
+ {
+ return persistentStatus;
+ }
+
+ public void setPersistentStatus(RegistrationStatus persistentStatus)
+ {
+ this.persistentStatus = persistentStatus;
+ }
+
+ public String getPersistentAgent()
+ {
+ return persistentAgent;
+ }
+
+ public void setPersistentAgent(String persistentAgent)
+ {
+ this.persistentAgent = persistentAgent;
+ }
+
+ public Set getRelatedRegistrations()
+ {
+ return relatedRegistrations;
+ }
+
+ public void setRelatedRegistrations(Set relatedRegistrations)
+ {
+ this.relatedRegistrations = relatedRegistrations;
+ }
+
+ public PersistentConsumerGroup getRelatedGroup()
+ {
+ return relatedGroup;
+ }
+
+ public void setRelatedGroup(PersistentConsumerGroup relatedGroup)
+ {
+ this.relatedGroup = relatedGroup;
+ }
+
+ //
+
+ public String getName()
+ {
+ return persistentName;
+ }
+
+ public RegistrationStatus getStatus()
+ {
+ return persistentStatus;
+ }
+
+ public void setStatus(RegistrationStatus status)
+ {
+ this.persistentStatus = status;
+ }
+
+ public Collection getRegistrations() throws RegistrationException
+ {
+ return Collections.unmodifiableSet(relatedRegistrations);
+ }
+
+ public ConsumerGroup getGroup()
+ {
+ return relatedGroup;
+ }
+
+ public String getId()
+ {
+ return key;
+ }
+
+ public ConsumerCapabilities getCapabilities()
+ {
+ return null;
+ }
+
+ public void setCapabilities(ConsumerCapabilities capabilities)
+ {
+
+ }
+
+ public void setGroup(ConsumerGroup group) throws RegistrationException, DuplicateRegistrationException
+ {
+ if (this.relatedGroup != null)
+ {
+ this.relatedGroup.removeConsumer(this);
+ }
+
+ //
+ if (group != null)
+ {
+ group.addConsumer(this);
+ }
+ }
+
+ public String getConsumerAgent()
+ {
+ return persistentAgent;
+ }
+
+ public void setConsumerAgent(String consumerAgent) throws IllegalArgumentException, IllegalStateException
+ {
+ this.persistentAgent = consumerAgent;
+ }
+}
Added: 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-10 21:28:02 UTC (rev 5786)
+++ trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentConsumerGroup.java 2006-12-11 00:58:34 UTC (rev 5787)
@@ -0,0 +1,172 @@
+/******************************************************************************
+ * 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.wsrp.producer.registration.api.ConsumerGroup;
+import org.jboss.portal.wsrp.producer.registration.api.RegistrationException;
+import org.jboss.portal.wsrp.producer.registration.api.Consumer;
+import org.jboss.portal.wsrp.producer.registration.api.RegistrationStatus;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Collections;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PersistentConsumerGroup implements ConsumerGroup
+{
+
+ // Persistent fields
+
+ private String persistentName;
+ private RegistrationStatus persistentStatus;
+
+ // Relationships
+
+ private Map relatedConsumers;
+
+ public PersistentConsumerGroup(String name)
+ {
+ this.persistentName = name;
+ this.relatedConsumers = new HashMap();
+ this.persistentStatus = RegistrationStatus.PENDING;
+ }
+
+ public PersistentConsumerGroup()
+ {
+ }
+
+ // Hibernate
+
+ public String getPersistentName()
+ {
+ return persistentName;
+ }
+
+ public void setPersistentName(String persistentName)
+ {
+ this.persistentName = persistentName;
+ }
+
+ public RegistrationStatus getPersistentStatus()
+ {
+ return persistentStatus;
+ }
+
+ public void setPersistentStatus(RegistrationStatus persistentStatus)
+ {
+ this.persistentStatus = persistentStatus;
+ }
+
+ public Map getRelatedConsumers()
+ {
+ return relatedConsumers;
+ }
+
+ public void setRelatedConsumers(Map relatedConsumers)
+ {
+ this.relatedConsumers = relatedConsumers;
+ }
+
+ //
+
+ public String getName()
+ {
+ return persistentName;
+ }
+
+ public Collection getConsumers() throws RegistrationException
+ {
+ return Collections.unmodifiableCollection(relatedConsumers.values());
+ }
+
+ public Consumer getConsumer(String consumerId) throws IllegalArgumentException, RegistrationException
+ {
+ return (Consumer)relatedConsumers.get(consumerId);
+ }
+
+ public void addConsumer(Consumer consumer) throws RegistrationException
+ {
+ validateImplementation(consumer);
+
+ //
+ if (relatedConsumers.containsKey(consumer.getId()))
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ relatedConsumers.put(consumer.getId(), consumer);
+ }
+
+ public void removeConsumer(Consumer consumer) throws RegistrationException
+ {
+ validateImplementation(consumer);
+
+ //
+ if (relatedConsumers.remove(consumer.getId()) == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ }
+
+ public boolean contains(Consumer consumer)
+ {
+ validateImplementation(consumer);
+ return relatedConsumers.containsKey(consumer.getId());
+ }
+
+ private PersistentConsumer validateImplementation(Consumer consumer) throws IllegalArgumentException
+ {
+ if (consumer == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (consumer instanceof PersistentConsumer)
+ {
+ return (PersistentConsumer)consumer;
+ }
+ else
+ {
+ throw new IllegalArgumentException();
+ }
+ }
+
+ public boolean isEmpty()
+ {
+ return relatedConsumers.isEmpty();
+ }
+
+ public RegistrationStatus getStatus()
+ {
+ return persistentStatus;
+ }
+
+ public void setStatus(RegistrationStatus status)
+ {
+ this.persistentStatus = status;
+ }
+}
Added: trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentRegistration.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentRegistration.java 2006-12-10 21:28:02 UTC (rev 5786)
+++ trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentRegistration.java 2006-12-11 00:58:34 UTC (rev 5787)
@@ -0,0 +1,212 @@
+/******************************************************************************
+ * 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.wsrp.producer.registration.api.Registration;
+import org.jboss.portal.wsrp.producer.registration.api.Consumer;
+import org.jboss.portal.wsrp.producer.registration.api.RegistrationStatus;
+
+import javax.xml.namespace.QName;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PersistentRegistration implements Registration
+{
+
+ // Persistent fields
+
+ private Long key;
+ private String persistentHandle;
+ private RegistrationStatus persistentStatus;
+ private Map persistentProperties;
+
+ // Relationships
+
+ private PersistentConsumer relatedConsumer;
+
+ /**
+ * Hibernate constructor.
+ */
+ PersistentRegistration()
+ {
+ this.key = null;
+ this.persistentHandle = null;
+ this.relatedConsumer = null;
+ this.persistentStatus = null;
+ }
+
+ PersistentRegistration(Map properties, RegistrationStatus status)
+ {
+ this.key = null;
+ this.persistentHandle = null;
+ this.relatedConsumer = null;
+ this.persistentStatus = status;
+ }
+
+ // Hibernate
+
+ public Long getKey()
+ {
+ return key;
+ }
+
+ public void setKey(Long key)
+ {
+ this.key = key;
+ }
+
+ public String getPersistentHandle()
+ {
+ return persistentHandle;
+ }
+
+ public void setPersistentHandle(String persistentHandle)
+ {
+ this.persistentHandle = persistentHandle;
+ }
+
+ public PersistentConsumer getRelatedConsumer()
+ {
+ return relatedConsumer;
+ }
+
+ public void setRelatedConsumer(PersistentConsumer relatedConsumer)
+ {
+ this.relatedConsumer = relatedConsumer;
+ }
+
+ public RegistrationStatus getPersistentStatus()
+ {
+ return persistentStatus;
+ }
+
+ public void setPersistentStatus(RegistrationStatus persistentStatus)
+ {
+ this.persistentStatus = persistentStatus;
+ }
+
+ public Map getPersistentProperties()
+ {
+ return persistentProperties;
+ }
+
+ public void setPersistentProperties(Map persistentProperties)
+ {
+ this.persistentProperties = persistentProperties;
+ }
+
+ //
+
+ public String getId()
+ {
+ if (key == null)
+ {
+ // If that ever happens it is a bug
+ throw new IllegalStateException("Transient registration object");
+ }
+ return key.toString();
+ }
+
+ public void setRegistrationHandle(String handle)
+ {
+ this.persistentHandle = handle;
+ }
+
+ public String getRegistrationHandle()
+ {
+ return persistentHandle;
+ }
+
+ public Consumer getConsumer()
+ {
+ return relatedConsumer;
+ }
+
+ public Map getProperties()
+ {
+ return null;
+ }
+
+ public void setPropertyValueFor(QName propertyName, Object value)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void setPropertyValueFor(String propertyName, Object value)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public boolean hasEqualProperties(Registration registration)
+ {
+ return false; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public boolean hasEqualProperties(Map properties)
+ {
+ return false; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public RegistrationStatus getStatus()
+ {
+ return persistentStatus;
+ }
+
+ public void setStatus(RegistrationStatus status)
+ {
+ this.persistentStatus = status;
+ }
+
+ public void clearAssociatedState()
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void updateProperties(Map registrationProperties)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void removeProperty(QName propertyName)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void removeProperty(String propertyName)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public Object getPropertyValueFor(QName propertyName)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public Object getPropertyValueFor(String propertyName)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+}
Modified: 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-10 21:28:02 UTC (rev 5786)
+++ trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/PersistentStateStore.java 2006-12-11 00:58:34 UTC (rev 5787)
@@ -33,15 +33,24 @@
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.wsrp.producer.registration.api.RegistrationPersistenceManager;
+import org.jboss.portal.wsrp.producer.registration.api.Consumer;
+import org.jboss.portal.wsrp.producer.registration.api.RegistrationException;
+import org.jboss.portal.wsrp.producer.registration.api.ConsumerGroup;
+import org.jboss.portal.wsrp.producer.registration.api.Registration;
+import org.jboss.portal.wsrp.producer.registration.api.NoSuchRegistrationException;
+import org.jboss.portal.wsrp.producer.registration.api.RegistrationStatus;
import javax.naming.InitialContext;
import java.util.Iterator;
+import java.util.Map;
+import java.util.Collection;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public class PersistentStateStore extends AbstractJBossService implements ProducerPersistenceManager
+public class PersistentStateStore extends AbstractJBossService implements ProducerPersistenceManager, RegistrationPersistenceManager
{
/** . */
@@ -229,4 +238,253 @@
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();
+
+ // Create and persist
+ PersistentConsumerGroup group = new PersistentConsumerGroup(name);
+ session.persist(session);
+
+ //
+ 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);
+ }
+
+ 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
+ {
+ // Get hibernate session
+ Session session = getCurrentSession();
+
+ // Perform lookup
+ PersistentConsumer consumer = getConsumerById(session, consumerId);
+
+ // Create and persist registration
+ PersistentRegistration registration = new PersistentRegistration(registrationProperties, RegistrationStatus.PENDING);
+ session.persist(registration);
+
+ // Build relationship
+ registration.setRelatedConsumer(consumer);
+ consumer.getRelatedRegistrations().add(registration);
+
+ //
+ 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");
+ }
+
+ //
+ return (PersistentConsumer)session.get(PersistentConsumer.class, consumerId);
+ }
+
+ 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");
+ }
+
+ //
+ return (PersistentConsumerGroup)session.get(PersistentConsumerGroup.class, groupName);
+ }
}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/registration/ConsumerGroupTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/registration/ConsumerGroupTestCase.java 2006-12-10 21:28:02 UTC (rev 5786)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/registration/ConsumerGroupTestCase.java 2006-12-11 00:58:34 UTC (rev 5787)
@@ -72,7 +72,7 @@
assertEquals(1, group.getConsumers().size());
assertTrue(group.contains(c1));
assertEquals(group, c1.getGroup());
- assertEquals(c1, group.getConsumer(c1.getIdentity()));
+ assertEquals(c1, group.getConsumer(c1.getId()));
Consumer c2 = manager.createConsumer("c2");
group.addConsumer(c2);
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/registration/ConsumerTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/registration/ConsumerTestCase.java 2006-12-10 21:28:02 UTC (rev 5786)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/registration/ConsumerTestCase.java 2006-12-11 00:58:34 UTC (rev 5787)
@@ -94,6 +94,6 @@
public void testGetIdentity() throws Exception
{
- assertNotNull(consumer.getIdentity());
+ assertNotNull(consumer.getId());
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/registration/RegistrationManagerTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/registration/RegistrationManagerTestCase.java 2006-12-10 21:28:02 UTC (rev 5786)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/registration/RegistrationManagerTestCase.java 2006-12-11 00:58:34 UTC (rev 5787)
@@ -122,7 +122,7 @@
Consumer consumer = manager.createConsumer(name);
assertNotNull(consumer);
assertEquals(name, consumer.getName());
- assertNotNull(consumer.getIdentity());
+ assertNotNull(consumer.getId());
assertNull(consumer.getGroup());
Collection consumers = manager.getConsumers();
@@ -293,7 +293,7 @@
String groupName = "group";
String consumerName = "consumer";
Consumer consumer = manager.addConsumerToGroupNamed(consumerName, groupName, true, true);
- String consumerIdentity = consumer.getIdentity();
+ String consumerIdentity = consumer.getId();
Registration reg = manager.addRegistrationTo(consumerName, registrationProperties, false);
String handle = reg.getRegistrationHandle();
@@ -309,7 +309,7 @@
{
String consumerName = "consumer";
Consumer consumer = manager.createConsumer(consumerName);
- String consumerIdentity = consumer.getIdentity();
+ String consumerIdentity = consumer.getId();
Registration reg = manager.addRegistrationTo(consumerName, registrationProperties, false);
String handle = reg.getRegistrationHandle();
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/registration/RegistrationPersistenceManagerTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/registration/RegistrationPersistenceManagerTestCase.java 2006-12-10 21:28:02 UTC (rev 5786)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/registration/RegistrationPersistenceManagerTestCase.java 2006-12-11 00:58:34 UTC (rev 5787)
@@ -289,7 +289,7 @@
try
{
- manager.addRegistrationFor(consumer.getIdentity(), null);
+ manager.addRegistrationFor(consumer.getId(), null);
fail();
}
catch (IllegalArgumentException expected)
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/api/Consumer.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/api/Consumer.java 2006-12-10 21:28:02 UTC (rev 5786)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/api/Consumer.java 2006-12-11 00:58:34 UTC (rev 5787)
@@ -79,7 +79,7 @@
*
* @return this Consumer's identity.
*/
- String getIdentity();
+ String getId();
ConsumerCapabilities getCapabilities();
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/api/ConsumerGroup.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/api/ConsumerGroup.java 2006-12-10 21:28:02 UTC (rev 5786)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/api/ConsumerGroup.java 2006-12-11 00:58:34 UTC (rev 5787)
@@ -53,13 +53,13 @@
/**
* Return the member Consumer associated with the given identifier
*
- * @param consumerIdentity the identity of the Consumer to be retrieved
+ * @param consumerId
* @return the Consumer associated with the identity or <code>null</code> if no such Consumer is part of this
* ConsumerGroup
* @throws IllegalArgumentException if the consumer identity is null
* @throws RegistrationException
*/
- Consumer getConsumer(String consumerIdentity) throws IllegalArgumentException, RegistrationException;
+ Consumer getConsumer(String consumerId) throws IllegalArgumentException, RegistrationException;
void addConsumer(Consumer consumer) throws RegistrationException;
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/api/RegistrationPersistenceManager.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/api/RegistrationPersistenceManager.java 2006-12-10 21:28:02 UTC (rev 5786)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/api/RegistrationPersistenceManager.java 2006-12-11 00:58:34 UTC (rev 5787)
@@ -36,12 +36,10 @@
/**
* Creates a Consumer with the specified identity and name (which might be the same, depending on the policy)
*
- * @param identity the Consumer's identity
- * @param name the Consumer's name
- * @return
- * @throws RegistrationException
+ * @param consumerId
+ * @param consumerName
*/
- Consumer createConsumer(String identity, String name) throws RegistrationException;
+ Consumer createConsumer(String consumerId, String consumerName) throws RegistrationException;
/**
* Retrieves the ConsumerGroup identified by the specified name.
@@ -63,19 +61,27 @@
void removeConsumerGroup(String name) throws RegistrationException;
- void removeConsumer(String identity) throws RegistrationException;
+ void removeConsumer(String consumerId) throws RegistrationException;
- void removeRegistration(String id) throws RegistrationException;
+ void removeRegistration(String registrationId) throws RegistrationException;
- Consumer getConsumerByIdentity(String identity) throws RegistrationException;
+ /**
+ * Return an existing consumer from its id.
+ *
+ * @param consumerId the consumer id
+ * @return the consumer or null if it does not exist
+ * @throws IllegalArgumentException if the consumer id argument is null
+ * @throws RegistrationException
+ */
+ Consumer getConsumerById(String consumerId) throws IllegalArgumentException, RegistrationException;
- Registration addRegistrationFor(String consumerIdentity, Map registrationProperties) throws RegistrationException;
+ Registration addRegistrationFor(String consumerId, Map registrationProperties) throws RegistrationException;
Collection getConsumerGroups();
Registration getRegistration(String registrationId);
- Consumer addConsumerToGroupNamed(String consumerIdentity, String groupName) throws RegistrationException;
+ Consumer addConsumerToGroupNamed(String consumerId, String groupName) throws RegistrationException;
Collection getConsumers();
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/api/RegistrationPolicy.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/api/RegistrationPolicy.java 2006-12-10 21:28:02 UTC (rev 5786)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/api/RegistrationPolicy.java 2006-12-11 00:58:34 UTC (rev 5787)
@@ -39,7 +39,16 @@
String getGroupNameFor(String consumerName);
- String getConsumerIdentityFrom(String consumerName, Map registrationProperties)
+ /**
+ * Obtain a consumer id in function of the consumer name and registration properties.
+ *
+ * @param consumerName the consumer name
+ * @param registrationProperties the provided registration properties
+ * @return the consumer id
+ * @throws IllegalArgumentException
+ * @throws InvalidConsumerDataException
+ */
+ String getConsumerIdFrom(String consumerName, Map registrationProperties)
throws IllegalArgumentException, InvalidConsumerDataException;
void validateConsumerName(String consumerName)
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/impl/ConsumerGroupImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/impl/ConsumerGroupImpl.java 2006-12-10 21:28:02 UTC (rev 5786)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/impl/ConsumerGroupImpl.java 2006-12-11 00:58:34 UTC (rev 5787)
@@ -107,10 +107,10 @@
return Collections.unmodifiableCollection(consumers.values());
}
- public Consumer getConsumer(String consumerIdentity) throws IllegalArgumentException, RegistrationException
+ public Consumer getConsumer(String consumerId) throws IllegalArgumentException, RegistrationException
{
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerIdentity, "Consumer name", null);
- return (Consumer)consumers.get(consumerIdentity);
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerId, "Consumer name", null);
+ return (Consumer)consumers.get(consumerId);
}
public boolean isEmpty()
@@ -121,7 +121,7 @@
public void addConsumer(Consumer consumer) throws RegistrationException
{
ParameterValidation.throwIllegalArgExceptionIfNull(consumer, "Consumer");
- String identity = consumer.getIdentity();
+ String identity = consumer.getId();
if (consumers.containsKey(identity))
{
throw new DuplicateRegistrationException("ConsumerGroup named '" + name
@@ -136,10 +136,10 @@
{
ParameterValidation.throwIllegalArgExceptionIfNull(consumer, "Consumer");
- if (consumers.remove(consumer.getIdentity()) == null)
+ if (consumers.remove(consumer.getId()) == null)
{
throw new NoSuchRegistrationException("ConsumerGroup named '" + name
- + "' does not contain a Consumer named '" + consumer.getName() + "' (identity: '" + consumer.getIdentity()
+ + "' does not contain a Consumer named '" + consumer.getName() + "' (identity: '" + consumer.getId()
+ "')");
}
@@ -150,6 +150,6 @@
{
ParameterValidation.throwIllegalArgExceptionIfNull(consumer, "Consumer");
- return consumers.containsKey(consumer.getIdentity());
+ return consumers.containsKey(consumer.getId());
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/impl/ConsumerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/impl/ConsumerImpl.java 2006-12-10 21:28:02 UTC (rev 5786)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/impl/ConsumerImpl.java 2006-12-11 00:58:34 UTC (rev 5787)
@@ -103,7 +103,7 @@
return name;
}
- public String getIdentity()
+ public String getId()
{
return identity;
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/impl/RegistrationManagerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/impl/RegistrationManagerImpl.java 2006-12-10 21:28:02 UTC (rev 5786)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/impl/RegistrationManagerImpl.java 2006-12-11 00:58:34 UTC (rev 5787)
@@ -101,7 +101,7 @@
throws RegistrationException
{
// the policy determines the identity of the consumer based on the given information (note that this might be obsoleted by using WS-Security)
- String identity = policy.getConsumerIdentityFrom(consumerName, registrationProperties);
+ String identity = policy.getConsumerIdFrom(consumerName, registrationProperties);
// validate the registration information
policy.validateRegistrationDataFor(registrationProperties, identity);
@@ -126,7 +126,7 @@
// check with policy if we allow the consumer
policy.validateConsumerName(name);
- String identity = policy.getConsumerIdentityFrom(name, Collections.EMPTY_MAP);
+ String identity = policy.getConsumerIdFrom(name, Collections.EMPTY_MAP);
Consumer consumer = persistenceManager.createConsumer(identity, name);
@@ -170,7 +170,7 @@
}
}
- String identity = policy.getConsumerIdentityFrom(consumerName, Collections.EMPTY_MAP);
+ String identity = policy.getConsumerIdFrom(consumerName, Collections.EMPTY_MAP);
try
{
getOrCreateConsumer(identity, createConsumerIfNeeded, consumerName);
@@ -218,13 +218,13 @@
{
ParameterValidation.throwIllegalArgExceptionIfNull(consumer, "Consumer");
- removeConsumer(consumer.getIdentity());
+ removeConsumer(consumer.getId());
}
public Consumer getConsumerByIdentity(String identity) throws RegistrationException
{
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(identity, "identity", null);
- return persistenceManager.getConsumerByIdentity(identity);
+ return persistenceManager.getConsumerById(identity);
}
public Consumer getConsumerFor(String registrationHandle) throws RegistrationException
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/impl/RegistrationPersistenceManagerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/impl/RegistrationPersistenceManagerImpl.java 2006-12-10 21:28:02 UTC (rev 5786)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/impl/RegistrationPersistenceManagerImpl.java 2006-12-11 00:58:34 UTC (rev 5787)
@@ -51,14 +51,14 @@
private Map groups = new HashMap();
private Map registrations = new HashMap();
- public Consumer createConsumer(String identity, String name) throws RegistrationException
+ public Consumer createConsumer(String consumerId, String consumerName) throws RegistrationException
{
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(identity, "Consumer identity", null);
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(name, "Consumer name", null);
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerId, "Consumer identity", null);
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerName, "Consumer name", null);
- ConsumerImpl consumer = new ConsumerImpl(identity, name);
+ ConsumerImpl consumer = new ConsumerImpl(consumerId, consumerName);
consumer.setStatus(RegistrationStatus.PENDING);
- consumers.put(identity, consumer);
+ consumers.put(consumerId, consumer);
return consumer;
}
@@ -94,46 +94,46 @@
}
}
- public void removeConsumer(String identity) throws RegistrationException
+ public void removeConsumer(String consumerId) throws RegistrationException
{
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(identity, "Consumer identity", null);
- if (consumers.remove(identity) == null)
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerId, "Consumer identity", null);
+ if (consumers.remove(consumerId) == null)
{
- throw new RegistrationException("There is no Consumer with identity '" + identity + "'.");
+ throw new RegistrationException("There is no Consumer with identity '" + consumerId + "'.");
}
}
- public void removeRegistration(String id) throws RegistrationException
+ public void removeRegistration(String registrationId) throws RegistrationException
{
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "Registration identity", null);
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(registrationId, "Registration identity", null);
- RegistrationImpl registration = (RegistrationImpl)registrations.get(id);
+ RegistrationImpl registration = (RegistrationImpl)registrations.get(registrationId);
if (registration == null)
{
- throw new NoSuchRegistrationException("There is no Registration with id '" + id + "'");
+ throw new NoSuchRegistrationException("There is no Registration with id '" + registrationId + "'");
}
ConsumerImpl consumer = (ConsumerImpl)registration.getConsumer();
consumer.removeRegistration(registration);
- registrations.remove(id);
+ registrations.remove(registrationId);
}
- public Consumer getConsumerByIdentity(String identity) throws RegistrationException
+ public Consumer getConsumerById(String consumerId) throws RegistrationException
{
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(identity, "Consumer identity", null);
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerId, "Consumer identity", null);
- return (Consumer)consumers.get(identity);
+ return (Consumer)consumers.get(consumerId);
}
- public Registration addRegistrationFor(String consumerIdentity, Map registrationProperties) throws RegistrationException
+ public Registration addRegistrationFor(String consumerId, Map registrationProperties) throws RegistrationException
{
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerIdentity, "Consumer identity", null);
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerId, "Consumer identity", null);
ParameterValidation.throwIllegalArgExceptionIfNull(registrationProperties, "Registration properties");
- ConsumerImpl consumer = (ConsumerImpl)getConsumerByIdentity(consumerIdentity);
+ ConsumerImpl consumer = (ConsumerImpl)getConsumerById(consumerId);
if (consumer == null)
{
- throw new NoSuchRegistrationException("There is no Consumer with identity '" + consumerIdentity
+ throw new NoSuchRegistrationException("There is no Consumer with identity '" + consumerId
+ "' to add a Registration to...");
}
@@ -146,9 +146,9 @@
return registration;
}
- public Consumer addConsumerToGroupNamed(String consumerIdentity, String groupName) throws RegistrationException
+ public Consumer addConsumerToGroupNamed(String consumerId, String groupName) throws RegistrationException
{
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerIdentity, "Consumer identity", null);
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerId, "Consumer identity", null);
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(groupName, "ConsumerGroup name", null);
ConsumerGroupImpl group = (ConsumerGroupImpl)getConsumerGroup(groupName);
@@ -158,10 +158,10 @@
+ "' to add a Consumer to...");
}
- ConsumerImpl consumer = (ConsumerImpl)getConsumerByIdentity(consumerIdentity);
+ ConsumerImpl consumer = (ConsumerImpl)getConsumerById(consumerId);
if (consumer == null)
{
- throw new NoSuchRegistrationException("There is no Consumer with identity '" + consumerIdentity
+ throw new NoSuchRegistrationException("There is no Consumer with identity '" + consumerId
+ "' to add to ConsumerGroup named '" + groupName + "'. Did you create it?");
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/policies/DefaultRegistrationPolicy.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/policies/DefaultRegistrationPolicy.java 2006-12-10 21:28:02 UTC (rev 5786)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/registration/policies/DefaultRegistrationPolicy.java 2006-12-11 00:58:34 UTC (rev 5787)
@@ -106,7 +106,7 @@
}
/** Simply returns the given consumer name, trusted (!) to be unique. */
- public String getConsumerIdentityFrom(String consumerName, Map registrationProperties) throws IllegalArgumentException, InvalidConsumerDataException
+ public String getConsumerIdFrom(String consumerName, Map registrationProperties) throws IllegalArgumentException, InvalidConsumerDataException
{
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerName, "Consumer name", null);
return consumerName;
@@ -117,7 +117,7 @@
{
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerName, "Consumer name", null);
- Consumer consumer = manager.getConsumerByIdentity(getConsumerIdentityFrom(consumerName, Collections.EMPTY_MAP));
+ Consumer consumer = manager.getConsumerByIdentity(getConsumerIdFrom(consumerName, Collections.EMPTY_MAP));
if (consumer != null)
{
throw new DuplicateRegistrationException("A Consumer named '" + consumerName + "' has already been registered.");
19 years, 5 months
JBoss Portal SVN: r5786 - in branches/JBoss_Portal_Branch_2_4: portlet portlet/src/main/org/jboss/portal/test/framework/portlet/actions portlet/src/main/org/jboss/portal/test/portlet/ha/session test/src/main/org/jboss/portal/test/framework/container/client
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2006-12-10 16:28:02 -0500 (Sun, 10 Dec 2006)
New Revision: 5786
Modified:
branches/JBoss_Portal_Branch_2_4/portlet/build.xml
branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletActionTestAction.java
branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletRenderTestAction.java
branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/ServletServiceTestAction.java
branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/TestAction.java
branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/test/portlet/ha/session/MutableValue.java
branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/container/client/TestCase.java
Log:
minor tweaks in portlet session replication tests
Modified: branches/JBoss_Portal_Branch_2_4/portlet/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_4/portlet/build.xml 2006-12-10 16:50:16 UTC (rev 5785)
+++ branches/JBoss_Portal_Branch_2_4/portlet/build.xml 2006-12-10 21:28:02 UTC (rev 5786)
@@ -594,7 +594,7 @@
</x-sysproperty>
<x-test>
<test todir="${test.reports}" name="org.jboss.portal.test.portlet.ha.session.ReplicateMutableValueTestCase"/>
- <test todir="${test.reports}" name="org.jboss.portal.test.portlet.ha.session.ReplicateMutableValueTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.portlet.ha.session.ReplicateImmutableValueTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.portlet.ha.session.ModifyExistingAttributeWithoutExplicitSetDoesNotReplicateTestCase"/>
</x-test>
<x-classpath>
Modified: branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletActionTestAction.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletActionTestAction.java 2006-12-10 16:50:16 UTC (rev 5785)
+++ branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletActionTestAction.java 2006-12-10 21:28:02 UTC (rev 5786)
@@ -38,19 +38,18 @@
*/
public abstract class PortletActionTestAction extends TestAction
{
-
- public Result execute(Portlet servlet, ActionRequest request, ActionResponse response)
+ public Result execute(Portlet portlet, ActionRequest request, ActionResponse response)
{
try
{
- return run(servlet, request, response);
+ return run(portlet, request, response);
}
catch (Throwable t)
{
+ log.error("An error occured in the portlet action", t);
return decode(t);
}
}
protected abstract AssertResult run(Portlet portlet, ActionRequest request, ActionResponse response) throws PortletException, PortletSecurityException, IOException;
-
}
Modified: branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletRenderTestAction.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletRenderTestAction.java 2006-12-10 16:50:16 UTC (rev 5785)
+++ branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletRenderTestAction.java 2006-12-10 21:28:02 UTC (rev 5786)
@@ -37,15 +37,15 @@
*/
public abstract class PortletRenderTestAction extends TestAction
{
-
- public Result execute(Portlet servlet, RenderRequest request, RenderResponse response)
+ public Result execute(Portlet portlet, RenderRequest request, RenderResponse response)
{
try
{
- return run(servlet, request, response);
+ return run(portlet, request, response);
}
catch (Throwable t)
{
+ log.error("An error occured in the portlet render", t);
return decode(t);
}
}
Modified: branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/ServletServiceTestAction.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/ServletServiceTestAction.java 2006-12-10 16:50:16 UTC (rev 5785)
+++ branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/ServletServiceTestAction.java 2006-12-10 21:28:02 UTC (rev 5786)
@@ -38,24 +38,18 @@
*/
public abstract class ServletServiceTestAction extends TestAction
{
- protected abstract Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;
-
public Result execute(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
try
{
return run(servlet, request, response);
}
- catch (AssertionFailedError afe)
+ catch (Throwable t)
{
- //AssertResult.log.error("Failure during test", afe);
- return new AssertResult(afe);
+ log.error("An error occured in the servlet", t);
+ return decode(t);
}
- catch (Throwable e)
- {
- //AssertResult.log.error("Error during test", e);
- return new AssertResult(e);
- }
}
+ protected abstract Result run(Servlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;
}
Modified: branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/TestAction.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/TestAction.java 2006-12-10 16:50:16 UTC (rev 5785)
+++ branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/TestAction.java 2006-12-10 21:28:02 UTC (rev 5786)
@@ -26,6 +26,7 @@
import org.jboss.portal.test.framework.container.result.AssertResult;
import org.jboss.portal.test.framework.container.result.Result;
import org.jboss.portal.test.framework.junit.ExtendedAssert;
+import org.apache.log4j.Logger;
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
@@ -34,6 +35,9 @@
public abstract class TestAction extends ExtendedAssert
{
+ /** The logger. */
+ protected final Logger log = Logger.getLogger(getClass());
+
protected Result decode(Throwable t)
{
for (Throwable u = t; u != null; u = u.getCause())
Modified: branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/test/portlet/ha/session/MutableValue.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/test/portlet/ha/session/MutableValue.java 2006-12-10 16:50:16 UTC (rev 5785)
+++ branches/JBoss_Portal_Branch_2_4/portlet/src/main/org/jboss/portal/test/portlet/ha/session/MutableValue.java 2006-12-10 21:28:02 UTC (rev 5786)
@@ -74,4 +74,9 @@
string = in.readUTF();
System.out.print("Unserializing " + string);
}
+
+ public String toString()
+ {
+ return "MutableValue[" + string + "]";
+ }
}
Modified: branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/container/client/TestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/container/client/TestCase.java 2006-12-10 16:50:16 UTC (rev 5785)
+++ branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/container/client/TestCase.java 2006-12-10 21:28:02 UTC (rev 5786)
@@ -309,7 +309,7 @@
}
}
- public int executeMethod(HttpMethod method) throws Exception
+ public void executeMethod(HttpMethod method) throws Exception
{
int port = method.getURI().getPort();
if (port != -1)
@@ -343,8 +343,11 @@
//
log.info("# Invoking test case over http " + cfg + " " + method.getURI());
- //
- return client.executeMethod(cfg, method);
+ // Execute http method
+ client.executeMethod(cfg, method);
+
+ // Force a read of the response body
+ method.getResponseBody();
}
private Node getNode(int port)
19 years, 5 months
JBoss Portal SVN: r5785 - trunk/core/src/resources/portal-cms-sar/conf/hibernate/cms
by portal-commits@lists.jboss.org
Author: roy.russo(a)jboss.com
Date: 2006-12-10 11:50:16 -0500 (Sun, 10 Dec 2006)
New Revision: 5785
Modified:
trunk/core/src/resources/portal-cms-sar/conf/hibernate/cms/domain.hbm.xml
Log:
JBQA-452 - rollback sybase binary length, failing in mysql.
Modified: trunk/core/src/resources/portal-cms-sar/conf/hibernate/cms/domain.hbm.xml
===================================================================
--- trunk/core/src/resources/portal-cms-sar/conf/hibernate/cms/domain.hbm.xml 2006-12-10 14:21:08 UTC (rev 5784)
+++ trunk/core/src/resources/portal-cms-sar/conf/hibernate/cms/domain.hbm.xml 2006-12-10 16:50:16 UTC (rev 5785)
@@ -42,6 +42,7 @@
name="data"
column="BINVAL_DATA"
type="blob"
+ length="100000000"
not-null="true"/>
</class>
<class name="org.jboss.portal.cms.hibernate.state.VersionNode" table="jbp_cms_version_node" lazy="true">
@@ -60,6 +61,7 @@
name="data"
column="NODE_DATA"
type="binary"
+ length="100000000"
not-null="true"/>
</class>
<class name="org.jboss.portal.cms.hibernate.state.VersionProp" table="jbp_cms_version_prop" lazy="true">
@@ -78,6 +80,7 @@
name="data"
column="PROP_DATA"
type="binary"
+ length="100000000"
not-null="true"/>
</class>
<class name="org.jboss.portal.cms.hibernate.state.VersionRefs" table="jbp_cms_version_refs" lazy="true">
@@ -96,6 +99,7 @@
name="data"
column="REFS_DATA"
type="binary"
+ length="100000000"
not-null="true"/>
</class>
<class name="org.jboss.portal.cms.hibernate.state.WSPBinVal" table="jbp_cms_wsp_binval" lazy="true">
@@ -114,6 +118,7 @@
name="data"
column="BINVAL_DATA"
type="blob"
+ length="100000000"
not-null="true"/>
</class>
<class name="org.jboss.portal.cms.hibernate.state.WSPNode" table="jbp_cms_wsp_node" lazy="true">
@@ -132,6 +137,7 @@
name="data"
column="NODE_DATA"
type="binary"
+ length="100000000"
not-null="true"/>
</class>
<class name="org.jboss.portal.cms.hibernate.state.WSPProp" table="jbp_cms_wsp_prop" lazy="true">
@@ -150,6 +156,7 @@
name="data"
column="PROP_DATA"
type="binary"
+ length="100000000"
not-null="true"/>
</class>
<class name="org.jboss.portal.cms.hibernate.state.WSPRefs" table="jbp_cms_wsp_refs" lazy="true">
@@ -168,6 +175,7 @@
name="data"
column="REFS_DATA"
type="binary"
+ length="100000000"
not-null="true"/>
</class>
<class name="org.jboss.portal.cms.hibernate.CMSEntry" table="jbp_cms_cmsentry" lazy="true">
@@ -191,6 +199,7 @@
<property name="data"
column="FSENTRY_DATA"
type="blob"
+ length="100000000"
not-null="false"/>
<property name="lastmod"
column="FSENTRY_LASTMOD"
@@ -222,6 +231,7 @@
<property name="data"
column="FSENTRY_DATA"
type="blob"
+ length="100000000"
not-null="false"/>
<property name="lastmod"
column="FSENTRY_LASTMOD"
@@ -253,6 +263,7 @@
<property name="data"
column="FSENTRY_DATA"
type="blob"
+ length="100000000"
not-null="false"/>
<property name="lastmod"
column="FSENTRY_LASTMOD"
19 years, 5 months
JBoss Portal SVN: r5784 - branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-server-war/WEB-INF
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2006-12-10 09:21:08 -0500 (Sun, 10 Dec 2006)
New Revision: 5784
Modified:
branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-server-war/WEB-INF/jboss-web.xml
Log:
removed deprecated jboss web clustering option
Modified: branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-server-war/WEB-INF/jboss-web.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-server-war/WEB-INF/jboss-web.xml 2006-12-10 14:20:44 UTC (rev 5783)
+++ branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-server-war/WEB-INF/jboss-web.xml 2006-12-10 14:21:08 UTC (rev 5784)
@@ -27,7 +27,6 @@
<context-root>@portal.web.context-root@</context-root>
<replication-config>
<replication-trigger>SET_AND_GET</replication-trigger>
- <replication-type>SYNC</replication-type>
</replication-config>
<resource-ref>
<res-ref-name>jdbc/PortalDS</res-ref-name>
19 years, 5 months
JBoss Portal SVN: r5783 - branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-server-war/WEB-INF
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2006-12-10 09:20:44 -0500 (Sun, 10 Dec 2006)
New Revision: 5783
Removed:
branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-server-war/WEB-INF/server-layouts.xml
Log:
removed unnecessary file
Deleted: branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-server-war/WEB-INF/server-layouts.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-server-war/WEB-INF/server-layouts.xml 2006-12-10 14:19:46 UTC (rev 5782)
+++ branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-server-war/WEB-INF/server-layouts.xml 2006-12-10 14:20:44 UTC (rev 5783)
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<layouts/>
19 years, 5 months
JBoss Portal SVN: r5782 - trunk/core/src/resources/portal-server-war/WEB-INF
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2006-12-10 09:19:46 -0500 (Sun, 10 Dec 2006)
New Revision: 5782
Modified:
trunk/core/src/resources/portal-server-war/WEB-INF/jboss-web.xml
Log:
removed deprecated jboss web clustering option
Modified: trunk/core/src/resources/portal-server-war/WEB-INF/jboss-web.xml
===================================================================
--- trunk/core/src/resources/portal-server-war/WEB-INF/jboss-web.xml 2006-12-10 14:19:20 UTC (rev 5781)
+++ trunk/core/src/resources/portal-server-war/WEB-INF/jboss-web.xml 2006-12-10 14:19:46 UTC (rev 5782)
@@ -27,7 +27,6 @@
<context-root>@portal.web.context-root@</context-root>
<replication-config>
<replication-trigger>SET_AND_GET</replication-trigger>
- <replication-type>SYNC</replication-type>
</replication-config>
<resource-ref>
<res-ref-name>jdbc/PortalDS</res-ref-name>
19 years, 5 months
JBoss Portal SVN: r5781 - trunk/core/src/resources/portal-server-war/WEB-INF
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2006-12-10 09:19:20 -0500 (Sun, 10 Dec 2006)
New Revision: 5781
Removed:
trunk/core/src/resources/portal-server-war/WEB-INF/server-layouts.xml
Log:
remove unnecessary file
Deleted: trunk/core/src/resources/portal-server-war/WEB-INF/server-layouts.xml
===================================================================
--- trunk/core/src/resources/portal-server-war/WEB-INF/server-layouts.xml 2006-12-10 14:18:10 UTC (rev 5780)
+++ trunk/core/src/resources/portal-server-war/WEB-INF/server-layouts.xml 2006-12-10 14:19:20 UTC (rev 5781)
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<layouts/>
19 years, 5 months
JBoss Portal SVN: r5780 - trunk/core/src/main/org/jboss/portal/core/portlet/dashboard
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2006-12-10 09:18:10 -0500 (Sun, 10 Dec 2006)
New Revision: 5780
Modified:
trunk/core/src/main/org/jboss/portal/core/portlet/dashboard/Configurator.java
Log:
fix CCE in configurator due to refactorings, still issues in the editpage.jsp
Modified: trunk/core/src/main/org/jboss/portal/core/portlet/dashboard/Configurator.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/portlet/dashboard/Configurator.java 2006-12-10 12:11:17 UTC (rev 5779)
+++ trunk/core/src/main/org/jboss/portal/core/portlet/dashboard/Configurator.java 2006-12-10 14:18:10 UTC (rev 5780)
@@ -29,6 +29,7 @@
import org.jboss.portal.core.model.portal.PortalObjectContainer;
import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.Portal;
import org.jboss.portal.theme.LayoutService;
import org.jboss.portal.theme.PortalLayout;
import org.jboss.portal.theme.ThemeConstants;
@@ -108,15 +109,15 @@
op = "editPage";
}
- Page page = null;
+ Portal portal;
if (req.getParameter("editPageSelect") != null)
{
String editPageSelect = req.getParameter("editPageSelect");
- page = (Page)portalObjectContainer.getObject(dashboardId).getChild(editPageSelect);
+ portal = (Portal)portalObjectContainer.getObject(dashboardId).getChild(editPageSelect);
}
else
{
- page = (Page)portalObjectContainer.getObject(dashboardId).getChild(req.getUser().getUserName());
+ portal = (Portal)portalObjectContainer.getObject(dashboardId).getChild(req.getUser().getUserName());
}
List available_instances = (List)instanceContainer.getInstances();
@@ -126,7 +127,7 @@
try
{
- Map windowMap = getWindows(page);
+ Map windowMap = getWindows(portal.getDefaultPage());
List regions = new ArrayList(windowMap.keySet());
Collections.sort(regions);
@@ -160,7 +161,7 @@
}
List pages = new ArrayList();
- for (Iterator j = page.getPortal().getChildren().iterator(); j.hasNext();)
+ for (Iterator j = portal.getChildren().iterator(); j.hasNext();)
{
PortalObject object = (PortalObject)j.next();
if (object.getType() == PortalObject.TYPE_PAGE)
@@ -175,7 +176,7 @@
req.setAttribute("center_instances", center_instances);
req.setAttribute("right_instances", right_instances);
req.setAttribute("pages", pages);
- req.setAttribute("currentPage", page.getName());
+ req.setAttribute("currentPage", portal.getName());
PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/dashboard/editpage.jsp");
rd.include(req, resp);
}
19 years, 5 months
JBoss Portal SVN: r5779 - trunk/core/src/resources/portal-cms-sar/META-INF
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2006-12-10 07:11:17 -0500 (Sun, 10 Dec 2006)
New Revision: 5779
Modified:
trunk/core/src/resources/portal-cms-sar/META-INF/jboss-service.xml
Log:
JBPORTAL-1151 : jboss:service=DefaultPartition hardcoded in CMS cluster config
Modified: trunk/core/src/resources/portal-cms-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2006-12-10 12:10:10 UTC (rev 5778)
+++ trunk/core/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2006-12-10 12:11:17 UTC (rev 5779)
@@ -193,7 +193,7 @@
<mbean
code="org.jboss.portal.jems.ha.HASingletonInvoker"
name="portal:service=HASingletonInvoker,type=CMS">
- <depends>jboss:service=DefaultPartition</depends>
+ <depends>jboss:service=${jboss.partition.name:DefaultPartition}</depends>
<attribute name="RetryWaitingTimeMS">2000</attribute>
<attribute name="MaxRetries">5</attribute>
<attribute name="JNDIName">MyServiceInvokeTarget</attribute>
19 years, 5 months