[JBoss jBPM] - Re: Optional actor-id
by tom_goring
Thanks for that...
I've looked though the examples... can you give me a pointer to as to how best to pass arguments to the handler? Or do I need to use the process variables?
I was hoping I could do the below but as soon as I change:
| <assignment class="jnet.faces.PersonAssignmentHandler"></assignment>
|
To
| <assignment class="jnet.faces.PersonAssignmentHandler" pooled-actors="#{accountantCompany.entityId}" actor-id="#{personRelations.getPersonManagerActorId(accountantCompany)}"></assignment>
|
My handler is nolonger called:
public class PersonAssignmentHandler implements AssignmentHandler {
|
| public void assign(Assignable assignable, ExecutionContext executionContext)
| throws Exception {
| String groupId = Interpolator.instance().interpolate(executionContext.getTask().getPooledActorsExpression());
| String actorId = Interpolator.instance().interpolate(executionContext.getTask().getActorIdExpression());
| if ( !StringUtil.isNullOrBlank(actorId) ) {
| assignable.setActorId(actorId);
| }
| if ( !StringUtil.isNullOrBlank(groupId) ) {
| assignable.setPooledActors(new String[] {groupId});
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4150878#4150878
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4150878
18 years, 2 months
[JBoss AOP] - How to debug dynamic AOP that is not working for some classe
by Horiana
Hi,
I have been trying to get dynamic AOP to work on our custom classes, but could not.
My environment: JBoss AS 4.0.5, JBoss AOP 1.5.6 GA, JDK 1.5, loadtime weaving
Dynamic AOP works for the following:
1. aopexample.ear - "injboss" example in the tutorial - deploying ear with standard contents and a standalone jboss-aop.xml
- Modifying jboss-aop.xml in deploy/ directory directly, to add and remove bindings produces more or fewer logs showing more or fewer interceptions.
- It still works when ear is exploded, the war in it is also exploded, and aopexamplelib.jar is copied to aopexample.war\WEB-INF\lib as well.
2. custom.ear with ejb1.jar, ejb2.jar, lib1.jar, lib2.jar, app.war and myaspect.jar. The ear and war are both exploded. There is a test.jsp in the war that executes sample classes in myaspect.jar. Using in the standalone jboss-aop.xml before JBoss startup:
<prepare expr="execution(* com.mypackage.MyClass*->*(..))"/>
| <prepare expr="execution(* com.custom.shopping.*->*(..))"/>
Add new bindings during runtime:
<bind pointcut="execution(* com.mypackage.MyClass*->*(..))">
| <interceptor class="com.myaspect.MyInterceptor"/>
| </bind>
| <bind pointcut="execution(* com.custom.shopping.*->*(..))">
| <interceptor class="com.myaspect.MyInterceptor"/>
| </bind>
Dynamic AOP works for MyClass* classes, which is only used by test.jsp and packaged in myaspect.jar.
However, dynamic AOP does NOT work for com.custom.shopping.* classes, which is packaged inside lib1.jar. lib1.jar is present at custom.ear/ and app.war/WEB-INF/lib/. If this jar is removed from WEB-INF/lib, a NoClassFoundException will be thrown when hitting a page of the app that calls the com.custom.shopping.* classes. With the binding added, there is no logging that shows the AOP aspect weaving.
If I start JBoss with the binding, I can see the shopping classes get intercepted from the logs. At runtime, if I remove the binding and add it back, I do not get the logs anymore.
How do I debug the problem? How do I turn on debugging? What do you think is the problem? Is this a classloader issue? Currently, there are no errors or exceptions.
Appreciate your response.
Anna
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4150877#4150877
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4150877
18 years, 2 months
[JBoss AOP] - Re: How does this work?
by kabir.khan@jboss.com
JBoss AOP is a 2-step process. The info from your jboss-aop.xml file needs to be available BOTH at weaving time AND at runtime.
At run-time you would use the -Djboss.aop.path system property for a standalone application. In JBoss AS a special deployer will pick up the jboss-aop.xml files and make them available.
We don't support Tomcat out of the box, but need to call the AspectXmlLoader.deployXml(URL url) method, where url is the url of the -aop.xml you want to deploy. You should be able to do this from a startup servlet or something like that.
Please let us know how you get on, since if this gets documented it should be very useful for a lot of people :-)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4150875#4150875
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4150875
18 years, 2 months