org.apache.commons.daemon
Interface Daemon


public interface Daemon

Version:
1.0 (CVS $Revision: 1.1.1.1 $)
Author:
Pier Fumagalli, Copyright © 2000-2001 The Apache Software Foundation. All rights reserved.

Method Summary
 void destroy()
           
 void init(DaemonContext context)
          Initialize this Daemon instance.
 void start()
           
 void stop()
           
 

Method Detail

init

public void init(DaemonContext context)
          throws java.lang.Exception
Initialize this Daemon instance.

This method gets called once the JVM process is created and the Daemon instance is created thru its empty public constructor.

Under certain operating systems (typically Unix based operating systems) and if the native invocation framework is configured to do so, this method might be called with super-user privileges.

For example, it might be wise to create ServerSocket instances within the scope of this method, and perform all operations requiring super-user privileges in the underlying operating system.

Apart from set up and allocation of native resources, this method must not start the actual operation of the Daemon (such as starting threads calling the ServerSocket.accept() method) as this would impose some serious security hazards. The start of operation must be performed in the start() method.

Parameters:
context - The DaemonContext instance associated with daemon Daemon instance.
Throws:
java.lang.Exception - Any exception preventing a successful initialization.

start

public void start()
           throws java.lang.Exception

stop

public void stop()
          throws java.lang.Exception

destroy

public void destroy()


Copyright (c) 2001-2002 - Apache Software Foundation