Results 1 to 3 of 3

Thread: Intercepting "non-wired" code...

  1. #1
    Join Date
    Jun 2006
    Posts
    15

    Default Intercepting "non-wired" code...

    Hello.

    I have a large application - most of the classes are not wired in any applicationContext file to use Spring. I am trying to find all occurrences of Exceptions being caught and swallowed.

    I created my ThrowsAdvice bean and wired everything up in my applicationContext and it works GREAT!! (see my configuration below)

    Question - this only catches exceptions from beans wired in this appContext. Is there a way to cover ALL code running in the JVM?? (the classes not using Spring IoC)?

    Thanks in advance!!!

    Code:
    <!-- Define the ThrowsAdvice bean -->
        <bean id="logThrowsAdvice" class="com.oracle.capplan.RemoteThrowsAdvice"/>
    
        <!-- Wire the advice to the application code -->
        <bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">       
            <property name="beanNames">
                <value>*</value> 
            </property>
            <property name="interceptorNames">
                <list>
                    <value>logThrowsAdvice</value>
                </list>
            </property>
        </bean>

  2. #2
    Join Date
    Jun 2006
    Posts
    15

    Default

    I should also mention that I am using version 1.2.8

  3. #3
    Join Date
    May 2007
    Location
    Saint Petersburg, Russian Federation
    Posts
    1,189

    Default

    Quote Originally Posted by tgrahn View Post
    ...

    Question - this only catches exceptions from beans wired in this appContext. Is there a way to cover ALL code running in the JVM?? (the classes not using Spring IoC)?

    Thanks in advance!!!
    You are not able to weave the classes loaded by bootstrap classloader but it's possible to apply the aspect to all application classes. Check the following AspectJ reference section - Chapter 5. Load-Time Weaving

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •