You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Mathias Herberts (JIRA)" <ji...@apache.org> on 2010/07/05 13:58:50 UTC

[jira] Created: (THRIFT-814) Include a TServlet in the standard Thrift distribution

Include a TServlet in the standard Thrift distribution
------------------------------------------------------

                 Key: THRIFT-814
                 URL: https://issues.apache.org/jira/browse/THRIFT-814
             Project: Thrift
          Issue Type: New Feature
    Affects Versions: 0.2, 0.1, 0.3
         Environment: Any
            Reporter: Mathias Herberts


Thrift comes with a THttpClient used to consume Thrift services over an HTTP transport.

Thrift however does not come with a Thrift specific servlet to serve those services.

Tom White's servlet (http://www.lexemetech.com/2007/09/java-servlet-for-thrift.html, http://www.google.com/codesearch/p?hl=en&sa=N&cd=1&ct=rc#vusEaWnOsAk/thrift/TServlet.java&q=TServlet) is probably in wide use but it would be great to have a standard Thrift servlet everyone can build upon.

I've adapted Tom's Servlet to allow for Processor/Protocol parameterization.

I've not cleared the licensing issues though, as Tom's original work has no license associated with it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-814) Include a TServlet in the standard Thrift distribution

Posted by "Tom White (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12885241#action_12885241 ] 

Tom White commented on THRIFT-814:
----------------------------------

I grant a license to the ASF for the original work for inclusion in ASF works.

> Include a TServlet in the standard Thrift distribution
> ------------------------------------------------------
>
>                 Key: THRIFT-814
>                 URL: https://issues.apache.org/jira/browse/THRIFT-814
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>    Affects Versions: 0.1, 0.2, 0.3
>         Environment: Any
>            Reporter: Mathias Herberts
>         Attachments: TServlet.java
>
>
> Thrift comes with a THttpClient used to consume Thrift services over an HTTP transport.
> Thrift however does not come with a Thrift specific servlet to serve those services.
> Tom White's servlet (http://www.lexemetech.com/2007/09/java-servlet-for-thrift.html, http://www.google.com/codesearch/p?hl=en&sa=N&cd=1&ct=rc#vusEaWnOsAk/thrift/TServlet.java&q=TServlet) is probably in wide use but it would be great to have a standard Thrift servlet everyone can build upon.
> I've adapted Tom's Servlet to allow for Processor/Protocol parameterization.
> I've not cleared the licensing issues though, as Tom's original work has no license associated with it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-814) Include a TServlet in the standard Thrift distribution

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-814?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury updated THRIFT-814:
---------------------------------

    Fix Version/s: 0.4

> Include a TServlet in the standard Thrift distribution
> ------------------------------------------------------
>
>                 Key: THRIFT-814
>                 URL: https://issues.apache.org/jira/browse/THRIFT-814
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>    Affects Versions: 0.1, 0.2, 0.3
>         Environment: Any
>            Reporter: Mathias Herberts
>             Fix For: 0.4
>
>         Attachments: TServlet.java
>
>
> Thrift comes with a THttpClient used to consume Thrift services over an HTTP transport.
> Thrift however does not come with a Thrift specific servlet to serve those services.
> Tom White's servlet (http://www.lexemetech.com/2007/09/java-servlet-for-thrift.html, http://www.google.com/codesearch/p?hl=en&sa=N&cd=1&ct=rc#vusEaWnOsAk/thrift/TServlet.java&q=TServlet) is probably in wide use but it would be great to have a standard Thrift servlet everyone can build upon.
> I've adapted Tom's Servlet to allow for Processor/Protocol parameterization.
> I've not cleared the licensing issues though, as Tom's original work has no license associated with it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-814) Include a TServlet in the standard Thrift distribution

Posted by "Mathias Herberts (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895828#action_12895828 ] 

Mathias Herberts commented on THRIFT-814:
-----------------------------------------

Using Map<X, List<Y>> implies you need code to convert from a Map<X,Y> (in case you don't need several header values for a given name), whereas generating a Collection<Map.Entry<X,Y>> is straightforward using entrySet from java.util.Map.

> Include a TServlet in the standard Thrift distribution
> ------------------------------------------------------
>
>                 Key: THRIFT-814
>                 URL: https://issues.apache.org/jira/browse/THRIFT-814
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>    Affects Versions: 0.1, 0.2, 0.3
>         Environment: Any
>            Reporter: Mathias Herberts
>             Fix For: 0.4
>
>         Attachments: TServlet.java, TServlet.java-v2
>
>
> Thrift comes with a THttpClient used to consume Thrift services over an HTTP transport.
> Thrift however does not come with a Thrift specific servlet to serve those services.
> Tom White's servlet (http://www.lexemetech.com/2007/09/java-servlet-for-thrift.html, http://www.google.com/codesearch/p?hl=en&sa=N&cd=1&ct=rc#vusEaWnOsAk/thrift/TServlet.java&q=TServlet) is probably in wide use but it would be great to have a standard Thrift servlet everyone can build upon.
> I've adapted Tom's Servlet to allow for Processor/Protocol parameterization.
> I've not cleared the licensing issues though, as Tom's original work has no license associated with it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-814) Include a TServlet in the standard Thrift distribution

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12885579#action_12885579 ] 

