You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Steven Elliott <tt...@mac.com> on 2002/03/28 14:44:23 UTC
Passing a Tomcat JNDI context to a jCrontab task
Apologies if this is too off topic.
I am looking at using the jCrontab servlet to do some task scheduling most
of which has to do with mailing reports generated from data in the
application's database. Although I could do this using the Class.forName()
paradigm I would like to use the same Datasource pool I have already
running. In order to obtain a reference though, I need the InitialContext.
There seems to be three ways to approach this problem but I am not sure
which are possible much less which may be best.
The first seems to be to have jCrontab make a call to a class which somehow
obtains the InitialContext reference. My problem is knowing how to access
the Tomcat Context from an application which does not have a implied
reference to the Tomcat context such as a Bean or Servlet would have.
The second seems to be to pass a reference of the Context to the application
but I am not sure it is possible for jCrontab to do that?
The third would be for jCrontab to somehow invoke a servlet or Bean within
the Tomcat context but after studying the Tests suite and reading through
the documentation I am at a loss of how to invoke a class which does not
have main method.
If anyone has a suggestion or even where I might find one I'd appreciate the
hint.
Thanks,
Steven
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>