[JBoss AOP] - InterfaceIntroduction with Dynamic AOP
by HannesR
Hi,
I was trying to add an interface introduction to a class during runtime, i.e. by dynamic AOP, but so far without success.
I was able to do it by "static" AOP, i.e. adding the respective tags in the xml files as described in the reference manual or the tutorial.
The important excerpt from my (static) xml-file:
<introduction class="MainClass">
| <mixin>
| <interfaces>
| Printable
| </interfaces>
| <class>Printer</class>
| <construction>new Printer(this)</construction>
| </mixin>
| </introduction>
Intending to use dynamic AOP, I tried it with the following:
MainClass myMainClass = new MainClass();
| String[] interfaces = {"Printable"};
| // use InterfaceIntroduction-Constructor found in the API for jboss-aop_1.5.3.GA
| InterfaceIntroduction ii = new InterfaceIntroduction("SomeArbitraryName","MainClass", interfaces, "Printer", "new Printer(this)");
| AspectManager.instance().addInterfaceIntroduction(ii);
|
| // use reflection to invoke the method "print" which is implemented by Printer.
| // this worked using "static" AOP. However it throws an exception now. Therefore
| // something must have gone wrong :-(
| try {
| myMainClass.getClass().getMethod("print", null).invoke(myMainClass, null);
| } catch (Exception e) {
| e.printStackTrace();
| }
I don't know whether I have to prepare anything for my issue, but I tried both without and with the following: <prepare expr="all(MainClass)"/>
I tried both running in loadtime mode as well as in HotSwap-mode.
Any ideas what I made wrong? Is it possible at all to add an interface introduction using Dynamic AOP?
Thanks in advance for your help!
Hannes
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4011647#4011647
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4011647
19Â years, 2Â months
[JBoss jBPM] - Re: How to start this process instance?
by estaub
Oops - please ignore my earlier message - I didn't read carefully.
Are you supposed to get an enter event on the start state?
I would only have expected a leave event.
Start state are usually special.
The documentation hints that there isn't an enter event on the start node, but doesn't say it explicitly:
anonymous wrote : When a process instance is created, a token is created for the main path of execution. This token is called the root token of the process instance and it is positioned in the start state of the process definition.
I'm guessing a lot, but I wonder if you are trying to createStartTaskInstance() before signalling to enter the node where the swimlane is started. I suspect that you have to wait till then, based on the examples.
-Ed Staub
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4011646#4011646
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4011646
19Â years, 2Â months
[JBoss Seam] - Re: composite ui component
by sonstone
No, I think you might be right about it being more of a jsf question. I was just hoping someone could help me here.
I'd like to do something like this in my page:
| <h:form>
| <z:mycomponent config="#{customer.config}"/>
| <h:commandButton value="Ok" action="doAuthenticate"/>
| </h:form>
|
I'd then like based off of the configuration given to the component to contain the following two groups of child components:
| <!-- Snippet Group 1: -->
| <h:outputText value="Account Number:"/>
| <h:inputText value="#{payment.accountNumber}" id="accountNumber" required="true">
| <s:validate/>
| </h:inputText>
| <h:message for="accountNumber" />
| <br/>
|
| <!-- Snippet Group 2: -->
| <h:outputText value="PIN:"/>
| <h:inputText value="#{payment.pinNumber}" id="pinNumber" required="true">
| <s:validate/>
| </h:inputText>
| <h:message for="pinNumber" />
| <br/>
|
I know I could render the html for the child snippets, but I'd like to re-use the jsf components so that I can take advantage of the databinding. Ideally I'd like to store the snippets in individual jspx files and dynamically link them into my component at runtime.
I'm kind of new to jsf/seam so I apologize if this is the wrong place or I'm missing something really obvious here.
Thanks,
Daniel
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4011627#4011627
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4011627
19Â years, 2Â months