Bryan Duxbury commented on THRIFT-814:
--------------------------------------

Some thoughts:
* Why have the input and output transport factories at all if they're going to be private final default factories? You *know* that all it does is return the same transport you passed in, so it's basically a no-op.
* Do you actually want to close the input and output transports? Won't the webserver do that for you on its own terms?
* Why use a Collection of Map.Entry objects? Isn't that what we call a Map?

> Include a TServlet in the standard Thrift distribution
> ------------------------------------------------------
>
>                 Key: THRIFT-814
>                 URL: https://issues.apache.org/jira/browse/THRIFT-814
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>    Affects Versions: 0.1, 0.2, 0.3
>         Environment: Any
>            Reporter: Mathias Herberts
>             Fix For: 0.4
>
>         Attachments: TServlet.java
>
>
> Thrift comes with a THttpClient used to consume Thrift services over an HTTP transport.
> Thrift however does not come with a Thrift specific servlet to serve those services.
> Tom White's servlet (http://www.lexemetech.com/2007/09/java-servlet-for-thrift.html, http://www.google.com/codesearch/p?hl=en&sa=N&cd=1&ct=rc#vusEaWnOsAk/thrift/TServlet.java&q=TServlet) is probably in wide use but it would be great to have a standard Thrift servlet everyone can build upon.
> I've adapted Tom's Servlet to allow for Processor/Protocol parameterization.
> I've not cleared the licensing issues though, as Tom's original work has no license associated with it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-814) Include a TServlet in the standard Thrift distribution

Posted by "Mathias Herberts (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-814?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mathias Herberts updated THRIFT-814:
------------------------------------

    Component/s: Library (Java)

> Include a TServlet in the standard Thrift distribution
> ------------------------------------------------------
>
>                 Key: THRIFT-814
>                 URL: https://issues.apache.org/jira/browse/THRIFT-814
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>    Affects Versions: 0.1, 0.2, 0.3
>         Environment: Any
>            Reporter: Mathias Herberts
>         Attachments: TServlet.java
>
>
> Thrift comes with a THttpClient used to consume Thrift services over an HTTP transport.
> Thrift however does not come with a Thrift specific servlet to serve those services.
> Tom White's servlet (http://www.lexemetech.com/2007/09/java-servlet-for-thrift.html, http://www.google.com/codesearch/p?hl=en&sa=N&cd=1&ct=rc#vusEaWnOsAk/thrift/TServlet.java&q=TServlet) is probably in wide use but it would be great to have a standard Thrift servlet everyone can build upon.
> I've adapted Tom's Servlet to allow for Processor/Protocol parameterization.
> I've not cleared the licensing issues though, as Tom's original work has no license associated with it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-814) Include a TServlet in the standard Thrift distribution

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895822#action_12895822 ] 

Bryan Duxbury commented on THRIFT-814:
--------------------------------------

bq. For your last point, I'm using a Collection of Map.Entry objects so I can have several times the same header. This would not be possible using a Map.

Typically I'd use a Map<X, List<Y>> for that purpose.

> Include a TServlet in the standard Thrift distribution
> ------------------------------------------------------
>
>                 Key: THRIFT-814
>                 URL: https://issues.apache.org/jira/browse/THRIFT-814
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>    Affects Versions: 0.1, 0.2, 0.3
>         Environment: Any
>            Reporter: Mathias Herberts
>             Fix For: 0.4
>
>         Attachments: TServlet.java, TServlet.java-v2
>
>
> Thrift comes with a THttpClient used to consume Thrift services over an HTTP transport.
> Thrift however does not come with a Thrift specific servlet to serve those services.
> Tom White's servlet (http://www.lexemetech.com/2007/09/java-servlet-for-thrift.html, http://www.google.com/codesearch/p?hl=en&sa=N&cd=1&ct=rc#vusEaWnOsAk/thrift/TServlet.java&q=TServlet) is probably in wide use but it would be great to have a standard Thrift servlet everyone can build upon.
> I've adapted Tom's Servlet to allow for Processor/Protocol parameterization.
> I've not cleared the licensing issues though, as Tom's original work has no license associated with it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-814) Include a TServlet in the standard Thrift distribution

Posted by "Mathias Herberts (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895818#action_12895818 ] 

Mathias Herberts commented on THRIFT-814:
-----------------------------------------

I removed the input/output transport factories, they were leftovers of the initial code I based this one on.

I also removed the finally clause which closed the transports, you are right the servlet container will take care of this (or not if keepalive was requested).

For your last point, I'm using a Collection of Map.Entry objects so I can have several times the same header. This would not be possible using a Map.

I'm attaching an updated version.

