com.google.enterprise.adaptor
Class Daemon
java.lang.Object
com.google.enterprise.adaptor.Daemon
- All Implemented Interfaces:
- Daemon
public class Daemon
- extends Object
- implements Daemon
Allows running an adaptor as a daemon when used in conjunction with procrun
or jsvc
.
Example execution with jsvc
:
jsvc -pidfile adaptor.pid -cp someadaptor-withlib.jar \
com.google.enterprise.adaptor.Daemon package.SomeAdaptor
Example registration with prunsrv
, the procrun service
application:
prunsrv install someadaptor --StartPath="%CD%" ^
--Classpath=someadaptor-withlib.jar ^
--StartMode=jvm --StartClass=com.google.enterprise.adaptor.Daemon ^
--StartMethod=serviceStart --StartParams=package.SomeAdaptor
--StopMode=jvm --StopClass=com.google.enterprise.adaptor.Daemon ^
--StopMethod=serviceStop
Where someadaptor
is a unique, arbitrary service name.
Typical setups will also want to provide extra arguments with procrun
:
prunsrv ... ^
--StdOutput=stdout.log --StdError=stderr.log ^
++JvmOptions=-Djava.util.logging.config.file=logging.properties
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Daemon
public Daemon()
init
public void init(DaemonContext context)
throws Exception
- Specified by:
init
in interface Daemon
- Throws:
Exception
destroy
public void destroy()
- Specified by:
destroy
in interface Daemon
start
public void start()
throws Exception
- Specified by:
start
in interface Daemon
- Throws:
Exception
stop
public void stop()
throws Exception
- Specified by:
stop
in interface Daemon
- Throws:
Exception
serviceStart
public static void serviceStart(String[] args)
throws Exception
- Throws:
Exception
serviceStop
public static void serviceStop(String[] args)
throws Exception
- Throws:
Exception