public class JndiRmiServiceExporter extends RmiBasedExporter implements InitializingBean, DisposableBean
PortableRemoteObjectSE クラスを介してサービスをエクスポートします。エクスポートされた各サービスに対応するスタブとスケルトンを生成するには、"-iiop" オプションを指定して "rmic" を実行する必要があります。
また、RMI インボーカーを介した非 RMI サービスの公開をサポートし、JndiRmiClientInterceptor/JndiRmiProxyFactoryBean のそのようなインボーカーの自動検出を介してアクセスします。
RMI インボーカーを使用すると、RMI 通信は RmiInvocationHandler レベルで機能し、サービスに必要なスタブは 1 つだけです。サービスインターフェースは、すべてのメソッドで java.rmi.Remote を継承したり、java.rmi.RemoteException をスローしたりする必要はありませんが、入出力パラメーターは直列化可能でなければなりません。
JNDI 環境は、"jndiEnvironment" Bean プロパティとして指定するか、jndi.properties ファイルまたはシステムプロパティとして構成できます。例:
<property name="jndiEnvironment">
<props>
<prop key="java.naming.factory.initial">com.sun.jndi.cosnaming.CNCtxFactory</prop>
<prop key="java.naming.provider.url">iiop://localhost:1050</prop>
</props>
</property>logger| コンストラクターと説明 |
|---|
JndiRmiServiceExporter() |
| 修飾子と型 | メソッドと説明 |
|---|---|
void | afterPropertiesSet() |
void | destroy()Bean ファクトリシャットダウン時に JNDI から RMI サービスをバインド解除します。 |
void | prepare() このサービスエクスポータを初期化して、指定されたサービスを JNDI にバインドします。 |
void | rebind() ターゲットレジストリが再起動された場合に回復するために、指定されたサービスを JNDI に再バインドします。 |
void | setJndiEnvironment(PropertiesSE jndiEnvironment)JNDI ルックアップに使用する JNDI 環境を設定します。 |
void | setJndiName(StringSE jndiName) エクスポートされた RMI サービスの JNDI 名を設定します。 |
void | setJndiTemplate(JndiTemplate jndiTemplate)JNDI ルックアップに使用する JNDI テンプレートを設定します。 |
getObjectToExport, invokegetRemoteInvocationExecutor, invokeAndCreateResult, setRemoteInvocationExecutorcheckService, checkServiceInterface, getExporterName, getProxyForService, getService, getServiceInterface, setInterceptors, setRegisterTraceInterceptor, setService, setServiceInterfacegetBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoadercloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSEpublic void setJndiTemplate(JndiTemplate jndiTemplate)
public void setJndiEnvironment(PropertiesSE jndiEnvironment)
public void setJndiName(StringSE jndiName)
public void afterPropertiesSet()
throws NamingExceptionSE,
RemoteExceptionSEInitializingBeanBeanFactoryAware、ApplicationContextAware などを満たした後、包含 BeanFactory によって呼び出されます。このメソッドにより、Bean インスタンスは、すべての Bean プロパティが設定されたときに、その全体的な構成の検証と最終的な初期化を実行できます。
InitializingBean の afterPropertiesSet NamingExceptionSERemoteExceptionSEpublic void prepare()
throws NamingExceptionSE,
RemoteExceptionSENamingExceptionSE - サービスのバインドに失敗した場合 RemoteExceptionSE - サービスのエクスポートが失敗した場合 public void rebind()
throws NamingExceptionSENamingExceptionSE - サービスのバインドに失敗した場合 public void destroy()
throws NamingExceptionSE,
RemoteExceptionSEDisposableBean の destroy NamingExceptionSERemoteExceptionSE