org.apache.wink.providers.thrift
Class WinkThriftProvider

java.lang.Object
  extended by org.apache.wink.providers.thrift.WinkThriftProvider
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<org.apache.thrift.TBase>, javax.ws.rs.ext.MessageBodyWriter<org.apache.thrift.TBase>

@Provider
public class WinkThriftProvider
extends Object
implements javax.ws.rs.ext.MessageBodyReader<org.apache.thrift.TBase>, javax.ws.rs.ext.MessageBodyWriter<org.apache.thrift.TBase>

JAX-RS message provider for Apache Thrift


Field Summary
static String THRIFT
           
static javax.ws.rs.core.MediaType THRIFT_TYPE
           
 
Constructor Summary
WinkThriftProvider()
           
 
Method Summary
 long getSize(org.apache.thrift.TBase t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
           
 boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
           
 boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
           
 org.apache.thrift.TBase readFrom(Class<org.apache.thrift.TBase> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders, InputStream entityStream)
           
 void writeTo(org.apache.thrift.TBase t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THRIFT

public static final String THRIFT
See Also:
Constant Field Values

THRIFT_TYPE

public static final javax.ws.rs.core.MediaType THRIFT_TYPE
Constructor Detail

WinkThriftProvider

public WinkThriftProvider()
Method Detail

isReadable

public boolean isReadable(Class<?> type,
                          Type genericType,
                          Annotation[] annotations,
                          javax.ws.rs.core.MediaType mediaType)
Specified by:
isReadable in interface javax.ws.rs.ext.MessageBodyReader<org.apache.thrift.TBase>

readFrom

public org.apache.thrift.TBase readFrom(Class<org.apache.thrift.TBase> type,
                                        Type genericType,
                                        Annotation[] annotations,
                                        javax.ws.rs.core.MediaType mediaType,
                                        javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders,
                                        InputStream entityStream)
                                 throws IOException,
                                        javax.ws.rs.WebApplicationException
Specified by:
readFrom in interface javax.ws.rs.ext.MessageBodyReader<org.apache.thrift.TBase>
Throws:
IOException
javax.ws.rs.WebApplicationException

isWriteable

public boolean isWriteable(Class<?> type,
                           Type genericType,
                           Annotation[] annotations,
                           javax.ws.rs.core.MediaType mediaType)
Specified by:
isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<org.apache.thrift.TBase>

getSize

public long getSize(org.apache.thrift.TBase t,
                    Class<?> type,
                    Type genericType,
                    Annotation[] annotations,
                    javax.ws.rs.core.MediaType mediaType)
Specified by:
getSize in interface javax.ws.rs.ext.MessageBodyWriter<org.apache.thrift.TBase>

writeTo

public void writeTo(org.apache.thrift.TBase t,
                    Class<?> type,
                    Type genericType,
                    Annotation[] annotations,
                    javax.ws.rs.core.MediaType mediaType,
                    javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders,
                    OutputStream entityStream)
             throws IOException,
                    javax.ws.rs.WebApplicationException
Specified by:
writeTo in interface javax.ws.rs.ext.MessageBodyWriter<org.apache.thrift.TBase>
Throws:
IOException
javax.ws.rs.WebApplicationException


Copyright © 2009-2012 The Apache Software Foundation. All Rights Reserved.