public class JndiRmiProxyFactoryBean extends JndiRmiClientInterceptor implements org.springframework.beans.factory.FactoryBean<Object>, org.springframework.beans.factory.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 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>
JndiRmiClientInterceptor.setServiceInterface(java.lang.Class)
,
JndiObjectLocator.setJndiName(java.lang.String)
,
JndiAccessor.setJndiTemplate(org.springframework.jndi.JndiTemplate)
,
JndiAccessor.setJndiEnvironment(java.util.Properties)
,
JndiObjectLocator.setJndiName(java.lang.String)
,
JndiRmiServiceExporter
,
RemoteAccessException
,
RemoteException
,
Remote
,
PortableRemoteObject.narrow(java.lang.Object, java.lang.Class)
CONTAINER_PREFIX
logger
Constructor and Description |
---|
JndiRmiProxyFactoryBean() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
Object |
getObject() |
Class<?> |
getObjectType() |
boolean |
isSingleton() |
void |
setBeanClassLoader(ClassLoader classLoader) |
createRemoteInvocation, doInvoke, doInvoke, getRemoteInvocationFactory, getServiceInterface, getStub, invoke, isConnectFailure, isConnectFailure, lookupStub, prepare, refreshAndRetry, setCacheStub, setExposeAccessContext, setLookupStubOnStartup, setRefreshStubOnConnectFailure, setRemoteInvocationFactory, setServiceInterface
getExpectedType, getJndiName, lookup, setExpectedType, setJndiName
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
public void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader
in interface org.springframework.beans.factory.BeanClassLoaderAware
public void afterPropertiesSet() throws NamingException
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
in class JndiRmiClientInterceptor
NamingException
public Object getObject()
getObject
in interface org.springframework.beans.factory.FactoryBean<Object>
public Class<?> getObjectType()
getObjectType
in interface org.springframework.beans.factory.FactoryBean<Object>
public boolean isSingleton()
isSingleton
in interface org.springframework.beans.factory.FactoryBean<Object>