[gatein-commits] gatein SVN: r3327 - components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Jun 14 08:43:10 EDT 2010


Author: chris.laprun at jboss.com
Date: 2010-06-14 08:43:09 -0400 (Mon, 14 Jun 2010)
New Revision: 3327

Modified:
   components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/MarkupEndpoint.java
   components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/ServiceDescriptionEndpoint.java
Log:
- GTNWSRP-43: more replacement of direct constructor calls to factory method.

Modified: components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/MarkupEndpoint.java
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/MarkupEndpoint.java	2010-06-14 10:51:37 UTC (rev 3326)
+++ components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/MarkupEndpoint.java	2010-06-14 12:43:09 UTC (rev 3327)
@@ -24,6 +24,7 @@
 package org.gatein.wsrp.endpoints.v1;
 
 import com.google.common.collect.Lists;
+import org.gatein.wsrp.WSRPTypeFactory;
 import org.gatein.wsrp.endpoints.WSRPBaseEndpoint;
 import org.gatein.wsrp.spec.v1.V1ToV2Converter;
 import org.gatein.wsrp.spec.v1.V2ToV1Converter;
@@ -112,11 +113,12 @@
 
       forceSessionAccess();
 
-      PerformBlockingInteraction performBlockingInteraction = new PerformBlockingInteraction();
-      performBlockingInteraction.setPortletContext(V1ToV2Converter.toV2PortletContext(portletContext));
-      performBlockingInteraction.setRuntimeContext(V1ToV2Converter.toV2RuntimeContext(runtimeContext));
-      performBlockingInteraction.setMarkupParams(V1ToV2Converter.toV2MarkupParams(markupParams));
-      performBlockingInteraction.setInteractionParams(V1ToV2Converter.toV2InteractionParams(interactionParams));
+      PerformBlockingInteraction performBlockingInteraction = WSRPTypeFactory.createPerformBlockingInteraction(
+         V1ToV2Converter.toV2PortletContext(portletContext),
+         V1ToV2Converter.toV2RuntimeContext(runtimeContext),
+         V1ToV2Converter.toV2MarkupParams(markupParams),
+         V1ToV2Converter.toV2InteractionParams(interactionParams)
+      );
 
       performBlockingInteraction.setRegistrationContext(V1ToV2Converter.toV2RegistrationContext(registrationContext));
       performBlockingInteraction.setUserContext(V1ToV2Converter.toV2UserContext(userContext));
@@ -196,9 +198,10 @@
    {
       forceSessionAccess();
 
-      ReleaseSessions releaseSessions = new ReleaseSessions();
-      releaseSessions.setRegistrationContext(V1ToV2Converter.toV2RegistrationContext(registrationContext));
-      releaseSessions.getSessionIDs().addAll(sessionIDs);
+      ReleaseSessions releaseSessions = WSRPTypeFactory.createReleaseSessions(
+         V1ToV2Converter.toV2RegistrationContext(registrationContext),
+         sessionIDs
+      );
 
       ReturnAny returnAny;
       try
@@ -240,12 +243,13 @@
    {
       forceSessionAccess();
 
-      GetMarkup getMarkup = new GetMarkup();
+      GetMarkup getMarkup = WSRPTypeFactory.createMarkupRequest(
+         V1ToV2Converter.toV2PortletContext(portletContext),
+         V1ToV2Converter.toV2RuntimeContext(runtimeContext),
+         V1ToV2Converter.toV2MarkupParams(markupParams)
+      );
       getMarkup.setRegistrationContext(V1ToV2Converter.toV2RegistrationContext(registrationContext));
-      getMarkup.setPortletContext(V1ToV2Converter.toV2PortletContext(portletContext));
-      getMarkup.setRuntimeContext(V1ToV2Converter.toV2RuntimeContext(runtimeContext));
       getMarkup.setUserContext(V1ToV2Converter.toV2UserContext(userContext));
-      getMarkup.setMarkupParams(V1ToV2Converter.toV2MarkupParams(markupParams));
 
       MarkupResponse response;
       try
@@ -316,8 +320,7 @@
    {
       forceSessionAccess();
 
-      InitCookie initCookie = new InitCookie();
-      initCookie.setRegistrationContext(V1ToV2Converter.toV2RegistrationContext(registrationContext));
+      InitCookie initCookie = WSRPTypeFactory.createInitCookie(V1ToV2Converter.toV2RegistrationContext(registrationContext));
 
       ReturnAny returnAny;
       try

Modified: components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/ServiceDescriptionEndpoint.java
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/ServiceDescriptionEndpoint.java	2010-06-14 10:51:37 UTC (rev 3326)
+++ components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/ServiceDescriptionEndpoint.java	2010-06-14 12:43:09 UTC (rev 3327)
@@ -23,6 +23,7 @@
 
 package org.gatein.wsrp.endpoints.v1;
 
+import org.gatein.wsrp.WSRPTypeFactory;
 import org.gatein.wsrp.WSRPUtils;
 import org.gatein.wsrp.endpoints.WSRPBaseEndpoint;
 import org.gatein.wsrp.spec.v1.V1ToV2Converter;
@@ -78,7 +79,7 @@
       @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1Extension>> extensions
    ) throws V1InvalidRegistration, V1OperationFailed
    {
-      GetServiceDescription getServiceDescription = new GetServiceDescription();
+      GetServiceDescription getServiceDescription = WSRPTypeFactory.createGetServiceDescription();
       getServiceDescription.setRegistrationContext(V1ToV2Converter.toV2RegistrationContext(registrationContext));
       getServiceDescription.getDesiredLocales().addAll(desiredLocales);
 



More information about the gatein-commits mailing list