You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@oltu.apache.org by Andrew Toulouse <an...@atoulou.se> on 2011/12/11 22:53:27 UTC

Server dependencies on Servlets

I'd like to implement an OAuth2 provider on top of the Play framework (which does not use the Servlet API), but when I looked into using Amber, it looks like the Servlet API is a part of Amber at a pretty basic level. Not knowing anything about Amber (yet), how involved is it to refactor it to be servlet-agnostic? 


Re: Server dependencies on Servlets

Posted by Andrew Toulouse <an...@atoulou.se>.
Though I'm most interested in using this with the play framework, some
quick googling has led me to Netty and Webbit as unconventional java
server environments. Nobody's doing OAuth over WebSocket or over SPDY
(yet), as far as I know, but letting users of Amber support either
without reaching deep into the library might be a good thing.

Because I was hacking on an OAuth2 thing in Java as a side project on
my own time, finding Amber made me really happy, but it also means I
may not be a reliable contributor as far as the project is concerned.
Do you know how deep or how shallow the servlet API is integrated into
Amber? If it's pretty shallow, I'll feel comfortable attempting to
take a first pass at it.

Sent from my iPad

On Dec 31, 2011, at 4:44 AM, Pid <pi...@pidster.com> wrote:

> On 27/12/2011 19:57, Łukasz Moreń wrote:
>> Hi Andrew,
>>
>> I am not sure if it solve your case, but maybe you could try to implement
>> your own HttpServletRequestWrapper, fill it with data you get from
>> non-servlet environment and pass it to the Amber library.
>
> Or we could make Servlet integration a separate concern.
>
> There are an increasing number of non-Servlet Java server environments
> which Amber could integrate with.
>
> Worth considering anyway.  Thoughts?
>
>
> p
>
>
>
>> Cheers, Lukasz
>>
>> On Mon, Dec 26, 2011 at 11:38 AM, Antonio Sanso <as...@adobe.com> wrote:
>>
>>> Hi Andrew
>>>
>>>
>>> On Dec 18, 2011, at 10:06 AM, Andrew Akira Toulouse wrote:
>>>
>>>> Apologies for the late reply; it seems that my email wasn't included
>>>> in the return email.
>>>>
>>>> Play's servlet wrapper is a compatibility layer for when it is
>>>> deployed from tomcat. However, the primary mode of use is as a
>>>> stand-alone server, which allows it to do nifty things such as
>>>> websockets and asynchronous request handling (not unlike Node.js only
>>>> built on top of a more...rigorous language). So no, this isn't an
>>>> option, unfortunately. It's somewhat of an unconventional choice - so
>>>> far - as far as Java web applications go, but it has strong support
>>>> from Typesafe and Scala community support is growing. It's also in use
>>>> at Klout, supported on Heroku, and seems on a trajectory that doesn't
>>>> end in obscurity. Unfortunately, by eschewing use of the servlet
>>>> abstraction, it does exclude itself from useful modules tailored to
>>>> the Servlet API.
>>>>
>>>> Is amber modularized enough that compatibility for a non-Servlet API
>>>> request/response object could be written in without too much trouble?
>>>
>>> as long as I can see at the moment a log of method signatures have a
>>> dependency on Servlet API.
>>> If I do not completely wrong (here on of the committer might help) Amber-3
>>> [0] might help here if applied also to Amber Oauth2 project.
>>>
>>> Regards
>>>
>>> Antonio
>>>
>>> [0] https://issues.apache.org/jira/browse/AMBER-3
>>>
>>>>
>>>>> Hi Andrew,
>>>>>
>>>>> starting from point I do not know Play at all wouldn't be easier to use
>>> the SERVLET_REQ provided
>>>>> from the framework ? [0]
>>>>>
>>>>> Apologies if I am totally wrong, just my 2 cents
>>>>>
>>>>> [0]
>>> http://www.playframework.org/documentation/api/1.2.4/play%2Fserver%2FServletWrapper.html
>>>
>>>
>>
>
>
> --
>
> [key:62590808]
>

Re: Server dependencies on Servlets

