Announcement Announcement Module
Collapse
No announcement yet.
AOP Logging on Ejb class Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • AOP Logging on Ejb class

    Hi Folks,

    I am able to get AOP working for my business layer but I need to get it working for my Ejbs. I have an ejb that implments a business interface , and the ejb delegates work off to the business layer. What I need is logging on the actual ejb bean? Because ejbs dont have a bean id how do I get them logged.? Ie. I want to see in my logging ejbcreate ejbremove plus my business methods etc..

    Example
    <bean id="proxyCreator"
    class="org.springframework.aop.framework.autoproxy .BeanNameAutoProxyCreator">
    <property name="beanNames">
    <list>
    <value>*ManagerImpl</value> <!-- How do I reference a EJB -->
    </list>
    </property>
    <property name="interceptorNames">
    <list>
    <value>loggingInterceptor</value>
    </list>
    </property>
    </bean>


    Any ideas?

    Thanks
    Danny

  • #2
    Since Spring AOP only works on services that it manages, you would need to resort to AspectJ or similar lower level AOP to add logging like that.

    Comment


    • #3
      I think you could do it....you would end up proxying the proxy created by the proxyfactorybean

      Code:
      <bean id="yourManagerImpl" class="org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean">
         .....
      </bean>
      
      <bean id="proxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
        <property name="beanNames">
          <list>
            <value>*ManagerImpl</value> <!-- How do I reference a EJB -->
          </list>
        </property>
        <property name="interceptorNames">
          <list>
            <value>loggingInterceptor</value>
          </list>
        </property>
      </bean>

      Comment

      Working...
      X