Author: norman.richards(a)jboss.com
Date: 2008-10-27 14:53:50 -0400 (Mon, 27 Oct 2008)
New Revision: 9450
Modified:
tags/JBoss_Seam_2_1_0_SP1/src/main/org/jboss/seam/Component.java
Log:
merge 9420:9422 9448:9449 from trunk
Modified: tags/JBoss_Seam_2_1_0_SP1/src/main/org/jboss/seam/Component.java
===================================================================
--- tags/JBoss_Seam_2_1_0_SP1/src/main/org/jboss/seam/Component.java 2008-10-27 18:42:33
UTC (rev 9449)
+++ tags/JBoss_Seam_2_1_0_SP1/src/main/org/jboss/seam/Component.java 2008-10-27 18:53:50
UTC (rev 9450)
@@ -945,6 +945,26 @@
if ( log.isDebugEnabled() ) log.debug("interceptor stack: " +
interceptors);
}
+ public void addInterceptor(Object interceptorInstance)
+ {
+ try
+ {
+ addInterceptor(new Interceptor(interceptorInstance, this));
+ }
+ catch (NoClassDefFoundError e)
+ {
+ log.debug("Unable to load interceptor " +
interceptorInstance.getClass(), e);
+ }
+ catch (TypeNotPresentException e)
+ {
+ log.debug("Unable to load interceptor " +
interceptorInstance.getClass(), e);
+ }
+ catch (Exception e)
+ {
+ throw new IllegalArgumentException("Unable to load interceptor " +
interceptorInstance.getClass(), e);
+ }
+ }
+
public void addInterceptor(Interceptor interceptor)
{
if (interceptor.isInterceptorEnabled())
@@ -1021,12 +1041,22 @@
{
Class<?> clazz = Reflections.classForName(interceptorName);
interceptorInstance = clazz.newInstance();
+
}
+ catch (NoClassDefFoundError e)
+ {
+ log.debug("Unable to load interceptor " + interceptorName, e);
+ }
+ catch (TypeNotPresentException e)
+ {
+ log.debug("Unable to load interceptor " + interceptorName, e);
+ }
catch (Exception e)
{
throw new IllegalArgumentException("Unable to load interceptor " +
interceptorName, e);
}
- addInterceptor(new Interceptor(interceptorInstance, this));
+ addInterceptor(interceptorInstance);
+
}
}