public abstract class RemoteInvocationSerializingExporter extends RemoteInvocationBasedExporter implements InitializingBean
RemoteInvocation オブジェクトを明示的にデシリアライズし、RemoteInvocation の HTTP インボーカーなどの RemoteInvocationResult オブジェクトをシリアライズするリモートサービスエクスポーターの抽象基本クラス。たとえば、Spring の HTTP インボーカー。ObjectInputStream および ObjectOutputStream 処理のテンプレートメソッドを提供します。
ObjectInputStream, ObjectOutputStream, doReadRemoteInvocation(java.io.ObjectInputStream), doWriteRemoteInvocationResult(org.springframework.remoting.support.RemoteInvocationResult, java.io.ObjectOutputStream)| 修飾子と型 | フィールドと説明 |
|---|---|
static java.lang.String | CONTENT_TYPE_SERIALIZED_OBJECT デフォルトのコンテンツ型: "application/x-java-serialized-object". |
logger| コンストラクターと説明 |
|---|
RemoteInvocationSerializingExporter() |
| 修飾子と型 | メソッドと説明 |
|---|---|
void | afterPropertiesSet() |
protected java.io.ObjectInputStream | createObjectInputStream(java.io.InputStream is) 指定された InputStream の ObjectInputStream を作成します。 |
protected java.io.ObjectOutputStream | createObjectOutputStream(java.io.OutputStream os) 指定された OutputStream の ObjectOutputStream を作成します。 |
protected RemoteInvocation | doReadRemoteInvocation(java.io.ObjectInputStream ois) 指定された ObjectInputStream から呼び出し結果オブジェクトの実際の読み取りを実行します。 |
protected void | doWriteRemoteInvocationResult(RemoteInvocationResult result, java.io.ObjectOutputStream oos) 指定された ObjectOutputStream への指定された呼び出し結果オブジェクトの実際の書き込みを実行します。 |
java.lang.String | getContentType() リモート呼び出しレスポンスの送信に使用するコンテンツ型を返します。 |
protected java.lang.Object | getProxy() |
boolean | isAcceptProxyClasses() プロキシクラスの逆直列化を受け入れるかどうかを返します。 |
void | prepare() このサービスエクスポーターを初期化します。 |
void | setAcceptProxyClasses(boolean acceptProxyClasses) プロキシクラスの逆直列化を受け入れるかどうかを設定します。 |
void | setContentType(java.lang.String contentType) リモート呼び出しレスポンスの送信に使用するコンテンツ型を指定します。 |
getRemoteInvocationExecutor, invoke, invokeAndCreateResult, setRemoteInvocationExecutorcheckService, checkServiceInterface, getExporterName, getProxyForService, getService, getServiceInterface, setInterceptors, setRegisterTraceInterceptor, setService, setServiceInterfacegetBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoaderpublic static final java.lang.String CONTENT_TYPE_SERIALIZED_OBJECT
public void setContentType(java.lang.String contentType)
デフォルトは "application/x-java-serialized-object" です。
public java.lang.String getContentType()
public void setAcceptProxyClasses(boolean acceptProxyClasses)
デフォルトは "true" です。セキュリティ対策として無効にすることができます。
public boolean isAcceptProxyClasses()
public void afterPropertiesSet()
InitializingBeanBeanFactoryAware、ApplicationContextAware などを満たした後、包含 BeanFactory によって呼び出されます。このメソッドにより、Bean インスタンスは、すべての Bean プロパティが設定されたときに、その全体的な構成の検証と最終的な初期化を実行できます。
InitializingBean 内の afterPropertiesSet public void prepare()
protected final java.lang.Object getProxy()
protected java.io.ObjectInputStream createObjectInputStream(java.io.InputStream is)
throws java.io.IOException デフォルトの実装では、Spring CodebaseAwareObjectInputStream が作成されます。
is - 読み込み元の InputStreamjava.io.IOException - ObjectInputStream の作成が失敗した場合 protected RemoteInvocation doReadRemoteInvocation(java.io.ObjectInputStream ois) throws java.io.IOException, java.lang.ClassNotFoundException
デフォルトの実装では、単に ObjectInputStream.readObject() を呼び出します。暗号化対応ホルダーなどの単純な呼び出しではなく、カスタムラッパーオブジェクトの逆直列化のためにオーバーライドできます。
ois - 読み込み元の ObjectInputStreamjava.io.IOException - I/O 障害の場合 java.lang.ClassNotFoundException - 転送されたクラスのケースがローカル ClassLoader で見つからない場合 protected java.io.ObjectOutputStream createObjectOutputStream(java.io.OutputStream os)
throws java.io.IOException デフォルトの実装では、プレーンな ObjectOutputStream が作成されます。
os - 書き込む OutputStreamjava.io.IOException - ObjectOutputStream の作成が失敗した場合 protected void doWriteRemoteInvocationResult(RemoteInvocationResult result, java.io.ObjectOutputStream oos) throws java.io.IOException
デフォルトの実装では、単に ObjectOutputStream.writeObject(java.lang.Object) を呼び出します。暗号化対応ホルダーなどの単純な呼び出しではなく、カスタムラッパーオブジェクトの直列化のためにオーバーライドできます。
result - RemoteInvocationResult オブジェクト oos - 書き込む ObjectOutputStreamjava.io.IOException - I/O メソッドによってスローされた場合