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:[EMAIL PROTECTED]
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]




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

Reply via email to