From: Julien V. <ju...@jb...> - 2006-05-06 14:07:45
|
User: julien Date: 06/05/06 10:07:44 Modified: wsrp/src/main/org/jboss/portal/wsrp/consumer WSRPConsumerImpl.java Log: use linked map and set to keep the natural order in portlet invoker getPortlets() Revision Changes Path 1.16 +12 -10 jboss-portal/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java (In the diff below, changes in quantity of whitespace are not shown.) Index: WSRPConsumerImpl.java =================================================================== RCS file: /cvsroot/jboss/jboss-portal/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -b -r1.15 -r1.16 --- WSRPConsumerImpl.java 6 May 2006 07:42:59 -0000 1.15 +++ WSRPConsumerImpl.java 6 May 2006 14:07:44 -0000 1.16 @@ -80,21 +80,27 @@ import java.io.PrintWriter; import java.util.ArrayList; import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.LinkedHashSet; +import java.util.LinkedHashMap; /** * @author <a href="mailto:bol...@jb...">Boleslaw Dawidowicz</a> * @author <a href="mailto:chr...@jb...">Chris Laprun</a> - * @version $Revision: 1.15 $ + * @version $Revision: 1.16 $ * @since 2.4 */ public class WSRPConsumerImpl extends AbstractJBossService implements WSRPConsumer { + + private static final String SERVICE_DESCRIPTION = "service description"; + private static final String MARKUP = "markup"; + private static final String PORTLET_MANAGEMENT = "portlet management"; + private static final String REGISTRATION = "registration"; + /** The service description request sent to producer before registration happens. */ private final GetServiceDescription unregisteredServiceDescriptionRequest; @@ -104,12 +110,8 @@ /** The registration with the current producer. */ private RegistrationContext registrationContext; + /** The service factory. */ private ServiceFactory serviceFactory; - private static final String SERVICE_DESCRIPTION = "service description"; - private static final String MARKUP = "markup"; - private static final String PORTLET_MANAGEMENT = "portlet management"; - private static final String REGISTRATION = "registration"; - public WSRPConsumerImpl() { @@ -121,7 +123,7 @@ public Set getPortlets() { ServiceDescription sd = getServiceDescriptionAndRegisterIfNeeded(); - return new HashSet(extractOfferedPortlets(sd).values()); + return new LinkedHashSet(extractOfferedPortlets(sd).values()); } public Portlet getPortlet(String portletId) @@ -593,7 +595,7 @@ if (portletDescriptions != null) { int length = portletDescriptions.length; - Map portlets = new HashMap(length); + Map portlets = new LinkedHashMap(); for (int i = 0; i < length; i++) { |