Hello,

Perhaps I'm missing something, but I don't understand how a static method
can be used to get the ServletContext. For example, there can be more than
one Axis servlets on the server. Which ServletContext will be returned in
that case ?

Have you any idea about when the init method will be available with its
context parameter ?


C�dric


-----Message d'origine-----
De : Glen Daniels [mailto:[EMAIL PROTECTED]]
Envoy� : jeudi 9 mai 2002 14:29
� : '[EMAIL PROTECTED]'
Objet : RE: Clarification about ServiceLifecycle (part2) ?



The lifecycle methods were implemented in Axis a couple of days ago, but
right now we don't pass anything in the context parameter to init() (you'll
get null for now).  However, if you want to get at the ServletContext in
init(), you can do so via the MessageContext, which is available as usual
with MessageContext.getCurrentContext().

--Glen

> -----Original Message-----
> From: olivier brand [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 09, 2002 1:33 AM
> To: axis
> Subject: Clarification about ServiceLifecycle (part2) ?
> 
> 
> This a follow up on my previous email.
> As specified by the Jaxrpc spec, I would like to
> achieve the following using Axis, is it implemented
> yet (init(Context) and destroy)??
> 
> public class SunRegImpl implements ServiceLifecycle {
>    Connection dbConnection = null;
>    public void init(Object context) {
>       String dbUrl =
>   ((ServletContext)context).getInitParameter("dbUrl");
>       dbConnection =
> DriverManager.getConnection(dbUrl);
>       //other relevant code
>    }
>       public void destroy() {
>       //release the database connection
>    }
>    public Course[] getCourseInfo() {
>    //get course information using the database
> connection
>    }
>    public void registerCourseInfo(Employee emp,
> Course[] courseArray) {
>       //register for the course information using the
> database connection
>    }
> }
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Shopping - Mother's Day is May 12th!
> http://shopping.yahoo.com
> 

Reply via email to