> See this unit test, where you dont have to implement any interface at all > http://svn.apache.org/viewvc?rev=1146964&view=rev
This testcase doesn't actually route the proxy's request to a bean:* endpoint. The entire point of this thread was about how one would implement a Future<String> Foo.sayHello(String) bean:* based endpoint for use with a proxy. Where is the test-case that has a interface (like this tests Future<String> Foo.sayHello(String)) returning a Future<>, creates a proxy to an endpoint which routes to a bean:* endpoint which implements that interface? Its late now, but I can copy over the test-cases I've been using to test with tomorrow if needed. * * * I'm still playing around with it, but I think I may just re-implement the proxy/bean bits so that I can implement callbacks for async response handling vs. a Future<?> return and possible other features... but who knows ;-) --jason >> But when you try then to use a camel-proxy for SimpleService w/ >> Future<String> test() the invocation fails, unable to find the correct >> method: >> >> <snip> >> java.util.concurrent.ExecutionException: java.lang.IllegalAccessException: >> Class org.apache.camel.component.bean.MethodInfo can not access a member of >> class com.sonatype.overlord.xpi.AsyncProxyBeanCamelTest$1 with modifiers >> "public" >> at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222) >> at java.util.concurrent.FutureTask.get(FutureTask.java:83) >> at >> com.sonatype.overlord.xpi.AsyncProxyBeanCamelTest.simpleService(AsyncProxyBeanCamelTest.java:94) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >> .... >> Caused by: java.lang.IllegalAccessException: Class >> org.apache.camel.component.bean.MethodInfo can not access a member of class >> com.sonatype.overlord.xpi.AsyncProxyBeanCamelTest$1 with modifiers "public" >> at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65) >> at >> org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:329) >> at >> org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:231) >> at >> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:169) >> </snip> >> >> Not a super helpful exception either. >> >> * * * > > I have been trying to reproduce this exception. Can you help me a bit > with showing some of your code that cased this exception? > >> >> So it appears that the Future-based async support that has just been added >> can only be used on the client-side of a proxy-bean usecase in Camel. >> >> I was hoping to be able to use Camel's proxy + bean features as a >> replacement for Lingo-style (http://lingo.codehaus.org/) usecases. But >> looks like this isn't easily possible to use with async implemented asis. >> Granted the future-based async is richer than Lingo's oneway bits, though >> ATM that is all I'm looking for for async, fire and forget events. >> >> I think there is enough plumbing in Camel to make it work, its just that the >> current proxy + bean impls wouldn't be usable. Or am I wrong in my analysis? >> >> --jason >> >> >> > > > > -- > Claus Ibsen > ----------------- > FuseSource > Email: cib...@fusesource.com > Web: http://fusesource.com > Twitter: davsclaus, fusenews > Blog: http://davsclaus.blogspot.com/ > Author of Camel in Action: http://www.manning.com/ibsen/