Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(169)

Issue 17086: Allow request handlers to accept POJO input

Can't Edit
Can't Publish+Mail
Start Review
Created:
16 years, 12 months ago by Evan Gilbert (code review)
Modified:
16 years, 12 months ago
Reviewers:
lryan, awiner1, shindig-dev, louiscryan, awiner
Base URL:
http://svn.apache.org/repos/asf/incubator/shindig/trunk/
Visibility:
Public.

Description

Wanted to send this out for comment before submitting. This CL allows handlers to accept POJO input. So instead of List<Object> getResponse(RequestItem request) you can use List<Object> getResponse(MyInputType request) This also supports no-arg requests, so List<Object> getSupportedFields(RequestItem request) becomes List<Object> getSupportedFields()

Patch Set 1 #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+174 lines, -108 lines) Patch
java/common/src/main/java/org/apache/shindig/protocol/DefaultHandlerRegistry.java View 9 chunks +138 lines, -105 lines 7 comments Download
java/common/src/test/java/org/apache/shindig/protocol/DefaultHandlerRegistryTest.java View 5 chunks +24 lines, -3 lines 0 comments Download
java/common/src/test/java/org/apache/shindig/protocol/TestHandler.java View 2 chunks +12 lines, -0 lines 2 comments Download

Messages

Total messages: 5
Evan Gilbert (code review)
16 years, 12 months ago (2009-02-19 22:44:53 UTC) #1
Evan Gilbert (code review)
Wanted to send this out for comment before submitting. This CL allows handlers to accept ...
16 years, 12 months ago (2009-02-19 22:51:37 UTC) #2
awiner
http://codereview.appspot.com/17086/diff/1/2 File java/common/src/main/java/org/apache/shindig/protocol/DefaultHandlerRegistry.java (right): http://codereview.appspot.com/17086/diff/1/2#newcode379 Line 379: private static class MethodCaller { move this to ...
16 years, 12 months ago (2009-02-19 23:15:35 UTC) #3
louiscryan
http://codereview.appspot.com/17086/diff/1/2 File java/common/src/main/java/org/apache/shindig/protocol/DefaultHandlerRegistry.java (right): http://codereview.appspot.com/17086/diff/1/2#newcode395 Line 395: public MethodCaller(Method method, boolean isRest) throws NoSuchMethodException { ...
16 years, 12 months ago (2009-02-19 23:25:45 UTC) #4
Evan Gilbert (code review)
16 years, 12 months ago (2009-02-20 00:43:06 UTC) #5
thanks for feedback, submitting

http://codereview.appspot.com/17086/diff/1/2
File
java/common/src/main/java/org/apache/shindig/protocol/DefaultHandlerRegistry.java
(right):

http://codereview.appspot.com/17086/diff/1/2#newcode379
Line 379: private static class MethodCaller {
On 2009/02/19 23:15:35, awiner wrote:
> move this to a package-private top-level class, maybe: DefaultHandlerRegistry
is
> quite long as is

Think this will make sense as part of moving registry classes to a separate
package. This class is definitely too big, but probably makes sense to split it
all up at once.

http://codereview.appspot.com/17086/diff/1/2#newcode384
Line 384: private final Constructor<?> requestItemConstructor;
On 2009/02/19 23:15:35, awiner wrote:
> should be Constructor<? extends RequestItem>

I couldn't find a way to do this without having to suppress warnings somewhere.

http://codereview.appspot.com/17086/diff/1/2#newcode395
Line 395: public MethodCaller(Method method, boolean isRest) throws
NoSuchMethodException {
On 2009/02/19 23:25:45, louiscryan wrote:
> On 2009/02/19 23:15:35, awiner wrote:
> > instead of isRest, use an inner enum;  or just pass in
> > requestItemFirstParamClass;  or just have some statics with the type
signature
> > of the REST and RPC item constructors, and pass in the whole type signature
> > array to the constructor
> 
> or add getRestRequestItem and a getRpcRequestItem

Went with the two getter flavor.

http://codereview.appspot.com/17086/diff/1/3
File java/common/src/test/java/org/apache/shindig/protocol/TestHandler.java
(right):

http://codereview.appspot.com/17086/diff/1/3#newcode103
Line 103: }
On 2009/02/19 23:25:45, louiscryan wrote:
> add test case for no-param method call

added
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b