Author: chris.laprun(a)jboss.com
Date: 2010-08-13 13:09:39 -0400 (Fri, 13 Aug 2010)
New Revision: 3829
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/MarkupHandler.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ActionRequestProcessor.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/EventRequestProcessor.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/MimeResponseProcessor.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/RenderRequestProcessor.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/RequestProcessor.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ResourceRequestProcessor.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/UpdateNavigationalStateResponseProcessor.java
Log:
- GTNWSRP-58: Added some generification of classes, not as much win as I had hoped due to
lack of reified generics mostly, again. :/
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/MarkupHandler.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/MarkupHandler.java 2010-08-13
17:02:50 UTC (rev 3828)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/MarkupHandler.java 2010-08-13
17:09:39 UTC (rev 3829)
@@ -100,7 +100,7 @@
{
WSRP2ExceptionFactory.throwOperationFailedIfValueIsMissing(getMarkup, GET_MARKUP);
- RequestProcessor requestProcessor = ProcessorFactory.getProcessorFor(producer,
getMarkup);
+ RequestProcessor<MarkupResponse> requestProcessor =
ProcessorFactory.getProcessorFor(producer, getMarkup);
String handle = requestProcessor.getPortletContext().getPortletHandle();
PortletInvocationResponse response;
@@ -117,7 +117,7 @@
checkForError(response);
- return (MarkupResponse)requestProcessor.processResponse(response);
+ return requestProcessor.processResponse(response);
}
public ResourceResponse getResource(GetResource getResource)
@@ -127,7 +127,7 @@
{
WSRP2ExceptionFactory.throwOperationFailedIfValueIsMissing(getResource,
GET_RESOURCE);
- RequestProcessor requestProcessor = ProcessorFactory.getProcessorFor(producer,
getResource);
+ RequestProcessor<ResourceResponse> requestProcessor =
ProcessorFactory.getProcessorFor(producer, getResource);
String handle = requestProcessor.getPortletContext().getPortletHandle();
PortletInvocationResponse response;
@@ -144,7 +144,7 @@
checkForError(response);
- return (ResourceResponse)requestProcessor.processResponse(response);
+ return requestProcessor.processResponse(response);
}
public BlockingInteractionResponse
performBlockingInteraction(PerformBlockingInteraction performBlockingInteraction)
@@ -156,7 +156,7 @@
final InteractionParams interactionParams =
performBlockingInteraction.getInteractionParams();
WSRP2ExceptionFactory.throwMissingParametersIfValueIsMissing(interactionParams,
"InteractionParams", PBI);
- RequestProcessor requestProcessor = ProcessorFactory.getProcessorFor(producer,
performBlockingInteraction);
+ RequestProcessor<BlockingInteractionResponse> requestProcessor =
ProcessorFactory.getProcessorFor(producer, performBlockingInteraction);
PortletInvocationResponse response;
String handle = requestProcessor.getPortletContext().getPortletHandle();
@@ -177,7 +177,7 @@
checkForError(response);
- return (BlockingInteractionResponse)requestProcessor.processResponse(response);
+ return requestProcessor.processResponse(response);
}
public List<Extension> releaseSessions(ReleaseSessions releaseSessions)
@@ -210,7 +210,7 @@
PortletStateChangeRequired, ResourceSuspended, UnsupportedLocale,
UnsupportedMimeType, UnsupportedMode,
UnsupportedWindowState
{
- RequestProcessor requestProcessor = ProcessorFactory.getProcessorFor(producer,
handleEvents);
+ RequestProcessor<HandleEventsResponse> requestProcessor =
ProcessorFactory.getProcessorFor(producer, handleEvents);
PortletInvocationResponse response;
String handle = requestProcessor.getPortletContext().getPortletHandle();
@@ -232,7 +232,7 @@
checkForError(response);
- return (HandleEventsResponse)requestProcessor.processResponse(response);
+ return requestProcessor.processResponse(response);
}
private void checkForError(PortletInvocationResponse response)
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ActionRequestProcessor.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ActionRequestProcessor.java 2010-08-13
17:02:50 UTC (rev 3828)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ActionRequestProcessor.java 2010-08-13
17:09:39 UTC (rev 3829)
@@ -35,6 +35,7 @@
import org.gatein.wsrp.producer.WSRPProducerImpl;
import org.gatein.wsrp.producer.handlers.MarkupHandler;
import org.gatein.wsrp.spec.v2.WSRP2ExceptionFactory;
+import org.oasis.wsrp.v2.BlockingInteractionResponse;
import org.oasis.wsrp.v2.InteractionParams;
import org.oasis.wsrp.v2.InvalidHandle;
import org.oasis.wsrp.v2.InvalidRegistration;
@@ -56,7 +57,7 @@
* @version $Revision: 13121 $
* @since 2.6
*/
-class ActionRequestProcessor extends UpdateNavigationalStateResponseProcessor
+class ActionRequestProcessor extends
UpdateNavigationalStateResponseProcessor<BlockingInteractionResponse>
{
private final PerformBlockingInteraction performBlockingInteraction;
@@ -125,7 +126,7 @@
return invocation;
}
- public Object processResponse(PortletInvocationResponse response)
+ public BlockingInteractionResponse processResponse(PortletInvocationResponse
response)
{
if (response instanceof UpdateNavigationalStateResponse)
{
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/EventRequestProcessor.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/EventRequestProcessor.java 2010-08-13
17:02:50 UTC (rev 3828)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/EventRequestProcessor.java 2010-08-13
17:09:39 UTC (rev 3829)
@@ -63,7 +63,7 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
* @version $Revision$
*/
-class EventRequestProcessor extends UpdateNavigationalStateResponseProcessor
+class EventRequestProcessor extends
UpdateNavigationalStateResponseProcessor<HandleEventsResponse>
{
private HandleEvents handleEvents;
@@ -159,7 +159,7 @@
}
@Override
- public Object processResponse(PortletInvocationResponse response)
+ public HandleEventsResponse processResponse(PortletInvocationResponse response)
{
if (response instanceof UpdateNavigationalStateResponse)
{
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/MimeResponseProcessor.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/MimeResponseProcessor.java 2010-08-13
17:02:50 UTC (rev 3828)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/MimeResponseProcessor.java 2010-08-13
17:09:39 UTC (rev 3829)
@@ -38,7 +38,7 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
* @version $Revision$
*/
-abstract class MimeResponseProcessor<LocalMimeResponse extends MimeResponse>
extends RequestProcessor
+abstract class MimeResponseProcessor<LocalMimeResponse extends MimeResponse,
Response> extends RequestProcessor<Response>
{
protected String namespace;
private static final String EMPTY = "";
@@ -63,7 +63,7 @@
return result;
}
- public Object processResponse(PortletInvocationResponse response)
+ public Response processResponse(PortletInvocationResponse response)
{
ContentResponse content = (ContentResponse)response;
String itemString = null;
@@ -116,7 +116,7 @@
return createResponse(mimeResponse);
}
- protected abstract Object createResponse(LocalMimeResponse mimeResponse);
+ protected abstract Response createResponse(LocalMimeResponse mimeResponse);
protected abstract Class<LocalMimeResponse> getReifiedClass();
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/RenderRequestProcessor.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/RenderRequestProcessor.java 2010-08-13
17:02:50 UTC (rev 3828)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/RenderRequestProcessor.java 2010-08-13
17:09:39 UTC (rev 3829)
@@ -35,6 +35,7 @@
import org.oasis.wsrp.v2.InvalidHandle;
import org.oasis.wsrp.v2.InvalidRegistration;
import org.oasis.wsrp.v2.MarkupContext;
+import org.oasis.wsrp.v2.MarkupResponse;
import org.oasis.wsrp.v2.MimeRequest;
import org.oasis.wsrp.v2.MissingParameters;
import org.oasis.wsrp.v2.OperationFailed;
@@ -50,7 +51,7 @@
* @version $Revision: 13121 $
* @since 2.6
*/
-class RenderRequestProcessor extends MimeResponseProcessor<MarkupContext>
+class RenderRequestProcessor extends MimeResponseProcessor<MarkupContext,
MarkupResponse>
{
private final GetMarkup getMarkup;
@@ -107,7 +108,7 @@
}
@Override
- protected Object createResponse(MarkupContext mimeResponse)
+ protected MarkupResponse createResponse(MarkupContext mimeResponse)
{
return WSRPTypeFactory.createMarkupResponse(mimeResponse);
}
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/RequestProcessor.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/RequestProcessor.java 2010-08-13
17:02:50 UTC (rev 3828)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/RequestProcessor.java 2010-08-13
17:09:39 UTC (rev 3829)
@@ -75,7 +75,7 @@
* @version $Revision: 13121 $
* @since 2.6
*/
-public abstract class RequestProcessor
+public abstract class RequestProcessor<Response>
{
private static final String WINDOW_STATE = "window state";
private static final String PORTLET_MODE = "portlet mode";
@@ -190,7 +190,7 @@
abstract PortletInvocation initInvocation(WSRPPortletInvocationContext context);
- public abstract Object processResponse(PortletInvocationResponse response);
+ public abstract Response processResponse(PortletInvocationResponse response);
/**
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ResourceRequestProcessor.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ResourceRequestProcessor.java 2010-08-13
17:02:50 UTC (rev 3828)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/ResourceRequestProcessor.java 2010-08-13
17:09:39 UTC (rev 3829)
@@ -42,6 +42,7 @@
import org.oasis.wsrp.v2.RegistrationContext;
import org.oasis.wsrp.v2.ResourceContext;
import org.oasis.wsrp.v2.ResourceParams;
+import org.oasis.wsrp.v2.ResourceResponse;
import org.oasis.wsrp.v2.RuntimeContext;
import org.oasis.wsrp.v2.UnsupportedMimeType;
import org.oasis.wsrp.v2.UnsupportedMode;
@@ -52,7 +53,7 @@
* @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
* @version $Revision$
*/
-class ResourceRequestProcessor extends MimeResponseProcessor<ResourceContext>
+class ResourceRequestProcessor extends MimeResponseProcessor<ResourceContext,
ResourceResponse>
{
private final GetResource getResource;
@@ -146,7 +147,7 @@
}
@Override
- protected Object createResponse(ResourceContext resourceContext)
+ protected ResourceResponse createResponse(ResourceContext resourceContext)
{
return WSRPTypeFactory.createResourceResponse(resourceContext);
}
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/UpdateNavigationalStateResponseProcessor.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/UpdateNavigationalStateResponseProcessor.java 2010-08-13
17:02:50 UTC (rev 3828)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/UpdateNavigationalStateResponseProcessor.java 2010-08-13
17:09:39 UTC (rev 3829)
@@ -38,7 +38,7 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
* @version $Revision$
*/
-abstract class UpdateNavigationalStateResponseProcessor extends RequestProcessor
+abstract class UpdateNavigationalStateResponseProcessor<Response> extends
RequestProcessor<Response>
{
public UpdateNavigationalStateResponseProcessor(WSRPProducerImpl producer)
{