[JBoss AOP] - Re: Interaction Jboss AOP with a Java Application
by flavia.rainone@jboss.com
Hi!
Yes, you can add an interceptor at runtime through dynamic AOP.
For that, the classes you want to affect dynamically must be prepared through "prepare" expressions, like this:
<prepare expr="all(org.mypackage.Pojo)"/>
| <prepare expr="execution(* org.mypackage.Pojo2->method()))/>
|
This must be done inside a jboss-aop.xml file. Alternativaly, you can annotate classes and methods you want to prepare with @Prepare.
After that, you can either use aopc or loadtime weaving to transform your classes. This will basically prepare all joinpoints matched by the prepare expressions so that, at runtime, you can add an interceptor to them, and remove interceptors as well.
Now, to add this interceptor at runtime, you must perform a call to AspectManager.addBinding() method. To take a better look at how this is done, you can look for calls to this method that are made inside org.jboss.aop.AspectXMLLoader class.
I am planning to write a tutorial on this at our blog in a few weeks (http://jbossaop.blogspot.com/). There are also plans for writing a more user-friendly interface to add interceptors and aspects at runtime. So, stay tuned!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147313#4147313
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147313
17 years, 11 months
[JBoss Tools (users)] - Re: Eclipse doesn't load JBoss Server with endorsed libs
by graben
JAVA_OPTS: -Djava.library.path="C:\Programme\Argon2 Developer Studio\jboss-as
| \bin\native" -Dprogram.name=run.bat -server -Xms128m -Xmx512m -Dsun.rmi.dgc.clie
| nt.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
-Dprogram.name="JBossTools JBoss 4.2 Runtime" -Xms256m -Xmx512m -XX:MaxPermSize=256m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.endorsed.dirs="C:/Programme/Argon2 Developer Studio/jboss-as/lib/endorsed"
| -Djava.library.path="C:/Programme/Argon2 Developer Studio/jboss-as/bin/native/"
native/libapr-1.dll
| native/libaprutil-1.dll
| native/libeay32.dll
| native/libtcnative-1.dll
| native/ssleay32.dll
| classpath.sh
| jboss_init_hpux.sh
| jboss_init_redhat.sh
| jboss_init_suse.sh
| jbosssch.dll
| jbosssvc.exe
| MyDB.lck
| MyDB.log
| MyDB.properties
| openssl.exe
| probe.bat
| probe.sh
| README-service.txt
| run.bat
| run.conf
| run.jar
| run.sh
| run_jprofiler.bat
| service.bat
| shutdown.bat
| shutdown.jar
| shutdown.sh
| twiddle.bat
| twiddle.jar
| twiddle.sh
| wsconsume.bat
| wsconsume.sh
| wsprovide.bat
| wsprovide.sh
| wsrunclient.bat
| wsrunclient.sh
| wstools.bat
| wstools.sh
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147297#4147297
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147297
17 years, 11 months
[Beginners Corner] - Lifecycle management for 3rd party software connection
by gymshoe2
Hello,
We have a 3rd party software component that we need to integrate into our EJB services. It can be somewhat expensive to establish a connection to this 3rd party software and we would also like to manage the number of connections that are attempted. (it is not a database)
I understand that the concept of a singleton cannot really be implemented using EJBs because the container wants to manage the lifecycle of objects correct?
What is the best way to create a wrapper around this 3rd party software? We will want calls made into the 3rd party library to be synchronous - we will not want to send a message and have it processed async. I understand this may be a bottle neck for overall server operation.
You may ask: why are we using EJBs given this limitation? For consistency I guess. EJB communication is being used between the client/server for the bulk of the application. In this particular case the 3rd party software needs to be involved in order to satisfy the request. The client is unaware of the server issues.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147280#4147280
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147280
17 years, 11 months