Class JsonServiceInstanceMarshaller<T>

java.lang.Object
org.apache.curator.x.discovery.server.entity.JsonServiceInstanceMarshaller<T>
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<ServiceInstance<T>>, javax.ws.rs.ext.MessageBodyWriter<ServiceInstance<T>>

@Provider public class JsonServiceInstanceMarshaller<T> extends Object implements javax.ws.rs.ext.MessageBodyReader<ServiceInstance<T>>, javax.ws.rs.ext.MessageBodyWriter<ServiceInstance<T>>
Message body reader/writer. Inject this as appropriate for the JAX-RS implementation you are using
  • Constructor Details

    • JsonServiceInstanceMarshaller

      public JsonServiceInstanceMarshaller(DiscoveryContext<T> context)
  • Method Details

    • 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<T>
    • 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<T>
    • getSize

      public long getSize(ServiceInstance<T> serviceInstance, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
      Specified by:
      getSize in interface javax.ws.rs.ext.MessageBodyWriter<T>
    • readFrom

      public ServiceInstance<T> readFrom(Class<ServiceInstance<T>> 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<T>
      Throws:
      IOException
      javax.ws.rs.WebApplicationException
    • writeTo

      public void writeTo(ServiceInstance<T> serviceInstance, 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<T>
      Throws:
      IOException
      javax.ws.rs.WebApplicationException