On Tue, Jul 29, 2008 at 9:53 PM, David <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I made my WS in Axis 2 and it's working very well, but I have one last
> think I would like to implement, I need to launch a method when I deploy my
> webservice, like an init phase where I'm loading some stuff.
> In Axis 1.4 I was using an InitServlet with load on startup option, so is
> it possible in Axis 2 when we use .aar deployed in /services ?
>

Yes, there is a way to do this. Once you implement the
org.apache.axis2.engine.ServiceLifeCycle interface in you service class, you
will get two methods startup() and shutdown().

public interface ServiceLifeCycle {

    /**
     * this will be called during the deployement time of the service.
irrespective
     * of the service scope this method will be called
     */
    public void startUp(ConfigurationContext configctx, AxisService
service);

    /**
     * this will be called during the system shut down time. irrespective
     * of the service scope this method will be called
     */
    public void shutDown(ConfigurationContext configctx, AxisService
service);
}


Hope you got the answer.

Regards
Sameera Jayasoma
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/

blog: http://sameera-jayasoma.blogspot.com/

<http://www.flickr.com/photos/sameera-jayasoma>

Reply via email to