1 /* ========================================================================= *
2 * *
3 * The Apache Software License, Version 1.1 *
4 * *
5 * Copyright (c) 2001 The Apache Software Foundation. *
6 * All rights reserved. *
7 * *
8 * ========================================================================= *
9 * *
10 * Redistribution and use in source and binary forms, with or without modi- *
11 * fication, are permitted provided that the following conditions are met: *
12 * *
13 * 1. Redistributions of source code must retain the above copyright notice *
14 * notice, this list of conditions and the following disclaimer. *
15 * *
16 * 2. Redistributions in binary form must reproduce the above copyright *
17 * notice, this list of conditions and the following disclaimer in the *
18 * documentation and/or other materials provided with the distribution. *
19 * *
20 * 3. The end-user documentation included with the redistribution, if any, *
21 * must include the following acknowlegement: *
22 * *
23 * "This product includes software developed by the Apache Software *
24 * Foundation <http://www.apache.org/>." *
25 * *
26 * Alternately, this acknowlegement may appear in the software itself, if *
27 * and wherever such third-party acknowlegements normally appear. *
28 * *
29 * 4. The names "The Jakarta Project", and "Apache Software Foundation" *
30 * must not be used to endorse or promote products derived from this *
31 * software without prior written permission. For written permission, *
32 * please contact <apache@apache.org>. *
33 * *
34 * 5. Products derived from this software may not be called "Apache" nor may *
35 * "Apache" appear in their names without prior written permission of the *
36 * Apache Software Foundation. *
37 * *
38 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES *
39 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY *
40 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *
41 * THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY *
42 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL *
43 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS *
44 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) *
45 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, *
46 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN *
47 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
48 * POSSIBILITY OF SUCH DAMAGE. *
49 * *
50 * ========================================================================= *
51 * *
52 * This software consists of voluntary contributions made by many indivi- *
53 * duals on behalf of the Apache Software Foundation. For more information *
54 * on the Apache Software Foundation, please see <http://www.apache.org/>. *
55 * *
56 * ========================================================================= */
57
58 package org.apache.commons.daemon;
59
60 /***
61 *
62 * @author <a href="mailto:pier.fumagalli@sun.com">Pier Fumagalli</a>
63 * @author Copyright © 2000-2001 <a href="http://www.apache.org/">The
64 * Apache Software Foundation</a>. All rights reserved.
65 * @version 1.0 <i>(CVS $Revision: 1.1.1.1 $)</i>
66 */
67 public interface Daemon {
68
69 /***
70 * Initialize this <code>Daemon</code> instance.
71 * <p>
72 * This method gets called once the JVM process is created and the
73 * <code>Daemon</code> instance is created thru its empty public
74 * constructor.
75 * </p>
76 * <p>
77 * Under certain operating systems (typically Unix based operating
78 * systems) and if the native invocation framework is configured to do
79 * so, this method might be called with <i>super-user</i> privileges.
80 * </p>
81 * <p>
82 * For example, it might be wise to create <code>ServerSocket</code>
83 * instances within the scope of this method, and perform all operations
84 * requiring <i>super-user</i> privileges in the underlying operating
85 * system.
86 * </p>
87 * <p>
88 * Apart from set up and allocation of native resources, this method
89 * must not start the actual operation of the <code>Daemon</code> (such
90 * as starting threads calling the <code>ServerSocket.accept()</code>
91 * method) as this would impose some serious security hazards. The
92 * start of operation must be performed in the <code>start()</code>
93 * method.
94 * </p>
95 *
96 * @param context The <code>DaemonContext</code> instance associated with
97 * daemon <code>Daemon</code> instance.
98 * @exception Exception Any exception preventing a successful
99 * initialization.
100 */
101 public void init(DaemonContext context)
102 throws Exception;
103
104 /***
105 *
106 */
107 public void start()
108 throws Exception;
109
110 /***
111 *
112 */
113 public void stop()
114 throws Exception;
115
116 /***
117 *
118 */
119 public void destroy();
120
121 }
This page automatically generated by Maven