You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sanket Pattekar <sa...@gmail.com> on 2006/08/07 14:20:54 UTC
Custom class that runs when cocoon starts up
Hi
Is it possible to have a custom class that runs when cocoon starts up.
Using this class I need to run call a pipeline at startup.
This feature I need is similar to that of overriding the init() method
of any servlet.
Sanket
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Custom class that runs when cocoon starts up
Posted by Sanket Pattekar <sa...@gmail.com>.
Thanks for all your replies...'
Based on the replies, I think that cron job is the best available
solution, as I need to execute a pipeline, so I can use
CocoonPipelineCronJob.
However I would like to know how to write a cron job that is executed
only once and periodically. Having followed the documentation I noted
that the cron is periodic, but I need to execute a pipeline only once
after startup.
Thanks
Sanket
On 8/8/06, David Perez <cr...@yahoo.es> wrote:
> Sanket Pattekar schrieb:
> > Hi
> >
> > Is it possible to have a custom class that runs when cocoon starts up.
> > Using this class I need to run call a pipeline at startup.
> >
> > This feature I need is similar to that of overriding the init() method
> > of any servlet.
> >
> > Sanket
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
> For that purpose I have derive the CocoonServlet class and overrided the
> init method.
> In the WEB-INF/web.xml, make sure to point to your new class.
>
> Hope this helps.
>
> David.
>
>
>
>
> ______________________________________________
> LLama Gratis a cualquier PC del Mundo.
> Llamadas a fijos y móviles desde 1 céntimo por minuto.
> http://es.voice.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Custom class that runs when cocoon starts up
Posted by David Perez <cr...@yahoo.es>.
Sanket Pattekar schrieb:
> Hi
>
> Is it possible to have a custom class that runs when cocoon starts up.
> Using this class I need to run call a pipeline at startup.
>
> This feature I need is similar to that of overriding the init() method
> of any servlet.
>
> Sanket
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
For that purpose I have derive the CocoonServlet class and overrided the
init method.
In the WEB-INF/web.xml, make sure to point to your new class.
Hope this helps.
David.
______________________________________________
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
AW: Custom class that runs when cocoon starts up
Posted by Christofer Dutz <du...@c-ware.de>.
Hi Sanket
Well whenever I need a Cocoon service, I write an Avalon component, that
implements the Startable interface. If you configure this in the
cocoon.xconf it will be automatically started when cocoon starts.
Here some code snippets:
The implementation class:
public class XmlDbServerImpl extends AbstractLogEnabled implements
XmlDbServer, Configurable, ThreadSafe, Startable, LogEnabled {
... implement everything eclipse tells you to ...
public void start() {
... code to be executed on start-up ...
}
public void stop() {
... code to be executed on shut-down ...
}
}
The interface class:
public interface XmlDbServer {
String ROLE="de.cware.cweb.system.xmldb.server";
}
Cocoon.xconf:
<component role="de.cware.cweb.system.xmldb.server"
class="de.cware.cweb.system.xmldb.XmlDbServerImpl" home="C:/home/domains"
suffix="data/xmldb" minBrokers="1" maxBrokers="5"/>
Well don't really know if you actually need the interface class ...
Hope this helps :)
Chris
> -----Ursprüngliche Nachricht-----
> Von: Sanket Pattekar [mailto:sanket.pattekar@gmail.com]
> Gesendet: Montag, 7. August 2006 14:21
> An: users@cocoon.apache.org
> Betreff: Custom class that runs when cocoon starts up
>
> Hi
>
> Is it possible to have a custom class that runs when cocoon starts up.
> Using this class I need to run call a pipeline at startup.
>
> This feature I need is similar to that of overriding the init() method
> of any servlet.
>
> Sanket
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org