additional logging requested for interceptor instantiation
----------------------------------------------------------

         Key: BEEHIVE-928
         URL: http://issues.apache.org/jira/browse/BEEHIVE-928
     Project: Beehive
        Type: Improvement
  Components: Controls  
    Versions: V1    
 Environment: Beehive dist built from SVN r280592
    Reporter: Jeremiah Johnson
    Priority: Minor
     Fix For: TBD


After going through the Wiki page about interceptors 
(http://wiki.apache.org/beehive/Controls/AnnotationBasedFeatures) I created an 
interceptor but wasn't getting the results I expected.  When the interceptor is 
instantiated, a failure to find the interceptor class is currently silently 
ignored; please consider logging the failure.

Proposed patch (note that I don't really like using SEP - just don't see any 
other logging used in the Controls Runtime):
--- 
trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBean.java
@@ -932,6 +933,10 @@
             try
             {
                 i  = (Interceptor) getControlService( 
getControlBeanContext().getClassLoader().loadClass( n ), null );
+                if( i == null ) {
+                    System.err.println( "interceptor (" + n +
+                        ") not found in current classpath" );
+                }
             }
             catch ( Exception e )
             {
@@ -939,7 +944,7 @@
                 // isn't present on this system at runtime 
(ClassNotFoundException), or if the container of the
                 // control didn't registers the service.

-                // TODO log a message here to that effect, but just swallow 
the exception for now.
+                System.err.println( "failed to instantiate interceptor: " + e 
);
             }
             finally
             {
---

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to