Save This Page
Home » spring-framework-2.5.6-with-dependencies » org.springframework.ejb » access » [javadoc | source]
org.springframework.ejb.access
abstract public class: AbstractRemoteSlsbInvokerInterceptor [javadoc | source]
java.lang.Object
   org.springframework.jndi.JndiAccessor
      org.springframework.jndi.JndiLocatorSupport
         org.springframework.jndi.JndiObjectLocator
            org.springframework.ejb.access.AbstractSlsbInvokerInterceptor
               org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor

All Implemented Interfaces:
    org.aopalliance.intercept.MethodInterceptor, InitializingBean

Direct Known Subclasses:
    SimpleRemoteSlsbInvokerInterceptor, SimpleRemoteStatelessSessionProxyFactoryBean

Base class for interceptors proxying remote Stateless Session Beans. Designed for EJB 2.x, but works for EJB 3 Session Beans as well.

Such an interceptor must be the last interceptor in the advice chain. In this case, there is no target object.

Fields inherited from org.springframework.jndi.JndiLocatorSupport:
CONTAINER_PREFIX
Fields inherited from org.springframework.jndi.JndiAccessor:
logger
Method from org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor Summary:
doInvoke,   getCreateMethod,   invokeInContext,   isConnectFailure,   isHomeRefreshable,   lookup,   newSessionBeanInstance,   refreshAndRetry,   removeSessionBeanInstance,   setHomeInterface,   setRefreshHomeOnConnectFailure
Methods from org.springframework.ejb.access.AbstractSlsbInvokerInterceptor:
afterPropertiesSet,   create,   getCreateMethod,   getHome,   invoke,   invokeInContext,   isHomeRefreshable,   refreshHome,   setCacheHome,   setExposeAccessContext,   setLookupHomeOnStartup
Methods from org.springframework.jndi.JndiObjectLocator:
afterPropertiesSet,   getExpectedType,   getJndiName,   lookup,   setExpectedType,   setJndiName
Methods from org.springframework.jndi.JndiLocatorSupport:
convertJndiName,   isResourceRef,   lookup,   lookup,   setResourceRef
Methods from org.springframework.jndi.JndiAccessor:
getJndiEnvironment,   getJndiTemplate,   setJndiEnvironment,   setJndiTemplate
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor Detail:
 abstract protected Object doInvoke(MethodInvocation invocation) throws Throwable
    Perform the given invocation on the current EJB home. Template method to be implemented by subclasses.
 protected Method getCreateMethod(Object home) throws EjbAccessException 
    Check for EJB3-style home object that serves as EJB component directly.
 public Object invokeInContext(MethodInvocation invocation) throws Throwable 
    Fetches an EJB home object and delegates to doInvoke.

    If configured to refresh on connect failure, it will call #refreshAndRetry on corresponding RMI exceptions.

 protected boolean isConnectFailure(RemoteException ex) 
    Determine whether the given RMI exception indicates a connect failure.

    The default implementation delegates to RmiClientInterceptorUtils.

 protected boolean isHomeRefreshable() 
 protected Object lookup() throws NamingException 
    This overridden lookup implementation performs a narrow operation after the JNDI lookup, provided that a home interface is specified.
 protected Object newSessionBeanInstance() throws NamingException, InvocationTargetException 
    Return a new instance of the stateless session bean. To be invoked by concrete remote SLSB invoker subclasses.

    Can be overridden to change the algorithm.

 protected Object refreshAndRetry(MethodInvocation invocation) throws Throwable 
    Refresh the EJB home object and retry the given invocation. Called by invoke on connect failure.
 protected  void removeSessionBeanInstance(EJBObject ejb) 
    Remove the given EJB instance. To be invoked by concrete remote SLSB invoker subclasses.
 public  void setHomeInterface(Class homeInterface) 
    Set a home interface that this invoker will narrow to before performing the parameterless SLSB create() call that returns the actual SLSB proxy.

    Default is none, which will work on all J2EE servers that are not based on CORBA. A plain javax.ejb.EJBHome interface is known to be sufficient to make a WebSphere 5.0 Remote SLSB work. On other servers, the specific home interface for the target SLSB might be necessary.

 public  void setRefreshHomeOnConnectFailure(boolean refreshHomeOnConnectFailure) 
    Set whether to refresh the EJB home on connect failure. Default is "false".

    Can be turned on to allow for hot restart of the EJB server. If a cached EJB home throws an RMI exception that indicates a remote connect failure, a fresh home will be fetched and the invocation will be retried.