org.springframework.ejb.access

## 类 AbstractRemoteSlsbInvokerInterceptor

- 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

- 所有已实现的接口:
    org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor, org.springframework.beans.factory.InitializingBean
  直接已知子类:
    SimpleRemoteSlsbInvokerInterceptor

      public abstract class AbstractRemoteSlsbInvokerInterceptor
      extends AbstractSlsbInvokerInterceptor

  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.

  作者:
    Rod Johnson, Juergen Hoeller

- - ### 字段概要

    - ### 从类继承的字段 org.springframework.jndi.JndiLocatorSupport

      `CONTAINER_PREFIX`

    - ### 从类继承的字段 org.springframework.jndi.JndiAccessor

      `logger`

  - ### 构造器概要

    构造器
    构造器和说明
    `AbstractRemoteSlsbInvokerInterceptor()`

  - ### 方法概要

    所有方法 实例方法 抽象方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected abstract Object` | `doInvoke(org.aopalliance.intercept.MethodInvocation invocation)` Perform the given invocation on the current EJB home.
    `protected Method` | `getCreateMethod(Object home)` Check for EJB3-style home object that serves as EJB component directly.
    `Object` | `invokeInContext(org.aopalliance.intercept.MethodInvocation invocation)` Fetches an EJB home object and delegates to `doInvoke`.
    `protected boolean` | `isConnectFailure(RemoteException ex)` Determine whether the given RMI exception indicates a connect failure.
    `protected boolean` | `isHomeRefreshable()` Return whether the cached EJB home object is potentially subject to on-demand refreshing.
    `protected Object` | `newSessionBeanInstance()` Return a new instance of the stateless session bean.
    `protected Object` | `refreshAndRetry(org.aopalliance.intercept.MethodInvocation invocation)` Refresh the EJB home object and retry the given invocation.
    `protected void` | `removeSessionBeanInstance(EJBObject ejb)` Remove the given EJB instance.
    `void` | `setRefreshHomeOnConnectFailure(boolean refreshHomeOnConnectFailure)` Set whether to refresh the EJB home on connect failure.

    - ### 从类继承的方法 org.springframework.ejb.access.AbstractSlsbInvokerInterceptor

      `afterPropertiesSet, create, getHome, invoke, refreshHome, setCacheHome, setExposeAccessContext, setLookupHomeOnStartup`

    - ### 从类继承的方法 org.springframework.jndi.JndiObjectLocator

      `getExpectedType, getJndiName, lookup, setExpectedType, setJndiName`

    - ### 从类继承的方法 org.springframework.jndi.JndiLocatorSupport

      `convertJndiName, isResourceRef, lookup, lookup, setResourceRef`

    - ### 从类继承的方法 org.springframework.jndi.JndiAccessor

      `getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate`

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### AbstractRemoteSlsbInvokerInterceptor

          public AbstractRemoteSlsbInvokerInterceptor()

  - ### 方法详细资料

    - #### 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.

      另请参阅:
        `ConnectException`, `ConnectIOException`, `NoSuchObjectException`

    - #### isHomeRefreshable

          protected boolean isHomeRefreshable()

      从类复制的说明: `AbstractSlsbInvokerInterceptor`
      Return whether the cached EJB home object is potentially subject to on-demand refreshing. Default is "false".
      覆盖:
        `isHomeRefreshable` 在类中 `AbstractSlsbInvokerInterceptor`

    - #### getCreateMethod

          protected Method getCreateMethod(Object home)
                                    throws EjbAccessException

      Check for EJB3-style home object that serves as EJB component directly.
      覆盖:
        `getCreateMethod` 在类中 `AbstractSlsbInvokerInterceptor`
      参数:
        `home` - the EJB home object
      返回:
        the create method
      抛出:
        `EjbAccessException` - if the method couldn't be retrieved

    - #### invokeInContext

          @Nullable
          public Object invokeInContext(org.aopalliance.intercept.MethodInvocation invocation)
                                            throws Throwable

      Fetches an EJB home object and delegates to `doInvoke`.

      If configured to refresh on connect failure, it will call `refreshAndRetry(org.aopalliance.intercept.MethodInvocation)` on corresponding RMI exceptions.

      指定者:
        `invokeInContext` 在类中 `AbstractSlsbInvokerInterceptor`
      参数:
        `invocation` - the AOP method invocation
      返回:
        the invocation result, if any
      抛出:
        `Throwable` - in case of invocation failure
      另请参阅:
        `AbstractSlsbInvokerInterceptor.getHome()`, `doInvoke(org.aopalliance.intercept.MethodInvocation)`, `refreshAndRetry(org.aopalliance.intercept.MethodInvocation)`

    - #### isConnectFailure

          protected boolean isConnectFailure(RemoteException ex)

      Determine whether the given RMI exception indicates a connect failure.

      The default implementation delegates to RmiClientInterceptorUtils.

      参数:
        `ex` - the RMI exception to check
      返回:
        whether the exception should be treated as connect failure
      另请参阅:
        `RmiClientInterceptorUtils.isConnectFailure(java.rmi.RemoteException)`

    - #### refreshAndRetry

          @Nullable
          protected Object refreshAndRetry(org.aopalliance.intercept.MethodInvocation invocation)
                                               throws Throwable

      Refresh the EJB home object and retry the given invocation. Called by invoke on connect failure.
      参数:
        `invocation` - the AOP method invocation
      返回:
        the invocation result, if any
      抛出:
        `Throwable` - in case of invocation failure
      另请参阅:
        `AbstractSlsbInvokerInterceptor.invoke(org.aopalliance.intercept.MethodInvocation)`

    - #### doInvoke

          @Nullable
          protected abstract Object doInvoke(org.aopalliance.intercept.MethodInvocation invocation)
                                                 throws Throwable

      Perform the given invocation on the current EJB home. Template method to be implemented by subclasses.
      参数:
        `invocation` - the AOP method invocation
      返回:
        the invocation result, if any
      抛出:
        `Throwable` - in case of invocation failure
      另请参阅:
        `AbstractSlsbInvokerInterceptor.getHome()`, `newSessionBeanInstance()`

    - #### newSessionBeanInstance

          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.

      抛出:
        `NamingException` - if thrown by JNDI
        `InvocationTargetException` - if thrown by the create method
      另请参阅:
        `AbstractSlsbInvokerInterceptor.create()`

    - #### removeSessionBeanInstance

          protected void removeSessionBeanInstance(@Nullable
                                                   EJBObject ejb)

      Remove the given EJB instance. To be invoked by concrete remote SLSB invoker subclasses.
      参数:
        `ejb` - the EJB instance to remove
      另请参阅:
        `EJBObject.remove()`