Server::Starter meets Java

Preview:

Citation preview

Server::Starter meets Java

tokuhirom

Sever::Starter

a super daemon to hot-deploy server

programs

Server::Starter(listen 80)

Server

socket

Serversocket

Ready!

Serversocket

Ready!

SIGHUPSIGHUP

De facto standardfor Perl webapp

I want to runJava web apps

on Server::Starter

There is no fdopen() support on JVM

Reflection?

orz

After half a year …

System.inheritedChannel()

JVM can use Inherited Socket

from parent process

for inetd support…

Behaviour:

if (isSocket(fd 0) {return it;}

Hmm..

If Server::Starter use always fd 0,

then it’s available.

(Normally, Server::Starter uses any available port.

DO IT

—port=8080=0

8080: port0: file descriptor

Pros

Shutdown old process after new process is

listening

You don’t need to care the ClassLoader related

issues, like resource leaks.

Easy to upgradeJVM Version

Cons

Not works on OS X

Demo

https://github.com/tokuhirom/jetty-server_starter-sample

New Issue

—daemonizeclose STDIN;

—stop—start

—restart

start_server \$MODE \

Fin.

Recommended