Posted by Pid <pi...@pidster.com>.
On 27/12/2011 19:57, Łukasz Moreń wrote:
> Hi Andrew,
> 
> I am not sure if it solve your case, but maybe you could try to implement
> your own HttpServletRequestWrapper, fill it with data you get from
> non-servlet environment and pass it to the Amber library.

Or we could make Servlet integration a separate concern.

There are an increasing number of non-Servlet Java server environments
which Amber could integrate with.

Worth considering anyway.  Thoughts?


p



> Cheers, Lukasz
> 
> On Mon, Dec 26, 2011 at 11:38 AM, Antonio Sanso <as...@adobe.com> wrote:
> 
>> Hi Andrew
>>
>>
>> On Dec 18, 2011, at 10:06 AM, Andrew Akira Toulouse wrote:
>>
>>> Apologies for the late reply; it seems that my email wasn't included
>>> in the return email.
>>>
>>> Play's servlet wrapper is a compatibility layer for when it is
>>> deployed from tomcat. However, the primary mode of use is as a
>>> stand-alone server, which allows it to do nifty things such as
>>> websockets and asynchronous request handling (not unlike Node.js only
>>> built on top of a more...rigorous language). So no, this isn't an
>>> option, unfortunately. It's somewhat of an unconventional choice - so
>>> far - as far as Java web applications go, but it has strong support
>>> from Typesafe and Scala community support is growing. It's also in use
>>> at Klout, supported on Heroku, and seems on a trajectory that doesn't
>>> end in obscurity. Unfortunately, by eschewing use of the servlet
>>> abstraction, it does exclude itself from useful modules tailored to
>>> the Servlet API.
>>>
>>> Is amber modularized enough that compatibility for a non-Servlet API
>>> request/response object could be written in without too much trouble?
>>
>> as long as I can see at the moment a log of method signatures have a
>> dependency on Servlet API.
>> If I do not completely wrong (here on of the committer might help) Amber-3
>> [0] might help here if applied also to Amber Oauth2 project.
>>
>> Regards
>>
>> Antonio
>>
>> [0] https://issues.apache.org/jira/browse/AMBER-3
>>
>>>
>>>> Hi Andrew,
>>>>
>>>> starting from point I do not know Play at all wouldn't be easier to use
>> the SERVLET_REQ provided
>>>> from the framework ? [0]
>>>>
>>>> Apologies if I am totally wrong, just my 2 cents
>>>>
>>>> [0]
>> http://www.playframework.org/documentation/api/1.2.4/play%2Fserver%2FServletWrapper.html
>>
>>
> 


-- 

[key:62590808]


Re: Server dependencies on Servlets

Posted by Łukasz Moreń <lu...@gmail.com>.
Hi Andrew,

I am not sure if it solve your case, but maybe you could try to implement
your own HttpServletRequestWrapper, fill it with data you get from
non-servlet environment and pass it to the Amber library.

Cheers, Lukasz

On Mon, Dec 26, 2011 at 11:38 AM, Antonio Sanso <as...@adobe.com> wrote:

> Hi Andrew
>
>
> On Dec 18, 2011, at 10:06 AM, Andrew Akira Toulouse wrote:
>
> > Apologies for the late reply; it seems that my email wasn't included
> > in the return email.
> >
> > Play's servlet wrapper is a compatibility layer for when it is
> > deployed from tomcat. However, the primary mode of use is as a
> > stand-alone server, which allows it to do nifty things such as
> > websockets and asynchronous request handling (not unlike Node.js only
> > built on top of a more...rigorous language). So no, this isn't an
> > option, unfortunately. It's somewhat of an unconventional choice - so
> > far - as far as Java web applications go, but it has strong support
> > from Typesafe and Scala community support is growing. It's also in use
> > at Klout, supported on Heroku, and seems on a trajectory that doesn't
> > end in obscurity. Unfortunately, by eschewing use of the servlet
> > abstraction, it does exclude itself from useful modules tailored to
> > the Servlet API.
> >
> > Is amber modularized enough that compatibility for a non-Servlet API
> > request/response object could be written in without too much trouble?
>
> as long as I can see at the moment a log of method signatures have a
> dependency on Servlet API.
> If I do not completely wrong (here on of the committer might help) Amber-3
> [0] might help here if applied also to Amber Oauth2 project.
>
> Regards
>
> Antonio
>
> [0] https://issues.apache.org/jira/browse/AMBER-3
>
> >
> >> Hi Andrew,
> >>
> >> starting from point I do not know Play at all wouldn't be easier to use
> the SERVLET_REQ provided
> >> from the framework ? [0]
> >>
> >> Apologies if I am totally wrong, just my 2 cents
> >>
> >> [0]
> http://www.playframework.org/documentation/api/1.2.4/play%2Fserver%2FServletWrapper.html
>
>

