Announcement Announcement Module
Collapse
No announcement yet.
view scope and AOP Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • view scope and AOP

    Hello,

    I have a situation where I have a controller @Controller which is defined in view scope with init-method.
    This has few methods which inturn invoke service layers and other layers of the application.

    I would like to capture the total time taken by these methods and hence am using AOP to measure the performance using @Around advice.

    As I need to proxy these controllers with init-method, I am going by the approach of wrapping these with a Wrapper and then making init initialization for Wrapper than for the @Contoller class.

    <code>

    <bean id="controller" class="some controller" scope="view"/>
    <bean id="wrapper" class ="somewrapper" scope = "view" init-method="start"/>

    </code>

    Inside start method of wrapper I call the start method of the controller which in turn is advised by the Aspect.

    I have few queries -

    a) Does wrapper class get created and initialized during application context load itself or will it be during the view load?
    b) Is there a simple way to achieve this through AOP?

    Thanks & Regards
    Surya
Working...
X