com.netflix.discovery.provider
Class DiscoveryJerseyProvider

java.lang.Object
  extended by com.netflix.discovery.provider.DiscoveryJerseyProvider
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader, javax.ws.rs.ext.MessageBodyWriter

@Provider
public class DiscoveryJerseyProvider
extends java.lang.Object
implements javax.ws.rs.ext.MessageBodyWriter, javax.ws.rs.ext.MessageBodyReader

A custom provider implementation for Jersey that dispatches to the implementation that serializes/deserializes objects sent to and from eureka server.

This implementation allows users to plugin their own serialization/deserialization mechanism by reading the annotation provided by specifying the Serializer and dispatching it to that implementation.


Constructor Summary
DiscoveryJerseyProvider()
           
 
Method Summary
 long getSize(java.lang.Object serializableObject, java.lang.Class serializableClass, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
           
 boolean isReadable(java.lang.Class serializableClass, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
           
 boolean isWriteable(java.lang.Class serializableClass, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
           
 java.lang.Object readFrom(java.lang.Class serializableClass, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap headers, java.io.InputStream inputStream)
           
 void writeTo(java.lang.Object serializableObject, java.lang.Class serializableClass, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap headers, java.io.OutputStream outputStream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiscoveryJerseyProvider

public DiscoveryJerseyProvider()
Method Detail

isReadable

public boolean isReadable(java.lang.Class serializableClass,
                          java.lang.reflect.Type type,
                          java.lang.annotation.Annotation[] annotations,
                          javax.ws.rs.core.MediaType mediaType)
Specified by:
isReadable in interface javax.ws.rs.ext.MessageBodyReader

readFrom

public java.lang.Object readFrom(java.lang.Class serializableClass,
                                 java.lang.reflect.Type type,
                                 java.lang.annotation.Annotation[] annotations,
                                 javax.ws.rs.core.MediaType mediaType,
                                 javax.ws.rs.core.MultivaluedMap headers,
                                 java.io.InputStream inputStream)
                          throws java.io.IOException,
                                 javax.ws.rs.WebApplicationException
Specified by:
readFrom in interface javax.ws.rs.ext.MessageBodyReader
Throws:
java.io.IOException
javax.ws.rs.WebApplicationException

getSize

public long getSize(java.lang.Object serializableObject,
                    java.lang.Class serializableClass,
                    java.lang.reflect.Type type,
                    java.lang.annotation.Annotation[] annotations,
                    javax.ws.rs.core.MediaType mediaType)
Specified by:
getSize in interface javax.ws.rs.ext.MessageBodyWriter

isWriteable

public boolean isWriteable(java.lang.Class serializableClass,
                           java.lang.reflect.Type type,
                           java.lang.annotation.Annotation[] annotations,
                           javax.ws.rs.core.MediaType mediaType)
Specified by:
isWriteable in interface javax.ws.rs.ext.MessageBodyWriter

writeTo

public void writeTo(java.lang.Object serializableObject,
                    java.lang.Class serializableClass,
                    java.lang.reflect.Type type,
                    java.lang.annotation.Annotation[] annotations,
                    javax.ws.rs.core.MediaType mediaType,
                    javax.ws.rs.core.MultivaluedMap headers,
                    java.io.OutputStream outputStream)
             throws java.io.IOException,
                    javax.ws.rs.WebApplicationException
Specified by:
writeTo in interface javax.ws.rs.ext.MessageBodyWriter
Throws:
java.io.IOException
javax.ws.rs.WebApplicationException