open class JndiRmiClientInterceptor : JndiObjectLocator, MethodInterceptor, InitializingBean
org.aopalliance.intercept.MethodInterceptor for accessing RMI services from JNDI. Typically used for RMI-IIOP but can also be used for EJB home objects (for example, a Stateful Session Bean home). In contrast to a plain JNDI lookup, this accessor also performs narrowing through PortableRemoteObject.
With conventional RMI services, this invoker is typically used with the RMI service interface. Alternatively, this invoker can also proxy a remote RMI service with a matching non-RMI business interface, i.e. an interface that mirrors the RMI service methods but does not declare RemoteExceptions. In the latter case, RemoteExceptions thrown by the RMI stub will automatically get converted to Spring's unchecked RemoteAccessException.
The JNDI environment can be specified as "jndiEnvironment" property, or be configured in a jndi.properties
file or as system properties. For example:
<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>
Author
Juergen Hoeller
Since
1.1
See Also
#setJndiTemplate#setJndiEnvironment#setJndiNameJndiRmiServiceExporterJndiRmiProxyFactoryBeanorg.springframework.remoting.RemoteAccessExceptionjava.rmi.RemoteExceptionjava.rmi.Remote
JndiRmiClientInterceptor()
org.aopalliance.intercept.MethodInterceptor for accessing RMI services from JNDI. Typically used for RMI-IIOP but can also be used for EJB home objects (for example, a Stateful Session Bean home). In contrast to a plain JNDI lookup, this accessor also performs narrowing through PortableRemoteObject. With conventional RMI services, this invoker is typically used with the RMI service interface. Alternatively, this invoker can also proxy a remote RMI service with a matching non-RMI business interface, i.e. an interface that mirrors the RMI service methods but does not declare RemoteExceptions. In the latter case, RemoteExceptions thrown by the RMI stub will automatically get converted to Spring's unchecked RemoteAccessException. The JNDI environment can be specified as "jndiEnvironment" property, or be configured in a
|
open fun afterPropertiesSet(): Unit |
|
open fun getRemoteInvocationFactory(): RemoteInvocationFactory
Return the RemoteInvocationFactory used by this accessor. |
|
open fun getServiceInterface(): Class<*>
Return the interface of the service to access. |
|
open fun invoke(invocation: MethodInvocation): Any
Fetches an RMI stub and delegates to |
|
open fun prepare(): Unit
Fetches the RMI stub on startup, if necessary. |
|
open fun setCacheStub(cacheStub: Boolean): Unit
Set whether to cache the RMI stub once it has been located. Default is "true". Can be turned off to allow for hot restart of the RMI server. In this case, the RMI stub will be fetched for each invocation. |
|
open fun setExposeAccessContext(exposeAccessContext: Boolean): Unit
Set whether to expose the JNDI environment context for all access to the target RMI stub, i.e. for all method invocations on the exposed object reference. Default is "false", i.e. to only expose the JNDI context for object lookup. Switch this flag to "true" in order to expose the JNDI environment (including the authorization context) for each RMI invocation, as needed by WebLogic for RMI stubs with authorization requirements. |
|
open fun setLookupStubOnStartup(lookupStubOnStartup: Boolean): Unit
Set whether to look up the RMI stub on startup. Default is "true". Can be turned off to allow for late start of the RMI server. In this case, the RMI stub will be fetched on first access. |
|
open fun setRefreshStubOnConnectFailure(refreshStubOnConnectFailure: Boolean): Unit
Set whether to refresh the RMI stub on connect failure. Default is "false". Can be turned on to allow for hot restart of the RMI server. If a cached RMI stub throws an RMI exception that indicates a remote connect failure, a fresh proxy will be fetched and the invocation will be retried. |
|
open fun setRemoteInvocationFactory(remoteInvocationFactory: RemoteInvocationFactory): Unit
Set the RemoteInvocationFactory to use for this accessor. Default is a DefaultRemoteInvocationFactory. A custom invocation factory can add further context information to the invocation, for example user credentials. |
|
open fun setServiceInterface(serviceInterface: Class<*>): Unit
Set the interface of the service to access. The interface must be suitable for the particular service and remoting tool. Typically required to be able to create a suitable service proxy, but can also be optional if the lookup returns a typed stub. |
open class JndiRmiProxyFactoryBean : JndiRmiClientInterceptor, FactoryBean<Any>, BeanClassLoaderAware
FactoryBean for RMI proxies from JNDI. Typically used for RMI-IIOP (CORBA), but can also be used for EJB home objects (for example, a Stateful Session Bean home). In contrast to a plain JNDI lookup, this accessor also performs narrowing through javax.rmi.PortableRemoteObject. With conventional RMI services, this invoker is typically used with the RMI service interface. Alternatively, this invoker can also proxy a remote RMI service with a matching non-RMI business interface, i.e. an interface that mirrors the RMI service methods but does not declare RemoteExceptions. In the latter case, RemoteExceptions thrown by the RMI stub will automatically get converted to Spring's unchecked RemoteAccessException. The JNDI environment can be specified as "jndiEnvironment" property, or be configured in a
|