> Include a TServlet in the standard Thrift distribution
> ------------------------------------------------------
>
>                 Key: THRIFT-814
>                 URL: https://issues.apache.org/jira/browse/THRIFT-814
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>    Affects Versions: 0.1, 0.2, 0.3
>         Environment: Any
>            Reporter: Mathias Herberts
>             Fix For: 0.4
>
>         Attachments: TServlet.java
>
>
> Thrift comes with a THttpClient used to consume Thrift services over an HTTP transport.
> Thrift however does not come with a Thrift specific servlet to serve those services.
> Tom White's servlet (http://www.lexemetech.com/2007/09/java-servlet-for-thrift.html, http://www.google.com/codesearch/p?hl=en&sa=N&cd=1&ct=rc#vusEaWnOsAk/thrift/TServlet.java&q=TServlet) is probably in wide use but it would be great to have a standard Thrift servlet everyone can build upon.
> I've adapted Tom's Servlet to allow for Processor/Protocol parameterization.
> I've not cleared the licensing issues though, as Tom's original work has no license associated with it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-814) Include a TServlet in the standard Thrift distribution

Posted by "Mathias Herberts (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-814?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mathias Herberts updated THRIFT-814:
------------------------------------

    Attachment: TServlet.java-v2

> Include a TServlet in the standard Thrift distribution
> ------------------------------------------------------
>
>                 Key: THRIFT-814
>                 URL: https://issues.apache.org/jira/browse/THRIFT-814
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>    Affects Versions: 0.1, 0.2, 0.3
>         Environment: Any
>            Reporter: Mathias Herberts
>             Fix For: 0.4
>
>         Attachments: TServlet.java, TServlet.java-v2
>
>
> Thrift comes with a THttpClient used to consume Thrift services over an HTTP transport.
> Thrift however does not come with a Thrift specific servlet to serve those services.
> Tom White's servlet (http://www.lexemetech.com/2007/09/java-servlet-for-thrift.html, http://www.google.com/codesearch/p?hl=en&sa=N&cd=1&ct=rc#vusEaWnOsAk/thrift/TServlet.java&q=TServlet) is probably in wide use but it would be great to have a standard Thrift servlet everyone can build upon.
> I've adapted Tom's Servlet to allow for Processor/Protocol parameterization.
> I've not cleared the licensing issues though, as Tom's original work has no license associated with it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (THRIFT-814) Include a TServlet in the standard Thrift distribution

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-814?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury closed THRIFT-814.
--------------------------------

      Assignee: Mathias Herberts
    Resolution: Fixed

OK, I committed this.

> Include a TServlet in the standard Thrift distribution
> ------------------------------------------------------
>
>                 Key: THRIFT-814
>                 URL: https://issues.apache.org/jira/browse/THRIFT-814
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>    Affects Versions: 0.1, 0.2, 0.3
>         Environment: Any
>            Reporter: Mathias Herberts
>            Assignee: Mathias Herberts
>             Fix For: 0.4
>
>         Attachments: TServlet.java, TServlet.java-v2
>
>
> Thrift comes with a THttpClient used to consume Thrift services over an HTTP transport.
> Thrift however does not come with a Thrift specific servlet to serve those services.
> Tom White's servlet (http://www.lexemetech.com/2007/09/java-servlet-for-thrift.html, http://www.google.com/codesearch/p?hl=en&sa=N&cd=1&ct=rc#vusEaWnOsAk/thrift/TServlet.java&q=TServlet) is probably in wide use but it would be great to have a standard Thrift servlet everyone can build upon.
> I've adapted Tom's Servlet to allow for Processor/Protocol parameterization.
> I've not cleared the licensing issues though, as Tom's original work has no license associated with it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-814) Include a TServlet in the standard Thrift distribution

Posted by "Mathias Herberts (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-814?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mathias Herberts updated THRIFT-814:
------------------------------------

    Attachment: TServlet.java

Licensing has yet to be cleared out as my version of TServlet.java builds upon Tom White's version.

> Include a TServlet in the standard Thrift distribution
> ------------------------------------------------------
>
>                 Key: THRIFT-814
>                 URL: https://issues.apache.org/jira/browse/THRIFT-814
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>    Affects Versions: 0.1, 0.2, 0.3
>         Environment: Any
>            Reporter: Mathias Herberts
>         Attachments: TServlet.java
>
>
> Thrift comes with a THttpClient used to consume Thrift services over an HTTP transport.
> Thrift however does not come with a Thrift specific servlet to serve those services.
> Tom White's servlet (http://www.lexemetech.com/2007/09/java-servlet-for-thrift.html, http://www.google.com/codesearch/p?hl=en&sa=N&cd=1&ct=rc#vusEaWnOsAk/thrift/TServlet.java&q=TServlet) is probably in wide use but it would be great to have a standard Thrift servlet everyone can build upon.
> I've adapted Tom's Servlet to allow for Processor/Protocol parameterization.
> I've not cleared the licensing issues though, as Tom's original work has no license associated with it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.