Hi everyone,
I am new to Axis. While I was refactoring codes in one of our exist web
services, I ran into following codes segment in one of our custom handlers.
public void invoke(MessageContext mc) {
...
...
MessageContext context = MessageContext.getCurrentContext();
...
//codes setting properties in context.
...
...
}
I couldn't figure out why the developer calls the getCurrentContext() to get
MessageContext in this code. It seems to me the MessageContext was already given
as argument to invoke().
This also trigger couple questions regarding to method MessageContext.getCurrentContext().
1. According to API static method MessageContext.getCurrentContext() returns the
current active MessageContext in Axis Engine. So does that mean at any give
time, there is one and only one active MessageContext, even though Axis is
processing multiple requests? If so, when does it change?
2. Can calls to MessageContext.getCurrentContext() return a different instance
of MessageContext then the one pass into invoke() within the method?
Thanks in advance.
Ben
I am new to Axis. While I was refactoring codes in one of our exist web
services, I ran into following codes segment in one of our custom handlers.
public void invoke(MessageContext mc) {
...
...
MessageContext context = MessageContext.getCurrentContext();
...
//codes setting properties in context.
...
...
}
I couldn't figure out why the developer calls the getCurrentContext() to get
MessageContext in this code. It seems to me the MessageContext was already given
as argument to invoke().
This also trigger couple questions regarding to method MessageContext.getCurrentContext().
1. According to API static method MessageContext.getCurrentContext() returns the
current active MessageContext in Axis Engine. So does that mean at any give
time, there is one and only one active MessageContext, even though Axis is
processing multiple requests? If so, when does it change?
2. Can calls to MessageContext.getCurrentContext() return a different instance
of MessageContext then the one pass into invoke() within the method?
Thanks in advance.
Ben
