I seem to remember an offline discussion a long time ago where we
thought about extending InstanceContext to provide access to the head of
the interceptor chain and head of the handler chains.
This would seem to be more flexible than going to the InvocationHandler
especially as we would like to consider replacing the use of reflection
with the bytecode generation of specialized proxies.
I imagine the code in that case would be something like:
Interceptor head = ctx.getInterceptor(operationName);
Message msg = factory.createMessage();
msg.setBody(args);
head.invoke(msg);
Does this still make sense?
--
Jeremy
Jim Marino wrote:
> After talking with Sebastien the other day, it appears Axis1 uses
> reflection to make invocations, requiring entry points to return
> proxies implementing the exposed service (Axis2 appears different). So,
> I changed getInstance(..) to return a generated proxy - if you don't
> need a proxy, get the InvocationHandler directly using
> getImplementationInstance() as in:
>
> AggregateContext aggregateContext = ...
> EntryPointContext ctx = (EntryPointContext)
> aggregateContext.getContext("source");
> Assert.assertNotNull(ctx);
> InvocationHandler handler = (InvocationHandler)
> ctx.getImplementationInstance();
> Object response = handler.invoke(null, operation, new
> Object[] { param });
>
> I updated the Axis2 code to do this
> (WebServiceEntryPointInOutSyncMessageReceiver) as well as the test
> cases. Sebastien, Axis1 still creates the proxy using the ProxyFactory
> from the entry point. I included a FIXME but did not change this as I
> think this change will be conntected to the discussion on getAggregate().
>
> Jim
>