[JBoss-user] [JBoss AOP] - Re: Dynamically adding annotated aspect classes without

2006-06-17 Thread fatbatman
Hi,

I'm not sure if I'm doing something wrong in the way that I get the ClassFile 
object? but I'm getting some strange behaviour using this new feature.

Using the annotated-aspects test as a starting point I run the test specifying 
the classpath using -Djboss.aop.class.path=myclasspath - all works as expected.

I adjusted Driver.java it so it looks as below and removed 
-Djboss.aop.class.path from the JVM args.  The aspects are no longer added as 
expected.
If you remove the try-catch block around the POJO creation and method/field 
calls the method advice is added but not the ones for the contructor or field 
access.  No info/error message are thrown is either case.

public class Driver
  | {
  |public static void main(String[] args)
  |{
  |
  | try {
  | AspectAnnotationLoader aspectLoader = new 
AspectAnnotationLoader(AspectManager.instance());
  | 
aspectLoader.deployClassFile(getClassFile(MyAspect.class));
  | } catch (IOException e) {
  | e.printStackTrace();
  | } catch (Exception e) {
  | e.printStackTrace();
  | }
  | 
  | try{
  |   System.out.println(--- pojo constructor ---);
  |   POJO pojo = new POJO();
  |   System.out.println(--- pojo.method(); ---);
  |   pojo.method();
  |   System.out.println(--- pojo field write ---);
  |   pojo.field = 1;
  |   System.out.println(--- pojo field read ---);
  |   int i = pojo.field;
  | }catch(Exception e){
  | e.printStackTrace();
  | }
  |}
  | 
  | 
  | 
  | public static ClassFile getClassFile(Class clazz) throws IOException {
  | String tName=clazz.getSimpleName() + .class;
  | if (clazz.getPackage() != null) {
  | String tPackageName = clazz.getPackage().getName();
  | String tClassName = clazz.getSimpleName();
  | tPackageName = tPackageName.replace('.', '/');
  | tName = tPackageName + '/' + tClassName + .class;
  | } 
  | InputStream input = 
clazz.getClassLoader().getResourceAsStream(tName);
  | BufferedInputStream fin = new BufferedInputStream(input);
  | ClassFile cf = new ClassFile(new DataInputStream(fin));
  | return cf;
  | }
  | 
  | 
  | }


I ran all these tests within Eclipse and using the runtime instrumentor and 
latest code from jboss-head.

regards

James

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3951457#3951457

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3951457


___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss AOP] - Re: Dynamically adding annotated aspect classes without

2006-06-17 Thread fatbatman
Its just dawned on me I need to prepare the objects for runtime instrumentation 
as in the dynamic-aop example using a jboss-aop.xml defined in the jvm args 
using -Djboss.aop.path=jboss-aop.xml.

?xml version=1.0 encoding=UTF-8?
  | aop
  | 
  |prepare expr=all(POJO)/
  | 
  | /aop


When I do that it works fine, but its was hard to find.

Thanks again for adding this feature. 


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3951469#3951469

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3951469


___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss AOP] - Re: Dynamically adding annotated aspect classes without

2006-06-07 Thread fatbatman
Thanks for this, I haven't had a chance to play with it yet but hopefully will 
do next week.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3949615#3949615

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3949615


___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss AOP] - Re: Dynamically adding annotated aspect classes without

2006-05-30 Thread [EMAIL PROTECTED]
[ur]http://jira.jboss.com/jira/browse/JBAOP-260[/url]

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3947629#3947629

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3947629


---
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnkkid=107521bid=248729dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss AOP] - Re: Dynamically adding annotated aspect classes without

2006-05-30 Thread [EMAIL PROTECTED]
I have added this to cvs

The API is 

  | void AspectAnnotationLoader.deployClassFile(javassist.bytecode.ClassFile)
  | void AspectAnnotationLoader.undeployClassFile(javassist.bytecode.ClassFile)
  | 

See the deployInputStreamIterator() method for how to obtain the class file.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3947630#3947630

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3947630


---
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnkkid=107521bid=248729dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss AOP] - Re: Dynamically adding annotated aspect classes without

2006-05-26 Thread fatbatman
I see that AspectAnnotationLoader iterates through the list of FileInputStreams 
of the classes in the jboss.aop.class.path turning each one into 
javassist.bytecode.ClassFile before checking each one for annotations.

I think a public method on AspectAnnotationLoader that allows the user to do 
something like;

aspectAnnotationLoader.addAnnotatedClass(MyAnnotatedClass.class);

would be useful, for me at least :)

best wishes

James

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3946923#3946923

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3946923


---
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnkkid=107521bid=248729dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user