[jboss-dev-forums] [Design of AOP on JBoss (Aspects/JBoss)] - Dynamic Aspect: managing unknow aspect

mane81 do-not-reply at jboss.com
Thu Oct 23 18:15:09 EDT 2008


Hi,
i'm in trouble with managing unknow aspects at runtime and i want to know if this kind of feature is supported by jboss-aop. I'll try to explain my problem with an example:

I have two classes, Service and ServiceManager. 
Both are tagged with @Prepare ("all(this)"). 
ServiceManager listens to aspect class (tagged with @Aspect e defining some bindings). When an aspect arrives, ServiceManager load the class using the following code:

      AspectManager manager = AspectManager.instance(ucl);
      AspectAnnotationLoader loader = new AspectAnnotationLoader(manager);
      loader.setClassLoader(ucl);
      InputStream in = new DataInputStream(ObjectFromNetwork));
      List list = new ArrayList();
      list.add(in);
      Iterator iterator = list.iterator();
      loader.deployInputStreamIterator(iterator);

So far the only results I obtained are that the deploy seems to end successfully but the advice is not thrown or the following exception:
java.lang.NullPointerException
        at org.jboss.aop.pointcut.MethodMatcher.(MethodMatcher.java:72)
        at org.jboss.aop.pointcut.ExecutionMethodMatcher.(ExecutionMethodMatcher.java:53)
        at org.jboss.aop.pointcut.PointcutExpression.matchesExecution(PointcutExpression.java:118)
        at org.jboss.aop.Advisor.resolveMethodPointcut(Advisor.java:1333)

There is a way to resolve this problem using jboss-aop?
In the documentation I found something similar using the JBoss AS where, an aspect inserted in a pre-defined directory, is automatically deployed. 
How does this feature really work?

Thanks
Emanuele

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4184317#4184317

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4184317



More information about the jboss-dev-forums mailing list