We could generate standard HttpServlet classes which implement the service
and ".war" them up for distribution in any servlet container (or just
generate the .java files which can then be wrapped with a proper web.xml
file)

-Amit

On Mon, Sep 15, 2008 at 4:10 PM, Mark Slee <[EMAIL PROTECTED]> wrote:

> No specific plans that I'm aware of at the moment. But I don't think
> there's any reason not to do this -- the need probably just hasn't come
> up for anyone yet.
>
> How would you plan on doing this? Pulling the request arguments out of a
> standard Servlet container?
>
> -----Original Message-----
> From: Pete Wyckoff [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 15, 2008 11:04 AM
> To: [email protected]
> Subject: -rest -java?
>
>
> Are there any current plans for supporting the -rest flag in java?
>
> Thanks, pete
>
>
> -------------------------------------------------------------------
>
> Mark Slee mslee at facebook.com
> Mon Nov 19 17:22:25 PST 2007
>
>    * Previous message: [Thrift] PHP Development
>    * Next message: [Thrift] Re: Thrift + Apache
>    * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
>
> Hi Andrew,
>
> This isn't the primary design case for Thrift, but you can use Thrift to
> help structure this sort of code. Facebook uses Thrift in the
> implementation of our REST web-services API.
>
> General approach:
>
> Define your types and web service in a .thrift file.
> Generate PHP code using -rest flag.
>
> Thrift generates a REST handler for your service implementation, which
> you can invoke by passing the request variables. So you would have
> something like:
>
> $impl = new ServiceImplementation(); // your class that implement
> methods $rest = new ServiceRest($_REQUEST); // generated handler
>
> Then you can invoke something like:
>
> $method = $_REQUEST['method'];
> $result = $rest->$method($request);
>
> This will dispatch into your $impl class which can return a Thrift
> object as $result.
>
> We have common PHP functions that generically convert any Thrift object
> into generic XML or JSON just by iterating over the elements.
>
> So... it's not the primary use case, but Thrift is a nice way to
> separate the data/types and method implementations from the
> encoding/decoding details of input/output (i.e. GET params vs. JSON,
> etc.)
>
> Cheers,
> Mark
>
> -----Original Message-----
> From: thrift-bounces at publists.facebook.com [mailto:thrift-bounces at
> publists.facebook.com] On Behalf Of Andrew Eross
> Sent: Sunday, November 18, 2007 6:42 PM
> To: thrift at publists.facebook.com
> Subject: [Thrift] PHP Development
>
> Hi folks,
>
> Simple question about thrift that I haven't quite been able to discern
> from the available documentation...
>
> We have a bunch of PHP class libraries that we would like to expose as a
> number of different web services. The same libraries will be implemented
> in a few different ways and accessible via REST/JSON and REST/XML.
>
> We're trying to decide if thrift may be helpful as an abstract way of
> implementing these services to be accessible by PHP. We're about to dive
> in a give it a go, but wanted to ask the community if this is what
> thrift is intended for.
>
> Cheers,
> Andrew
> _______________________________________________
> Thrift mailing list
> Thrift at publists.facebook.com
> http://lists.pub.facebook.com/mailman/listinfo/thrift
>
>
>
>
>

Reply via email to