Class JsonServiceInstancesMarshaller<T>

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

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

    • JsonServiceInstancesMarshaller

      public JsonServiceInstancesMarshaller(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(ServiceInstances<T> serviceInstances, 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 ServiceInstances<T> readFrom(Class<ServiceInstances<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(ServiceInstances<T> serviceInstances, 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