[gatein-commits] gatein SVN: r4442 - in components/wsrp/trunk: api/src/main/java/org/gatein/wsrp/api and 11 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Sep 30 08:12:59 EDT 2010


Author: chris.laprun at jboss.com
Date: 2010-09-30 08:12:57 -0400 (Thu, 30 Sep 2010)
New Revision: 4442

Added:
   components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/context/
   components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/context/ConsumerStructureProvider.java
   components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/context/ProducerContext.java
   components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/session/
   components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/session/SessionEvent.java
   components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/session/SessionEventBroadcaster.java
   components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/session/SessionEventListener.java
Removed:
   components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/PortalStructureProvider.java
   components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/SessionEvent.java
   components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/SessionEventBroadcaster.java
   components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/SessionEventListener.java
Modified:
   components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java
   components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/WSRPConsumer.java
   components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java
   components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/SessionHandler.java
   components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/InMemoryMigrationService.java
   components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/MigrationService.java
   components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/AbstractConsumerRegistry.java
   components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/ConsumerRegistry.java
   components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockConsumerRegistry.java
   components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java
   components/wsrp/trunk/producer/pom.xml
   components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducer.java
   components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java
   components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/WSRP1Producer.java
Log:
- GTNWSRP-77: Moved session-related API to a session package and added context package to gather APIs related to the context in which the WSRP runs. Renamed PortalStructureProvider to ConsumerStructureProvider to be more explicit.
- GTNWSRP-44: Add hook for producer to retrieve list of supported locales from host portal.

Modified: components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java	2010-09-30 11:19:34 UTC (rev 4441)
+++ components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java	2010-09-30 12:12:57 UTC (rev 4442)
@@ -30,7 +30,7 @@
 import org.gatein.pc.api.PortletInvokerException;
 import org.gatein.wsrp.WSRPConsumer;
 import org.gatein.wsrp.WSRPUtils;
-import org.gatein.wsrp.api.PortalStructureProvider;
+import org.gatein.wsrp.api.context.ConsumerStructureProvider;
 import org.gatein.wsrp.consumer.EndpointConfigurationInfo;
 import org.gatein.wsrp.consumer.ProducerInfo;
 import org.gatein.wsrp.consumer.RegistrationInfo;
@@ -615,7 +615,7 @@
          }
          ImportInfo info = consumer.importPortlets(currentExport.getExport(), WSRPUtils.transform(portletsToImport, SELECTABLE_TO_HANDLE));
 
