Class AbstractSlsbInvokerInterceptor

    • Constructor Detail

      • AbstractSlsbInvokerInterceptor

        public AbstractSlsbInvokerInterceptor()
    • Method Detail

      • setLookupHomeOnStartup

        public void setLookupHomeOnStartup(boolean lookupHomeOnStartup)
        Set whether to look up the EJB home object on startup. Default is "true".

        Can be turned off to allow for late start of the EJB server. In this case, the EJB home object will be fetched on first access.

        See Also:
      • setCacheHome

        public void setCacheHome(boolean cacheHome)
        Set whether to cache the EJB home object once it has been located. Default is "true".

        Can be turned off to allow for hot restart of the EJB server. In this case, the EJB home object will be fetched for each invocation.

        See Also:
      • setExposeAccessContext

        public void setExposeAccessContext(boolean exposeAccessContext)
        Set whether to expose the JNDI environment context for all access to the target EJB, 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 EJB invocation, as needed by WebLogic for EJBs with authorization requirements.

      • refreshHome

        protected void refreshHome()
                            throws javax.naming.NamingException
        Refresh the cached home object, if applicable. Also caches the create method on the home object.
        javax.naming.NamingException - if thrown by the JNDI lookup
        See Also:
        JndiObjectLocator.lookup(), getCreateMethod(java.lang.Object)
      • getCreateMethod

        protected java.lang.reflect.Method getCreateMethod(java.lang.Object home)
                                                              throws EjbAccessException
        Determine the create method of the given EJB home object.
        home - the EJB home object
        the create method
        EjbAccessException - if the method couldn't be retrieved
      • getHome

        protected java.lang.Object getHome()
                                    throws javax.naming.NamingException
        Return the EJB home object to use. Called for each invocation.

        Default implementation returns the home created on initialization, if any; else, it invokes lookup to get a new proxy for each invocation.

        Can be overridden in subclasses, for example to cache a home object for a given amount of time before recreating it, or to test the home object whether it is still alive.

        the EJB home object to use for an invocation
        javax.naming.NamingException - if proxy creation failed
        See Also:
        JndiObjectLocator.lookup(), getCreateMethod(java.lang.Object)
      • isHomeRefreshable

        protected boolean isHomeRefreshable()
        Return whether the cached EJB home object is potentially subject to on-demand refreshing. Default is "false".
      • invokeInContext

        protected abstract java.lang.Object invokeInContext(MethodInvocation invocation)
                                                               throws java.lang.Throwable
        Perform the given invocation on the current EJB home, within the thread context being prepared accordingly. Template method to be implemented by subclasses.
        invocation - the AOP method invocation
        the invocation result, if any
        java.lang.Throwable - in case of invocation failure
      • create

        protected java.lang.Object create()
                                   throws javax.naming.NamingException,
        Invokes the create() method on the cached EJB home object.
        a new EJBObject or EJBLocalObject
        javax.naming.NamingException - if thrown by JNDI
        java.lang.reflect.InvocationTargetException - if thrown by the create method