[jboss-dev-forums] [JBoss Microcontainer Development] New message: "Re: Optimizing aop lifecycle"

Kabir Khan noreply at jboss.org
Tue Jan 5 14:16:39 EST 2010


JBoss development,

A new message was posted in the thread "Optimizing aop lifecycle":

http://community.jboss.org/message/518409#518409

Author  : Kabir Khan
Profile : http://community.jboss.org/people/kabir.khan@jboss.com

Message:
--------------------------------------------------------------
I have committed this and all tests pass. There are some changes in that the lifecycle-xxx now throws an error if the 'expr' attribute is used, and the 'classes' attribute must now be an annotation.
 
>From LifecycleBinding's start method:
*public* *void* start() *throws* Exception
   {
*if* (expr != *null*)
         *throw* *new* IllegalArgumentException("The 'expr' attribute has been deprecated. Only the name of an annotation in the 'classes' attribute work now.");
*if* (classes == *null*)
*throw* *new* IllegalArgumentException("Null 'classes' attribute.");
*if* (manager != *null*)
         +log+.warn("The use of manager has been deprecated");
*if* (callbackBean == *null*)
*throw* *new* IllegalArgumentException("Null callback bean");
*if* (state == *null*)
*throw* *new* IllegalArgumentException("Null controller state");
*if* (name == *null*)
name = GUID.+asString+();
 
*if* (!classes.startsWith("@"))
         *throw* *new* IllegalArgumentException("Could not parse '" + classes + " into an annotation. (It must start with '@')");
      String annotationName = classes.substring(1);
      Class<Annotation> clazz = *null*;
*try*
      {
         clazz = (Class<Annotation>)SecurityActions.+getContextClassLoader+().loadClass(annotationName);
      }
*catch* (Exception e)
      {
*throw* *new* IllegalArgumentException("An error occurred loading '" + classes + "'", e);
      }
 
      LifecycleAspectDependencyBuilderListItem item = *new* LifecycleAspectDependencyBuilderListItem(callbackBean, state, installMethod, uninstallMethod);
plugin = *new* LifecycleAnnotationPlugin<Annotation>(clazz, item);
      getBeanAnnotationAdapter().addAnnotationPlugin(plugin);
   }

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/518409#518409




More information about the jboss-dev-forums mailing list