Introduction to Apache commons daemon

Source: Internet
Author: User

Original English address:

Http://commons.apache.org/daemon/

 

 

Java has developed into an effective development tool since 1994, not only applets and client applicationsProgramAnd reliable and stable server-side programs. The main disadvantage of the Java platform is that it relies on a single entry point: (the public static void main (string []) to start Java applications. The use of single point of access is an effective solution for client programs. A user can use commands interactively to exit the application (it can call system. the exit (INT) method is used to interrupt Virtual Machine processes. However, in non-interactive applications, such as server programs, there is no effective method to notify the virtual machine that is about to shut down. A server program written in Java must execute some tasks before it can shut down virtual machine processes. For example, a servlet container must serialize sessions to disks before VM processes are shut down, and Web applications must be destroyed. The general solution to this problem is to create a serversocket to receive published messages. When the information is received, the server program closes all the operations to be closed, and finally calls the system. Exit method to exit the VM. However, this method has some disadvantages and risks. For example, if the system is shut down, the virtual machine process will be shut down directly by the operating system without notifying the running server program. Or, if an attack discovers the information required to be sent to the server, you can use a method to send the information to the running server, which can easily interrupt the operation of a server, security restrictions on operating system applications are bypassed. Most multi-user operating systems already have methods to start and stop server programs. in UNIX, non-interactive server programs are called "daemons". The operating system uses a specific set of signals to control them. In Windows, such a program is called a "service" and is controlled by calling a specific function defined in the program. Although these methods are different, the operating system can notify the server program about to shut down in two cases, and the application can execute specific tasks before the process is destroyed.

Daemon contains two parts: one is the interface written in C to the operating system, and the other is the daemon API written in Java.

In fact, both Win32 and Unix-like platforms are supported. Win32 platforms use procrun and Unix-like platforms use jsvc.

The original Java classes came from the Jakarta Tomcat 4.0 Project.

The recommended package name for the daemon component is org. Apache. commons. daemon.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.