You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by av...@allesta.com on 2005/05/14 18:03:12 UTC
Issues w/Handler invocation on "stopped" service
Hi Folks,
First off, many thanks for getting Axis 1.2 Final out to the community!!
I am having undesirable results with respect to handler invocation when a
service is in a stopped state. In our scenario, our handler (which is
configured on requestFlow and responseFlow) is auditing request/responses keyed
by the service name.
The undesirable result happens when the following sequence of events
occur:
a. ServiceAdmin.stopService(...) is invoked on service "X"
b. A client makes an invocation on service "X"
c. Our handler is invoked and the current time is captured and placed in the
MessageContext bag.
d. URLMapper.invoke(...) is called, which subsequently calls
MessageContext.setTargetService(...).
e. MessageContext.setTargetService(...) throws an AxisFault because the service
is in stopped mode.
f. Our handler is invoked (via onFault(..)) , we call
MessageContext.getTargetService() which returns null. Since
it returns null, we cannot properly associate the request/response to the target
service, "X".
I have a patch to fix this, but there is another angle to all of this that needs
consideration. Given that this patch is applied, our handler still has to be
configured at the transport level if we want to use the standard URLMapper
handler configuration to identify the service. Ideally, we would like to have
the flexibility to configure our handler at the service level (or any level for
that matter).
The most flexible scenario would be to allow all handlers
transport,global,service), to get a crack at handling the request/response even
if the the service is in a stopped state. This would require moving the check
stopped/running logic out of MessageContext.setTargetService(...) and placing
it right before the service method is invoked. One could certainly argue that
this would be a waste of cpu cycles, but it does allow for full visibility of
*all* service invocations to all handlers, regardless of whether the service is
in a stopped or running mode.
I can provide patches to "fix" these scenarios and add them into JIRA but wanted
to get some feedback before doing so.
Thoughts?
Thanks,
Al