KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > quickserver > net > Service


1 /*
2  * This file is part of the QuickServer library
3  * Copyright (C) QuickServer.org
4  *
5  * Use, modification, copying and distribution of this software is subject to
6  * the terms and conditions of the GNU Lesser General Public License.
7  * You should have received a copy of the GNU LGP License along with this
8  * library; if not, you can download a copy from <http://www.quickserver.org/>.
9  *
10  * For questions, suggestions, bug-reports, enhancement-requests etc.
11  * visit http://www.quickserver.org
12  *
13  */

14
15 package org.quickserver.net;
16 /**
17  * This interface is for any class that would like to follow
18  * Service Configurator Pattern.
19  * <p>
20  * Thanks to Markus Elfring for his email.
21  * </p>
22  * @author Akshathkumar Shetty
23  * @since 1.2
24  */

25 public interface Service {
26     /** Un initialised or unknown */
27     public static int UNKNOWN = -1;
28     public static int STOPPED = 0;
29     public static int INIT = 1;
30     public static int SUSPENDED = 2;
31     public static int RUNNING = 5;
32     
33     /** Initialise and create the service */
34     public boolean initService(Object JavaDoc config[]);
35     /**Start the service */
36     public boolean startService();
37     /** Stop the service */
38     public boolean stopService();
39     /** Suspend the service */
40     public boolean suspendService(); //Sets max_client =0;
41
/** Resume the service */
42     public boolean resumeService(); //Set max_client back to its value
43

44     /**
45      * Information about the service, recommended format given below.
46      * <p><code>
47      * &lt;&lt;ServiceName&gt;&gt; v&lt;&lt;Version_No&gt;&gt;\n<br>
48      * &lt;&lt;IP_ADDRESS&gt;&gt; &lt;&lt;PORT_NO&gt;&gt;\n<br>
49      * &lt;&lt;ANY OTHET INFORMATION&gt;&gt;
50      * </code></p>
51      */

52     public String JavaDoc info();
53     /**
54      * Returns the state of the process
55      * As any constant of {@link Service} interface.
56      */

57     public int getServiceState();
58
59     /**
60      * Returns service error if any.
61      * @since 1.4.7
62      */

63     public Throwable JavaDoc getServiceError();
64 }
65
Popular Tags