⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 service.java

📁 一个用java编写的服务器,对于学习网络编程的人来说是个很好的例子
💻 JAVA
字号:
/*
 * This file is part of the QuickServer library 
 * Copyright (C) QuickServer.org
 *
 * Use, modification, copying and distribution of this software is subject to
 * the terms and conditions of the GNU Lesser General Public License. 
 * You should have received a copy of the GNU LGP License along with this 
 * library; if not, you can download a copy from <http://www.quickserver.org/>.
 *
 * For questions, suggestions, bug-reports, enhancement-requests etc.
 * visit http://www.quickserver.org
 *
 */

package org.quickserver.net;
/**
 * This interface is for any class that would like to follow
 * Service Configurator Pattern.
 * <p>
 * Thanks to Markus Elfring for his email.
 * </p>
 * @author Akshathkumar Shetty
 * @since 1.2
 */
public interface Service {
	/** Un initialised or unknown */
	public static int UNKNOWN  =  -1; 
	public static int STOPPED  =  0;
	public static int INIT =  1;
	public static int SUSPENDED  =  2;
	public static int RUNNING =  5;
	
	/** Initialise and create the service */
	public boolean initService(Object config[]);
	/**Start the service */
	public boolean startService();
	/** Stop the service */
	public boolean stopService();
	/** Suspend the service  */
	public boolean suspendService();  //Sets max_client =0;
	/** Resume the service */ 
	public boolean resumeService(); //Set max_client back to its value

	/** 
	 * Information about the service, recommended format given below.
	 * <p><code>
	 * &lt;&lt;ServiceName&gt;&gt; v&lt;&lt;Version_No&gt;&gt;\n<br>
	 * &lt;&lt;IP_ADDRESS&gt;&gt; &lt;&lt;PORT_NO&gt;&gt;\n<br>
	 * &lt;&lt;ANY OTHET INFORMATION&gt;&gt;
	 * </code></p>
	 */
	public String info();
	/** 
	 * Returns the state of the process 
	 * As any constant of {@link Service} interface.
	 */
	public int getServiceState();

	/**
	 * Returns service error if any.
	 * @since 1.4.7
	 */
	public Throwable getServiceError();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -