incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject svn commit: r881306 - /incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java
Date Tue, 17 Nov 2009 14:42:34 GMT
Author: ozzy
Date: Tue Nov 17 14:42:34 2009
New Revision: 881306

URL: http://svn.apache.org/viewvc?rev=881306&view=rev
Log:
ARIES-47 Add interceptor support to blueprint. Correct cglib test placement.

Modified:
    incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java

Modified: incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java?rev=881306&r1=881305&r2=881306&view=diff
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java
(original)
+++ incubator/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java
Tue Nov 17 14:42:34 2009
@@ -603,19 +603,19 @@
     
     private Object addInterceptors(Object original) throws ComponentDefinitionException{
         
-        try {
-            // Try load load a cglib class (to make sure it's actually available
-            getClass().getClassLoader().loadClass("net.sf.cglib.proxy.Enhancer");
-        } catch (Throwable t) {
-            throw new ComponentDefinitionException("Interceptors have been configured but
cglib can not be used", t);
-        }
-        
         Object intercepted = null;
         String beanName = getName();
         ComponentDefinitionRegistry reg = blueprintContainer.getComponentDefinitionRegistry();
         ComponentMetadata metaData = reg.getComponentDefinition(beanName);
         List<Interceptor> interceptors = reg.getInterceptors(metaData); 
         if(interceptors!=null && interceptors.size()>0){
+            try {
+                // Try load load a cglib class (to make sure it's actually available
+                getClass().getClassLoader().loadClass("net.sf.cglib.proxy.Enhancer");
+            } catch (Throwable t) {
+                throw new ComponentDefinitionException("Interceptors have been configured
but cglib can not be used", t);
+            }            
+            
             intercepted = CgLibInterceptorWrapper.createProxyObject(original.getClass().getClassLoader(),

                                                                 metaData, 
                                                                 interceptors, 



Mime
View raw message