-         PortalStructureProvider structureProvider = consumer.getMigrationService().getStructureProvider();
+         ConsumerStructureProvider structureProvider = consumer.getMigrationService().getStructureProvider();
          int importCount = 0;
          for (SelectablePortletHandle importedPortlet : portletsToImport)
          {
@@ -682,9 +682,9 @@
       private boolean selected;
       private String page;
       private String window;
-      private PortalStructureProvider provider;
+      private ConsumerStructureProvider provider;
 
-      public SelectablePortletHandle(String handle, PortalStructureProvider provider)
+      public SelectablePortletHandle(String handle, ConsumerStructureProvider provider)
       {
          this.handle = handle;
          this.provider = provider;
@@ -772,7 +772,7 @@
       private List<FailedPortletsDisplay> failedPortlets;
       private List<SelectablePortletHandle> exportedPortlets;
 
-      public ExportInfoDisplay(ExportInfo export, Locale locale, PortalStructureProvider provider)
+      public ExportInfoDisplay(ExportInfo export, Locale locale, ConsumerStructureProvider provider)
       {
          this.export = export;
          this.locale = locale;

Deleted: components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/PortalStructureProvider.java
===================================================================
--- components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/PortalStructureProvider.java	2010-09-30 11:19:34 UTC (rev 4441)
+++ components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/PortalStructureProvider.java	2010-09-30 12:12:57 UTC (rev 4442)
@@ -1,41 +0,0 @@
-/*
- * JBoss, a division of Red Hat
- * Copyright 2010, 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.gatein.wsrp.api;
-
-import org.gatein.pc.api.PortletContext;
-
-import java.util.List;
-
-/**
- * @author <a href="mailto:chris.laprun at jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public interface PortalStructureProvider
-{
-   List<String> getPageIdentifiers();
-
-   List<String> getWindowIdentifiersFor(String pageId);
-
-   void assignPortletToWindow(PortletContext portletContext, String windowId, String pageId);
-}

Deleted: components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/SessionEvent.java
===================================================================
--- components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/SessionEvent.java	2010-09-30 11:19:34 UTC (rev 4441)
+++ components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/SessionEvent.java	2010-09-30 12:12:57 UTC (rev 4442)
@@ -1,42 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat                                               *
- * Copyright 2009, 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.gatein.wsrp.api;
-
-import javax.servlet.http.HttpSession;
-
-/**
- * @author <a href="mailto:chris.laprun at jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public interface SessionEvent
-{
-   enum SessionEventType
-   {
-      SESSION_CREATED, SESSION_DESTROYED
-   }
-
-   SessionEventType getType();
-
-   HttpSession getSession();
-}

Deleted: components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/SessionEventBroadcaster.java
===================================================================
--- components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/SessionEventBroadcaster.java	2010-09-30 11:19:34 UTC (rev 4441)
+++ components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/SessionEventBroadcaster.java	2010-09-30 12:12:57 UTC (rev 4442)
@@ -1,37 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat                                               *
- * Copyright 2009, 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.gatein.wsrp.api;
-
-/**
- * @author <a href="mailto:chris.laprun at jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public interface SessionEventBroadcaster
-{
-   public void registerListener(String listenerId, SessionEventListener listener);
-
-   public void unregisterListener(String listenerId);
-
-   public void notifyListenersOf(SessionEvent event);
-}

Deleted: components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/SessionEventListener.java
===================================================================
--- components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/SessionEventListener.java	2010-09-30 11:19:34 UTC (rev 4441)
+++ components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/SessionEventListener.java	2010-09-30 12:12:57 UTC (rev 4442)
@@ -1,33 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat                                               *
- * Copyright 2009, 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.gatein.wsrp.api;
-
-/**
- * @author <a href="mailto:chris.laprun at jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public interface SessionEventListener
-{
-   void onSessionEvent(SessionEvent event);
-}

Added: components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/context/ConsumerStructureProvider.java
===================================================================
--- components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/context/ConsumerStructureProvider.java	                        (rev 0)
+++ components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/context/ConsumerStructureProvider.java	2010-09-30 12:12:57 UTC (rev 4442)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, 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.gatein.wsrp.api.context;
+
+import org.gatein.pc.api.PortletContext;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun at jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public interface ConsumerStructureProvider
+{
+   List<String> getPageIdentifiers();
+
+   List<String> getWindowIdentifiersFor(String pageId);
+
+   void assignPortletToWindow(PortletContext portletContext, String windowId, String pageId);
+}

Added: components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/context/ProducerContext.java
===================================================================
--- components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/context/ProducerContext.java	                        (rev 0)
+++ components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/context/ProducerContext.java	2010-09-30 12:12:57 UTC (rev 4442)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, 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.gatein.wsrp.api.context;
+
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:chris.laprun at jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public interface ProducerContext
+{
+   List<Locale> getSupportedLocales();
+}

Copied: components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/session/SessionEvent.java (from rev 4428, components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/SessionEvent.java)
===================================================================
--- components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/session/SessionEvent.java	                        (rev 0)
+++ components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/session/SessionEvent.java	2010-09-30 12:12:57 UTC (rev 4442)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, 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.gatein.wsrp.api.session;
+
+import javax.servlet.http.HttpSession;
+
+/**
+ * @author <a href="mailto:chris.laprun at jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public interface SessionEvent
+{
+   enum SessionEventType
+   {
+      SESSION_CREATED, SESSION_DESTROYED
+   }
+
+   SessionEventType getType();
+
+   HttpSession getSession();
+}

Copied: components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/session/SessionEventBroadcaster.java (from rev 4428, components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/SessionEventBroadcaster.java)
===================================================================
--- components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/session/SessionEventBroadcaster.java	                        (rev 0)
+++ components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/session/SessionEventBroadcaster.java	2010-09-30 12:12:57 UTC (rev 4442)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, 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.gatein.wsrp.api.session;
+
+/**
+ * @author <a href="mailto:chris.laprun at jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public interface SessionEventBroadcaster
+{
+   public void registerListener(String listenerId, SessionEventListener listener);
+
+   public void unregisterListener(String listenerId);
+
+   public void notifyListenersOf(SessionEvent event);
+}

Copied: components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/session/SessionEventListener.java (from rev 4428, components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/SessionEventListener.java)
===================================================================
--- components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/session/SessionEventListener.java	                        (rev 0)
+++ components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/session/SessionEventListener.java	2010-09-30 12:12:57 UTC (rev 4442)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, 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.gatein.wsrp.api.session;
+
+/**
+ * @author <a href="mailto:chris.laprun at jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public interface SessionEventListener
+{
+   void onSessionEvent(SessionEvent event);
+}

Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/WSRPConsumer.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/WSRPConsumer.java	2010-09-30 11:19:34 UTC (rev 4441)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/WSRPConsumer.java	2010-09-30 12:12:57 UTC (rev 4442)
@@ -26,7 +26,7 @@
 import org.gatein.pc.api.PortletInvoker;
 import org.gatein.pc.api.PortletInvokerException;
 import org.gatein.pc.api.invocation.PortletInvocation;
-import org.gatein.wsrp.api.SessionEventListener;
+import org.gatein.wsrp.api.session.SessionEventListener;
 import org.gatein.wsrp.consumer.ProducerInfo;
 import org.gatein.wsrp.consumer.RefreshResult;
 import org.gatein.wsrp.consumer.handlers.ProducerSessionInformation;

Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java	2010-09-30 11:19:34 UTC (rev 4441)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java	2010-09-30 12:12:57 UTC (rev 4442)
@@ -46,7 +46,7 @@
 import org.gatein.wsrp.WSRPConsumer;
 import org.gatein.wsrp.WSRPTypeFactory;
 import org.gatein.wsrp.WSRPUtils;
-import org.gatein.wsrp.api.SessionEvent;
+import org.gatein.wsrp.api.session.SessionEvent;
 import org.gatein.wsrp.consumer.handlers.InvocationDispatcher;
 import org.gatein.wsrp.consumer.handlers.ProducerSessionInformation;
 import org.gatein.wsrp.consumer.handlers.SessionHandler;

Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/SessionHandler.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/SessionHandler.java	2010-09-30 11:19:34 UTC (rev 4441)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/SessionHandler.java	2010-09-30 12:12:57 UTC (rev 4442)
@@ -29,8 +29,8 @@
 import org.gatein.pc.api.PortletInvokerException;
 import org.gatein.pc.api.invocation.PortletInvocation;
 import org.gatein.wsrp.WSRPTypeFactory;
-import org.gatein.wsrp.api.SessionEvent;
-import org.gatein.wsrp.api.SessionEventListener;
+import org.gatein.wsrp.api.session.SessionEvent;
+import org.gatein.wsrp.api.session.SessionEventListener;
 import org.gatein.wsrp.consumer.WSRPConsumerImpl;
 import org.gatein.wsrp.consumer.portlet.info.WSRPPortletInfo;
 import org.gatein.wsrp.handler.RequestHeaderClientHandler;

Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/InMemoryMigrationService.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/InMemoryMigrationService.java	2010-09-30 11:19:34 UTC (rev 4441)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/InMemoryMigrationService.java	2010-09-30 12:12:57 UTC (rev 4442)
@@ -24,7 +24,7 @@
 package org.gatein.wsrp.consumer.migration;
 
 import org.gatein.common.util.ParameterValidation;
-import org.gatein.wsrp.api.PortalStructureProvider;
+import org.gatein.wsrp.api.context.ConsumerStructureProvider;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -38,14 +38,14 @@
 public class InMemoryMigrationService implements MigrationService
 {
    private SortedMap<Long, ExportInfo> exportInfos;
-   private PortalStructureProvider structureProvider;
+   private ConsumerStructureProvider structureProvider;
 
-   public PortalStructureProvider getStructureProvider()
+   public ConsumerStructureProvider getStructureProvider()
    {
       return structureProvider;
    }
 
-   public void setStructureProvider(PortalStructureProvider structureProvider)
+   public void setStructureProvider(ConsumerStructureProvider structureProvider)
    {
       this.structureProvider = structureProvider;
    }

Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/MigrationService.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/MigrationService.java	2010-09-30 11:19:34 UTC (rev 4441)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/MigrationService.java	2010-09-30 12:12:57 UTC (rev 4442)
@@ -23,7 +23,7 @@
 
 package org.gatein.wsrp.consumer.migration;
 
-import org.gatein.wsrp.api.PortalStructureProvider;
+import org.gatein.wsrp.api.context.ConsumerStructureProvider;
 
 import java.util.List;
 
@@ -33,9 +33,9 @@
  */
 public interface MigrationService
 {
-   PortalStructureProvider getStructureProvider();
+   ConsumerStructureProvider getStructureProvider();
 
-   void setStructureProvider(PortalStructureProvider structureProvider);
+   void setStructureProvider(ConsumerStructureProvider structureProvider);
 
    List<ExportInfo> getAvailableExportInfos();
 

Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/AbstractConsumerRegistry.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/AbstractConsumerRegistry.java	2010-09-30 11:19:34 UTC (rev 4441)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/AbstractConsumerRegistry.java	2010-09-30 12:12:57 UTC (rev 4442)
@@ -29,7 +29,7 @@
 import org.gatein.pc.federation.FederatedPortletInvoker;
 import org.gatein.pc.federation.FederatingPortletInvoker;
 import org.gatein.wsrp.WSRPConsumer;
-import org.gatein.wsrp.api.SessionEventBroadcaster;
+import org.gatein.wsrp.api.session.SessionEventBroadcaster;
 import org.gatein.wsrp.consumer.ConsumerException;
 import org.gatein.wsrp.consumer.ProducerInfo;
 import org.gatein.wsrp.consumer.WSRPConsumerImpl;

Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/ConsumerRegistry.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/ConsumerRegistry.java	2010-09-30 11:19:34 UTC (rev 4441)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/ConsumerRegistry.java	2010-09-30 12:12:57 UTC (rev 4442)
@@ -1,6 +1,6 @@
 /*
  * JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * Copyright 2010, 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.
@@ -25,7 +25,7 @@
 
 import org.gatein.pc.federation.FederatingPortletInvoker;
 import org.gatein.wsrp.WSRPConsumer;
-import org.gatein.wsrp.api.SessionEventBroadcaster;
+import org.gatein.wsrp.api.session.SessionEventBroadcaster;
 import org.gatein.wsrp.consumer.ConsumerException;
 import org.gatein.wsrp.consumer.ProducerInfo;
 import org.gatein.wsrp.consumer.migration.MigrationService;

Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockConsumerRegistry.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockConsumerRegistry.java	2010-09-30 11:19:34 UTC (rev 4441)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockConsumerRegistry.java	2010-09-30 12:12:57 UTC (rev 4442)
@@ -1,32 +1,32 @@
-/******************************************************************************
- * JBoss, a division of Red Hat                                               *
- * Copyright 2009, 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.                   *
- ******************************************************************************/
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, 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.gatein.wsrp.test.support;
 
 import org.gatein.common.util.ParameterValidation;
 import org.gatein.pc.federation.FederatingPortletInvoker;
 import org.gatein.wsrp.WSRPConsumer;
-import org.gatein.wsrp.api.SessionEventBroadcaster;
+import org.gatein.wsrp.api.session.SessionEventBroadcaster;
 import org.gatein.wsrp.consumer.ConsumerException;
 import org.gatein.wsrp.consumer.EndpointConfigurationInfo;
 import org.gatein.wsrp.consumer.ProducerInfo;

Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java	2010-09-30 11:19:34 UTC (rev 4441)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java	2010-09-30 12:12:57 UTC (rev 4442)
@@ -34,7 +34,7 @@
 import org.gatein.pc.api.state.PropertyChange;
 import org.gatein.pc.api.state.PropertyMap;
 import org.gatein.wsrp.WSRPConsumer;
-import org.gatein.wsrp.api.SessionEvent;
+import org.gatein.wsrp.api.session.SessionEvent;
 import org.gatein.wsrp.consumer.ProducerInfo;
 import org.gatein.wsrp.consumer.RefreshResult;
 import org.gatein.wsrp.consumer.handlers.ProducerSessionInformation;

Modified: components/wsrp/trunk/producer/pom.xml
===================================================================
--- components/wsrp/trunk/producer/pom.xml	2010-09-30 11:19:34 UTC (rev 4441)
+++ components/wsrp/trunk/producer/pom.xml	2010-09-30 12:12:57 UTC (rev 4442)
@@ -21,7 +21,8 @@
   ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <parent>
       <groupId>org.gatein.wsrp</groupId>
       <artifactId>wsrp-parent</artifactId>
@@ -41,6 +42,10 @@
          <groupId>org.gatein.wsrp</groupId>
          <artifactId>wsrp-common</artifactId>
       </dependency>
+      <dependency>
+         <groupId>org.gatein.wsrp</groupId>
+         <artifactId>wsrp-integration-api</artifactId>
+      </dependency>
 
       <dependency>
          <groupId>org.gatein.common</groupId>

Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducer.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducer.java	2010-09-30 11:19:34 UTC (rev 4441)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducer.java	2010-09-30 12:12:57 UTC (rev 4442)
@@ -26,6 +26,7 @@
 import org.gatein.exports.ExportManager;
 import org.gatein.pc.api.PortletInvoker;
 import org.gatein.registration.RegistrationManager;
+import org.gatein.wsrp.api.context.ProducerContext;
 import org.gatein.wsrp.producer.config.ProducerConfigurationChangeListener;
 import org.gatein.wsrp.producer.config.ProducerConfigurationService;
 
@@ -98,4 +99,8 @@
     * @param exportManager the ExportManager to be used by this WSRPProducer
     */
    void setExportManager(ExportManager exportManager);
+
+   ProducerContext getProducerContext();
+
+   void setProducerContext(ProducerContext producerContext);
 }

Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java	2010-09-30 11:19:34 UTC (rev 4441)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java	2010-09-30 12:12:57 UTC (rev 4442)
@@ -34,6 +34,8 @@
 import org.gatein.registration.RegistrationLocal;
 import org.gatein.registration.RegistrationManager;
 import org.gatein.wsrp.WSRPConstants;
+import org.gatein.wsrp.WSRPUtils;
+import org.gatein.wsrp.api.context.ProducerContext;
 import org.gatein.wsrp.producer.config.ProducerConfiguration;
 import org.gatein.wsrp.producer.config.ProducerConfigurationService;
 import org.gatein.wsrp.producer.config.ProducerRegistrationRequirements;
@@ -150,6 +152,9 @@
    /** export manager */
    private ExportManager exportManager;
 
+   /** producer context */
+   private ProducerContext producerContext;
+
    private boolean started = false;
 
    // On-demand class holder Singleton pattern (multi-thread safe)
@@ -360,6 +365,16 @@
       this.exportManager = exportManger;
    }
 
+   public ProducerContext getProducerContext()
+   {
+      return producerContext;
+   }
+
+   public void setProducerContext(ProducerContext producerContext)
+   {
+      this.producerContext = producerContext;
+   }
+
    public ExportManager getExportManager()
    {
       if (exportManager == null)
@@ -384,9 +399,9 @@
          registrationRequirements.addRegistrationPropertyChangeListener(registrationManager);
 
          registrationManager.setPolicy(registrationRequirements.getPolicy());
-         
+
          registrationManager.getPolicy().addPortletContextChangeListener(registrationManager);
-         
+
          started = true;
       }
    }
@@ -512,7 +527,14 @@
 
    public List<String> getSupportedLocales()
    {
-      return WSRPConstants.getDefaultLocales(); // todo: avoid hardcoding this at some point...
+      if (producerContext != null)
+      {
+         return WSRPUtils.convertLocalesToRFC3066LanguageTags(producerContext.getSupportedLocales());
+      }
+      else
+      {
+         return WSRPConstants.getDefaultLocales();
+      }
    }
 
    public void usingStrictModeChangedTo(boolean strictMode)

Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/WSRP1Producer.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/WSRP1Producer.java	2010-09-30 11:19:34 UTC (rev 4441)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/WSRP1Producer.java	2010-09-30 12:12:57 UTC (rev 4442)
@@ -26,6 +26,7 @@
 import org.gatein.exports.ExportManager;
 import org.gatein.pc.api.PortletInvoker;
 import org.gatein.registration.RegistrationManager;
+import org.gatein.wsrp.api.context.ProducerContext;
 import org.gatein.wsrp.producer.ProducerHolder;
 import org.gatein.wsrp.producer.WSRPProducer;
 import org.gatein.wsrp.producer.config.ProducerConfigurationService;
@@ -180,6 +181,16 @@
       producer.setExportManager(exportManager);
    }
 
+   public ProducerContext getProducerContext()
+   {
+      return producer.getProducerContext();
+   }
+
+   public void setProducerContext(ProducerContext producerContext)
+   {
+      producer.setProducerContext(producerContext);
+   }
+
    public V1ServiceDescription getServiceDescription(V1GetServiceDescription gs) throws V1InvalidRegistration, V1OperationFailed
    {
       try



More information about the gatein-commits mailing list