Re: Server dependencies on Servlets

Posted by Antonio Sanso <as...@adobe.com>.
Hi Andrew


On Dec 18, 2011, at 10:06 AM, Andrew Akira Toulouse wrote:

> Apologies for the late reply; it seems that my email wasn't included
> in the return email.
> 
> Play's servlet wrapper is a compatibility layer for when it is
> deployed from tomcat. However, the primary mode of use is as a
> stand-alone server, which allows it to do nifty things such as
> websockets and asynchronous request handling (not unlike Node.js only
> built on top of a more...rigorous language). So no, this isn't an
> option, unfortunately. It's somewhat of an unconventional choice - so
> far - as far as Java web applications go, but it has strong support
> from Typesafe and Scala community support is growing. It's also in use
> at Klout, supported on Heroku, and seems on a trajectory that doesn't
> end in obscurity. Unfortunately, by eschewing use of the servlet
> abstraction, it does exclude itself from useful modules tailored to
> the Servlet API.
> 
> Is amber modularized enough that compatibility for a non-Servlet API
> request/response object could be written in without too much trouble?

as long as I can see at the moment a log of method signatures have a dependency on Servlet API.
If I do not completely wrong (here on of the committer might help) Amber-3 [0] might help here if applied also to Amber Oauth2 project.

Regards

Antonio

[0] https://issues.apache.org/jira/browse/AMBER-3

> 
>> Hi Andrew,
>> 
>> starting from point I do not know Play at all wouldn't be easier to use the SERVLET_REQ provided
>> from the framework ? [0]
>> 
>> Apologies if I am totally wrong, just my 2 cents
>> 
>> [0] http://www.playframework.org/documentation/api/1.2.4/play%2Fserver%2FServletWrapper.html


Re: Server dependencies on Servlets

Posted by Andrew Akira Toulouse <an...@atoulou.se>.
Apologies for the late reply; it seems that my email wasn't included
in the return email.

Play's servlet wrapper is a compatibility layer for when it is
deployed from tomcat. However, the primary mode of use is as a
stand-alone server, which allows it to do nifty things such as
websockets and asynchronous request handling (not unlike Node.js only
built on top of a more...rigorous language). So no, this isn't an
option, unfortunately. It's somewhat of an unconventional choice - so
far - as far as Java web applications go, but it has strong support
from Typesafe and Scala community support is growing. It's also in use
at Klout, supported on Heroku, and seems on a trajectory that doesn't
end in obscurity. Unfortunately, by eschewing use of the servlet
abstraction, it does exclude itself from useful modules tailored to
the Servlet API.

Is amber modularized enough that compatibility for a non-Servlet API
request/response object could be written in without too much trouble?

> Hi Andrew,
>
> starting from point I do not know Play at all wouldn't be easier to use the SERVLET_REQ provided
> from the framework ? [0]
>
> Apologies if I am totally wrong, just my 2 cents
>
> [0] http://www.playframework.org/documentation/api/1.2.4/play%2Fserver%2FServletWrapper.html

Re: Server dependencies on Servlets

Posted by Antonio Sanso <as...@adobe.com>.
Hi Andrew,

starting from point I do not know Play at all wouldn't be easier to use the SERVLET_REQ provided from the framework ? [0]

Apologies if I am totally wrong, just my 2 cents

[0] http://www.playframework.org/documentation/api/1.2.4/play%2Fserver%2FServletWrapper.html

On Dec 11, 2011, at 10:53 PM, Andrew Toulouse wrote:

> I'd like to implement an OAuth2 provider on top of the Play framework (which does not use the Servlet API), but when I looked into using Amber, it looks like the Servlet API is a part of Amber at a pretty basic level. Not knowing anything about Amber (yet), how involved is it to refactor it to be servlet-agnostic? 
>