java.lang.Object | |
↳ | org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor |
Known Direct Subclasses |
Abstract base implementation of the HttpInvokerRequestExecutor interface.
Pre-implements serialization of RemoteInvocation objects and deserialization of RemoteInvocationResults objects.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | CONTENT_TYPE_SERIALIZED_OBJECT | Default content type: "application/x-java-serialized-object" | |||||||||
String | ENCODING_GZIP | ||||||||||
String | HTTP_HEADER_ACCEPT_ENCODING | ||||||||||
String | HTTP_HEADER_ACCEPT_LANGUAGE | ||||||||||
String | HTTP_HEADER_CONTENT_ENCODING | ||||||||||
String | HTTP_HEADER_CONTENT_LENGTH | ||||||||||
String | HTTP_HEADER_CONTENT_TYPE | ||||||||||
String | HTTP_METHOD_POST |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
logger |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Execute a request to send the given remote invocation.
| |||||||||||
Return the content type to use for sending HTTP invoker requests.
| |||||||||||
Return whether to accept GZIP encoding, that is, whether to
send the HTTP "Accept-Encoding" header with "gzip" as value.
| |||||||||||
Set whether to accept GZIP encoding, that is, whether to
send the HTTP "Accept-Encoding" header with "gzip" as value.
| |||||||||||
Callback that supplies the bean
class loader to
a bean instance. | |||||||||||
Specify the content type to use for sending HTTP invoker requests.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create an ObjectInputStream for the given InputStream and codebase.
| |||||||||||
Return the InputStream to use for reading remote invocation results,
potentially decorating the given original InputStream.
| |||||||||||
Return the OutputStream to use for writing remote invocations,
potentially decorating the given original OutputStream.
| |||||||||||
Execute a request to send the given serialized remote invocation.
| |||||||||||
Perform the actual reading of an invocation object from the
given ObjectInputStream.
| |||||||||||
Perform the actual writing of the given invocation object to the
given ObjectOutputStream.
| |||||||||||
Return the bean ClassLoader that this executor is supposed to use.
| |||||||||||
Serialize the given RemoteInvocation into a ByteArrayOutputStream.
| |||||||||||
Deserialize a RemoteInvocationResult object from the given InputStream.
| |||||||||||
Serialize the given RemoteInvocation to the given OutputStream.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.beans.factory.BeanClassLoaderAware
| |||||||||||
From interface
org.springframework.remoting.httpinvoker.HttpInvokerRequestExecutor
|
Default content type: "application/x-java-serialized-object"
Execute a request to send the given remote invocation.
config | the HTTP invoker configuration that specifies the target service |
---|---|
invocation | the RemoteInvocation to execute |
Exception |
---|
Return whether to accept GZIP encoding, that is, whether to send the HTTP "Accept-Encoding" header with "gzip" as value.
Set whether to accept GZIP encoding, that is, whether to send the HTTP "Accept-Encoding" header with "gzip" as value.
Default is "true". Turn this flag off if you do not want GZIP response compression even if enabled on the HTTP server.
Callback that supplies the bean class loader
to
a bean instance.
Invoked after the population of normal bean properties but
before an initialization callback such as
InitializingBean's
afterPropertiesSet()
method or a custom init-method.
classLoader | the owning class loader; may be null in
which case a default ClassLoader must be used, for example
the ClassLoader obtained via
getDefaultClassLoader()
|
---|
Specify the content type to use for sending HTTP invoker requests.
Default is "application/x-java-serialized-object".
Create an ObjectInputStream for the given InputStream and codebase. The default implementation creates a CodebaseAwareObjectInputStream.
is | the InputStream to read from |
---|---|
codebaseUrl | the codebase URL to load classes from if not found locally
(can be null ) |
IOException | if creation of the ObjectInputStream failed |
---|
Return the InputStream to use for reading remote invocation results, potentially decorating the given original InputStream.
The default implementation returns the given stream as-is. Can be overridden, for example, for custom encryption or compression.
is | the original InputStream |
---|
IOException |
---|
Return the OutputStream to use for writing remote invocations, potentially decorating the given original OutputStream.
The default implementation returns the given stream as-is. Can be overridden, for example, for custom encryption or compression.
os | the original OutputStream |
---|
IOException |
---|
Execute a request to send the given serialized remote invocation.
Implementations will usually call readRemoteInvocationResult
to deserialize a returned RemoteInvocationResult object.
config | the HTTP invoker configuration that specifies the target service |
---|---|
baos | the ByteArrayOutputStream that contains the serialized RemoteInvocation object |
IOException | if thrown by I/O operations |
---|---|
ClassNotFoundException | if thrown during deserialization |
Exception | in case of general errors |
Perform the actual reading of an invocation object from the given ObjectInputStream.
The default implementation simply calls readObject
.
Can be overridden for deserialization of a custom wrapper object rather
than the plain invocation, for example an encryption-aware holder.
ois | the ObjectInputStream to read from |
---|
IOException | if thrown by I/O methods |
---|---|
ClassNotFoundException | if the class name of a serialized object couldn't get resolved |
Perform the actual writing of the given invocation object to the given ObjectOutputStream.
The default implementation simply calls writeObject
.
Can be overridden for serialization of a custom wrapper object rather
than the plain invocation, for example an encryption-aware holder.
invocation | the RemoteInvocation object |
---|---|
oos | the ObjectOutputStream to write to |
IOException | if thrown by I/O methods |
---|
Return the bean ClassLoader that this executor is supposed to use.
Serialize the given RemoteInvocation into a ByteArrayOutputStream.
invocation | the RemoteInvocation object |
---|
IOException | if thrown by I/O methods |
---|
Deserialize a RemoteInvocationResult object from the given InputStream.
Gives decorateInputStream
a chance to decorate the stream
first (for example, for custom encryption or compression). Creates an
ObjectInputStream
via createObjectInputStream
and
calls doReadRemoteInvocationResult
to actually read the object.
Can be overridden for custom serialization of the invocation.
is | the InputStream to read from |
---|---|
codebaseUrl | the codebase URL to load classes from if not found locally |
IOException | if thrown by I/O methods |
---|---|
ClassNotFoundException | if thrown during deserialization |
Serialize the given RemoteInvocation to the given OutputStream.
The default implementation gives decorateOutputStream
a chance
to decorate the stream first (for example, for custom encryption or compression).
Creates an ObjectOutputStream
for the final stream and calls
doWriteRemoteInvocation
to actually write the object.
Can be overridden for custom serialization of the invocation.
invocation | the RemoteInvocation object |
---|---|
os | the OutputStream to write to |
IOException | if thrown by I/O methods |
---|