org.springframework.ejb.access

Class AbstractRemoteSlsbInvokerInterceptor

    • Constructor Detail

      • AbstractRemoteSlsbInvokerInterceptor

        public AbstractRemoteSlsbInvokerInterceptor()
    • Method Detail

      • setRefreshHomeOnConnectFailure

        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.

        See Also:
        ConnectException, ConnectIOException, NoSuchObjectException
      • isConnectFailure

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

        The default implementation delegates to RmiClientInterceptorUtils.

        Parameters:
        ex - the RMI exception to check
        Returns:
        whether the exception should be treated as connect failure
        See Also:
        RmiClientInterceptorUtils.isConnectFailure(java.rmi.RemoteException)
      • doInvoke

        @Nullable
        protected abstract java.lang.Object doInvoke(MethodInvocation invocation)
                                                        throws java.lang.Throwable
        Perform the given invocation on the current EJB home. Template method to be implemented by subclasses.
        Parameters:
        invocation - the AOP method invocation
        Returns:
        the invocation result, if any
        Throws:
        java.lang.Throwable - in case of invocation failure
        See Also:
        AbstractSlsbInvokerInterceptor.getHome(), newSessionBeanInstance()
      • newSessionBeanInstance

        protected java.lang.Object newSessionBeanInstance()
                                                   throws javax.naming.NamingException,
                                                          java.lang.reflect.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.

        Throws:
        javax.naming.NamingException - if thrown by JNDI
        java.lang.reflect.InvocationTargetException - if thrown by the create method
        See Also:
        AbstractSlsbInvokerInterceptor.create()
      • removeSessionBeanInstance

        protected void removeSessionBeanInstance(@Nullable
                                                 EJBObject ejb)
        Remove the given EJB instance. To be invoked by concrete remote SLSB invoker subclasses.
        Parameters:
        ejb - the EJB instance to remove
        See Also:
        EJBObject.remove()