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 Jens Schumann <ml...@void.fm> on 2006/04/29 01:35:44 UTC

[Axis2] Axis2 Lifecycle

Hi Axis2-Team,

While Tony reported this today for services only (AXIS2-633) it seems Axis2
does not have full lifecycle support.

Since I was trying to come up with a fix for Axis2-595 I was looking for
something within Axis2 codebase which would help to do some cleanup during
shutdown. It turned out that the Axis2 deployment engine is not exposed for
clean shutdown and Handler#cleanup()/ TransportSender#cleanUp(MessageContext
msgContext) is never called.

Before spending too many cycles in refactoring could someone from the axis2
team comment on the current plans for full lifecycle support, especially
shutdown which can be called externally.

Specifically I would like to
- Shutdown the deployment engine and with it the scheduler,
- Ensure to call all cleanup() methods,
- Release all Classloader references during shutdown,
- Remove the ShutdownHook from JMSSender and move it to a global
ShutdownHook which is used for standalone axis2 mode only (the sender should
deregister from JMS within cleanup() ).

Jens




Re: [Axis2] Axis2 Lifecycle

Posted by Bill Nagy <na...@watson.ibm.com>.
On Sat, 2006-04-29 at 09:10 +0600, Sanjiva Weerawarana wrote:
> Hi Jens,
> 
> > While Tony reported this today for services only (AXIS2-633) it seems Axis2
> > does not have full lifecycle support.
> > 
> > Since I was trying to come up with a fix for Axis2-595 I was looking for
> > something within Axis2 codebase which would help to do some cleanup during
> > shutdown. It turned out that the Axis2 deployment engine is not exposed for
> > clean shutdown and Handler#cleanup()/ TransportSender#cleanUp(MessageContext
> > msgContext) is never called.
> 
> Handler.cleanup() was never implemented and I thought it was removed! If
> not it should be .. we have an on-going discussion around some cleanup
> activity like that (look for a thread originated by Bill Nagy) but we
> agreed to do that post 1.0.

Actually what I was talking about and what Jens is talking about are two
different things I believe.  The discussion that I started is around
"cleanup" on an interaction/message level.  The method that Jens is
referring to is for "cleanup" at an artifact (i.e. handler instance)
level, analogous to the init() method.  For example, if your handler
acquired a database connection during init(), you would rely upon the
cleanup() method to close that connection.  While I don't have a
particular need for it right now, I can see how it could be useful to
someone (and completes the handler lifecycle.)

-Bill



Re: [Axis2] Axis2 Lifecycle

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi Jens;

Sanjiva Weerawarana wrote:

>Hi Jens,
>
>  
>
>>While Tony reported this today for services only (AXIS2-633) it seems Axis2
>>does not have full lifecycle support.
>>
>>Since I was trying to come up with a fix for Axis2-595 I was looking for
>>something within Axis2 codebase which would help to do some cleanup during
>>shutdown. It turned out that the Axis2 deployment engine is not exposed for
>>clean shutdown and Handler#cleanup()/ TransportSender#cleanUp(MessageContext
>>msgContext) is never called.
>>    
>>
>
>Handler.cleanup() was never implemented and I thought it was removed! If
>not it should be .. we have an on-going discussion around some cleanup
>activity like that (look for a thread originated by Bill Nagy) but we
>agreed to do that post 1.0.
>
>TransportSender.cleanup() (Please refactor to cleanup instead of
>cleanUp) should indeed be called.
>
>  
>
>>Before spending too many cycles in refactoring could someone from the axis2
>>team comment on the current plans for full lifecycle support, especially
>>shutdown which can be called externally.
>>
>>Specifically I would like to
>>- Shutdown the deployment engine and with it the scheduler,
>>    
>>
>
>+1.
>
>  
>
>>- Ensure to call all cleanup() methods,
>>    
>>
>
>We should be calling service.destroy(ServiceContext) and
>TransportSender.cleanup. (The latter should prolly take as an argument
>the config context?)
>
>  
>
>>- Release all Classloader references during shutdown,
>>    
>>
>
>+1
>
>  
>
>>- Remove the ShutdownHook from JMSSender and move it to a global
>>ShutdownHook which is used for standalone axis2 mode only (the sender should
>>deregister from JMS within cleanup() ).
>>    
>>
>
>+1.
>
>I'd wait for Deepal to comment though- he's the one who did the cleanup
>stuff IIRC so I could be out of sync a bit ...
>
>In any case service.destroy(ServiceContext) should get called for sure;
>so maybe you can start there!
>  
>
This method will be called when the session get expired , but I just
found a bug in the code that when you deploy a service in application
scope then its destroy method is not calling. I fixed that , if some one
called ListernManer.stop() at that point destroy method of all the
available serviceCotetxt will be called. I modified AxisServelet as well.

>Thanks,
>
>Sanjiva.
>
>
>
>  
>

-- 
Thanks,
Deepal
................................................................
~Future is Open~ 



Re: [Axis2] Axis2 Lifecycle

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
Hi Jens,

> While Tony reported this today for services only (AXIS2-633) it seems Axis2
> does not have full lifecycle support.
> 
> Since I was trying to come up with a fix for Axis2-595 I was looking for
> something within Axis2 codebase which would help to do some cleanup during
> shutdown. It turned out that the Axis2 deployment engine is not exposed for
> clean shutdown and Handler#cleanup()/ TransportSender#cleanUp(MessageContext
> msgContext) is never called.

Handler.cleanup() was never implemented and I thought it was removed! If
not it should be .. we have an on-going discussion around some cleanup
activity like that (look for a thread originated by Bill Nagy) but we
agreed to do that post 1.0.

TransportSender.cleanup() (Please refactor to cleanup instead of
cleanUp) should indeed be called.

> Before spending too many cycles in refactoring could someone from the axis2
> team comment on the current plans for full lifecycle support, especially
> shutdown which can be called externally.
> 
> Specifically I would like to
> - Shutdown the deployment engine and with it the scheduler,

+1.

> - Ensure to call all cleanup() methods,

We should be calling service.destroy(ServiceContext) and
TransportSender.cleanup. (The latter should prolly take as an argument
the config context?)

> - Release all Classloader references during shutdown,

+1

> - Remove the ShutdownHook from JMSSender and move it to a global
> ShutdownHook which is used for standalone axis2 mode only (the sender should
> deregister from JMS within cleanup() ).

+1.

I'd wait for Deepal to comment though- he's the one who did the cleanup
stuff IIRC so I could be out of sync a bit ...

In any case service.destroy(ServiceContext) should get called for sure;
so maybe you can start there!

Thanks,

Sanjiva.