public abstract class RemoteInvocationSerializingExporter extends RemoteInvocationBasedExporter implements org.springframework.beans.factory.InitializingBean
RemoteInvocation objects and serialize
RemoteInvocationResult objects,
for example Spring's HTTP invoker.
Provides template methods for ObjectInputStream and
ObjectOutputStream handling.
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
CONTENT_TYPE_SERIALIZED_OBJECT
Default content type: "application/x-java-serialized-object"
|
logger| 构造器和说明 |
|---|
RemoteInvocationSerializingExporter() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
afterPropertiesSet() |
protected ObjectInputStream |
createObjectInputStream(InputStream is)
Create an ObjectInputStream for the given InputStream.
|
protected ObjectOutputStream |
createObjectOutputStream(OutputStream os)
Create an ObjectOutputStream for the given OutputStream.
|
protected RemoteInvocation |
doReadRemoteInvocation(ObjectInputStream ois)
Perform the actual reading of an invocation result object from the
given ObjectInputStream.
|
protected void |
doWriteRemoteInvocationResult(RemoteInvocationResult result,
ObjectOutputStream oos)
Perform the actual writing of the given invocation result object
to the given ObjectOutputStream.
|
String |
getContentType()
Return the content type to use for sending remote invocation responses.
|
protected Object |
getProxy() |
boolean |
isAcceptProxyClasses()
Return whether to accept deserialization of proxy classes.
|
void |
prepare()
Initialize this service exporter.
|
void |
setAcceptProxyClasses(boolean acceptProxyClasses)
Set whether to accept deserialization of proxy classes.
|
void |
setContentType(String contentType)
Specify the content type to use for sending remote invocation responses.
|
getRemoteInvocationExecutor, invoke, invokeAndCreateResult, setRemoteInvocationExecutorcheckService, checkServiceInterface, getExporterName, getProxyForService, getService, getServiceInterface, setInterceptors, setRegisterTraceInterceptor, setService, setServiceInterfacegetBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoaderpublic void setContentType(String contentType)
Default is "application/x-java-serialized-object".
public String getContentType()
public void setAcceptProxyClasses(boolean acceptProxyClasses)
Default is "true". May be deactivated as a security measure.
public boolean isAcceptProxyClasses()
public void afterPropertiesSet()
afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBeanpublic void prepare()
protected final Object getProxy()
protected ObjectInputStream createObjectInputStream(InputStream is) throws IOException
The default implementation creates a Spring CodebaseAwareObjectInputStream.
is - the InputStream to read fromIOException - if creation of the ObjectInputStream failedprotected RemoteInvocation doReadRemoteInvocation(ObjectInputStream ois) throws IOException, ClassNotFoundException
The default implementation simply calls
ObjectInputStream.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 fromIOException - in case of I/O failureClassNotFoundException - if case of a transferred class not
being found in the local ClassLoaderprotected ObjectOutputStream createObjectOutputStream(OutputStream os) throws IOException
The default implementation creates a plain
ObjectOutputStream.
os - the OutputStream to write toIOException - if creation of the ObjectOutputStream failedprotected void doWriteRemoteInvocationResult(RemoteInvocationResult result, ObjectOutputStream oos) throws IOException
The default implementation simply calls
ObjectOutputStream.writeObject(java.lang.Object).
Can be overridden for serialization of a custom wrapper object rather
than the plain invocation, for example an encryption-aware holder.
result - the RemoteInvocationResult objectoos - the ObjectOutputStream to write toIOException - if thrown by I/O methods