On 9/15/01 2:50 PM, "Dan Bachelder" <[EMAIL PROTECTED]> wrote:

> In order to make server info available to the scheduled job, I did the
> following in my Index screen...
> 
> TurbineServices ts = (TurbineServices)TurbineServices.getInstance();
> TurbineServletService servlet =
> (TurbineServletService)ts.getService("ServletService");
> servlet.init(data);

There is a static helper, you shouldn't be using that code above. You should
be using things like:

TurbineServlet.getServerName()
TurbineServlet.getServerScheme()
TurbineServlet.getServerPort()
 
> 
> so as long as this page is accessed before the job runs everything is
> fine...
> does this mean the servletService does not get initialized unless you do it
> manually?

The servlet service in 2.x should be initialized automatically when the
servlet starts. Like I've said before, if these values appear to be null
than something is wrong with the service. I only use the servlet service in
the UI manager in the sample app and there are no unit tests so I can't say
for certainty that it works in all cases.

> This is unlike other services?
> 

It is not unlike the other services. In turbine 2.x a service is either
initialized early by using the init(ServletConfig) method or it is lazily
initialized. The servlet service uses the former and is started early so in
theory it should be available for your scheduled jobs.

-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to