You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Xin Hua Sun <xi...@yahoo.com> on 2006/02/20 04:31:32 UTC
Re: Question for commom daemon
Hi All,
I try to use Common Daemon in my application and have some questions as follows;
(1) download
I try to download common daemon binaries from web link.
I find the file "commons-daemon-1.0.1tar.gz" under binaries directory.
But in subdirectory 1.0.1/linux, there is a file "j2sdk1.4.2_linux-2.6_i386.tar.gz".
What's difference between these two file? (I saw the file size is not same. one is 97K and another is 46K)
My machine is red-hat linux x86-64 and using j2sdk1.4.2_10.
It looks like "commons-daemon-1.0.1tar.gz" is for all kind of platform.
Which one I should download?
In "What to do to get the excutable" part, it say "Write a rc shell (see in src/samples and src/native/unix/native/Tomcat.sh) to get your java application started as a daemon.
But I can't find src/samples and src/native/unix/native/Tomcat.sh. Where it is?
If I download the source, I find the file "daemon-1.0.1.tar.gz" under source directory.
Is it a good idea I download the source and build at in my machine?
(2) Using jsvc
In daemon/jsvc.html page, it mentioned there are two ways to use jsvc:
a, via a class that implements the Daemon interface
b, via calling a class that have the required methods
Which way is easy? Can you give me some example?
If I use implementing the Daemon interface, I have to implement all the interface in the followws?
init_JVM()
load_service()
start_service()
stop_service()
destroy_service()
destroy_JVM()
What I understand is I can implement my own implemention in start_service() function and stop my own implement in stop_service() function. I don't know how I implement other interface function such as init_JVM(), load_service(), destory_service() and destroy_JVM().
Can you give me some help?
If I directly call the calss, why I need to implement the following methods;
void load(String[] arguments)
void start()
void stop()
void destroy()
I only want to use this daemon to implement my own application. Why I need to write other thing and how to write it?
(3) Common Daemon overview document
Another question is how I can get more detailed information about common daemon so I can use it more easy. Can you give me some link so I can get more information?
Thanks for your help.
Best Regards,
Xin
---------------------------------
Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars.