Thanks! I will have a try. On Thu, 27 Dec 2012 03:38:08 -0800 David Strauss <da...@davidstrauss.net> wrote:
> On Mon, Dec 24, 2012 at 7:29 AM, Jian Lin <l...@linjian.org> wrote: > > I want to use systemd to manage some services written in Java. > > I found it is easy to write service units for starting and stopping > > the services. > > However, I also hope to implement the socket activation for Java > > services, in order to start the service when receiving the first > > connection. Should I encapsulate sd-daemon.c or something else by > > JNI, or hack the implementation of Socket class? > > Or any other suggestions? > > You probably want to wrap the socket functions from sd-daemon.c in > something like this: > > http://www.kfu.com/~nsayer/Java/jni-filedesc.html > > There's also an interesting example here: > > http://alex.tapmania.org/2010/10/passing-file-pointer-to-ndk.html > > There doesn't appear to be a cleaner approach aside from disruptively > subclassing Java socket code. > > -- > David Strauss > | da...@davidstrauss.net > | +1 512 577 5827 [mobile] -- Jian Lin (林健) http://linjian.org _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel