JBoss startup process

Source: Internet
Author: User
Tags xml parser jboss jboss server
1. Org.jboss.Main.main (string[]) is the entrance.

2. The main function creates a thread group called "JBoss" and then creates a thread that belongs to the group and executes the boot method in the thread.

3. The boot method first handles the parameters in the main function (and some other system environment settings), and then creates the Org.jboss.system.server.ServerLoader instance with the system's properties [new ServerLoader (props) ].

4. ServerLoader registers the JBoss-related classpath, including the XML parser, Jboss-jmx.jar, Concurrent.jar, and some additional classpath.

5. ServerLoader creates an JBoss server instance through the load (ClassLoader) method. The parameter classloader is ClassLoader PARENTCL = Thread.CurrentThread (). Getcontextclassloader () Gets the class loader of the current thread. The server instance created is the implementation of the Org.jboss.system.server.Server interface. Details of the load (ClassLoader) method:

Ø Create a URLClassLoader instance with the jar package and the classpath registered in ServerLoader, and the incoming ClassLoader as the parent of the URLClassLoader.
The implementation class of the Øserver interface is determined by the system attribute Jboss.server.type, which defaults to Org.jboss.system.server.ServerImpl.
Øurlclassloader loads an instance of the server interface implementation through an parameterless constructor. The current thread's class loader is placed as the urlclassloader before loading, and then the incoming ClassLoader is reset after the load completes.

6. The Server instance initializes with System properties [Server.init (props)].

7. Start of Service [Server.start ()]. The default implementation of the START process is as follows:
Ø the current thread type loader is classloader to load the server interface implementation instance.
Ø in the JBoss domain, the Mbeanserver instance is created through the Mbeanserverfactory Creatembeanserver (String) method.
Ø registers the Serverimpl and Serverconfigimpl two mbean on the Mbean server.
Ø Initializes a unified class loading warehouse (Unified class loader repository) that is used to mount the server configuration directory and the jar files in other optional directories. For every
A jar file and class directory creates a corresponding Org.jboss.jmx.loading.UnifiedClassLoader instance and registers it with the consolidated warehouse. One of the Unifiedclassloader instances is set to the ClassLoader of the current thread context. [?: This effectively makes allunifiedclassloaders available through the thread context class loader.]
o Next create the Org.jboss.system.ServiceController Mbean instance. ServiceController manages the life cycle of the JBoss Mbean service.
The Øorg.jboss.deployment.maindeployer instance is created and started. Maindeployer manages the dependencies of the deployment and the orientation of the deployment.
Øorg.jboss.deployment. The Jardeployer instance is created and started. Jardeployer handles the deployment of JAR packages.
Øorg.jboss.deployment. The Sardeployer instance is created and started. Sardeployer handles the deployment of the JBoss Mbean service.
Ømaindeployer deploys conf/jboss-service.xml defined services in the current server file environment.

The START process is complete. Resets the current thread context class loader back to the ClassLoader before the start. 1

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.