[jboss-user] [EJB 3.0] - Re: Asynchronous callbacks
do-not-reply at jboss.com
Tue Jan 16 07:31:10 EST 2007
I managed to do it with a little "hack".
Instead of passing the Method as an argument, i passed the client object itself as an argument. This means that the method in the bean was changed to:
| public String getAsynhcString(Object client, String test)
The client calls the bean with:
| String tmp = test.getAsynhcString(this, "hello");
This works, and in this example it would be:
| Method met = client.getClass().getMethod("callmeback", String.class);
| met.invoke(client, "lovely");
There are several downsides to this, however. I have to extract the method, which means that i must know the method name and arguments. This is bad for generic method callbacks. It could be solved by annotations I suppose, but that only introduce more "hacks".
Anyone know how I can do if differently? Suggestions and ideas are much appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4002246#4002246
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4002246
More information about the jboss-user