@Provider @Produces(value="application/x-java-serialized-object") @Consumes(value="application/x-java-serialized-object") @Deprecated public class SerializableProvider extends Object implements javax.ws.rs.ext.MessageBodyReader<Serializable>, AsyncMessageBodyWriter<Serializable>
This Provider has been disabled by default because deserializing java objects from untrusted sources is unsafe. (See http://foxglovesecurity.com/2015/11/06/what-do-weblogic-websphere-jboss-jenkins-opennms-and-your-application-have-in-common-this-vulnerability/ or https://access.redhat.com/security/cve/cve-2015-7501). In case your application uses serialized objects and you trust your remote REST partners, then you may enable this provider:
Modifier and Type | Field and Description |
---|---|
static String |
APPLICATION_SERIALIZABLE
Deprecated.
|
static javax.ws.rs.core.MediaType |
APPLICATION_SERIALIZABLE_TYPE
Deprecated.
|
Constructor and Description |
---|
SerializableProvider()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
CompletionStage<Void> |
asyncWriteTo(Serializable t,
Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders,
AsyncOutputStream entityStream)
Deprecated.
Write a type to an HTTP message using async IO.
|
long |
getSize(Serializable t,
Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType)
Deprecated.
|
boolean |
isReadable(Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType)
Deprecated.
|
boolean |
isWriteable(Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType)
Deprecated.
|
Serializable |
readFrom(Class<Serializable> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders,
InputStream entityStream)
Deprecated.
|
void |
writeTo(Serializable t,
Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders,
OutputStream entityStream)
Deprecated.
|
public static final javax.ws.rs.core.MediaType APPLICATION_SERIALIZABLE_TYPE
public static final String APPLICATION_SERIALIZABLE
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
isWriteable
in interface javax.ws.rs.ext.MessageBodyWriter<Serializable>
public long getSize(Serializable t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
getSize
in interface javax.ws.rs.ext.MessageBodyWriter<Serializable>
public void writeTo(Serializable 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
writeTo
in interface javax.ws.rs.ext.MessageBodyWriter<Serializable>
IOException
javax.ws.rs.WebApplicationException
public CompletionStage<Void> asyncWriteTo(Serializable t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, AsyncOutputStream entityStream)
AsyncMessageBodyWriter
asyncWriteTo
in interface AsyncMessageBodyWriter<Serializable>
t
- the instance to write.type
- the class of instance that is to be written.genericType
- the type of instance to be written. GenericEntity
provides a way to specify this information at runtime.annotations
- an array of the annotations attached to the message entity instance.mediaType
- the media type of the HTTP entity.httpHeaders
- a mutable map of the HTTP message headers.entityStream
- the AsyncOutputStream
for the HTTP entity. The
implementation should not close the output stream.CompletionStage
indicating completionpublic boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
isReadable
in interface javax.ws.rs.ext.MessageBodyReader<Serializable>
public Serializable readFrom(Class<Serializable> 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
readFrom
in interface javax.ws.rs.ext.MessageBodyReader<Serializable>
IOException
javax.ws.rs.WebApplicationException
Copyright © 2020 JBoss by Red Hat. All rights reserved.