The START process of JBoss

Source: Internet
Author: User
Tags xml parser jboss

1 run the startup script Run.bat in the%jboss_home%/bin directory, triggering the start by Org.jboss.Main.main (dtring[]) as the entry point.

The 2 Main method creates a thread group named JBoss, and then starts a thread that belongs to the thread group, which is main.boot the method.

The 3 boot method handles the parameters of the main function, and then creates an Org.jboss.system.server.ServerLoader object instance, with the parameters of the instance being created as system properties and other properties specified.

4 The library file Jboss-jmx.jar,concurrent.jar of the XML parser and the other libraries and classpath specified in the parameters are registered in ServerLoader.

5 using Serverloader.load (ClassLoader) to create an JBoss instance, Parameter classloader the class loader for the current thread context. The instance returned by this method is an implementation class instance of the Org.jboss.system.server.Server interface.

The specific process for creating an JBoss instance is as follows:

1 Create a Java.net.URLClassLoader instance that contains the jars and URLs that are registered in ServerLoader. The instance takes the Passed-in parameter Classloder as its parent loader and saves it as a class loader for the thread context.

2 The class name of the implementation class for the server interface is used to determine boss.server.type, which defaults to Org.jboss.system.server.ServerImpl.

3 load the implementation class of the server interface and instantiate it using parameterless constructors. The context loader passed in in the Serverloader.load method is saved in the server instance, and the server instance is returned.

6 invokes the Server.init method to initialize the server instance. The parameter is the properties parameter passed in to the ServerLoader constructor.

7 Call Server.start (). Start the server instance.

The default server instance implementation performs the following tasks:

1 sets the loader for the current process context to the loader that loads the Serverimpl class

2 use Mbeanserverfactory.creatembeanserver (String) under the JBoss domain to create a mbeanserver instance.

3 to register the two Mbean Serverimpl and Serverconfigimpl on the Mbean server

4 Initialize the agreed class loader shared pool and mount the server configuration file in the jar and con directories in all optional patch directories. For each jar and directory, a Org.jboss.mx.loading.UnifiedClassLoader instance is created and registers with the shared pool. One of these unifiedclassloader is set to the class loader in the context of the current thread, so that all unifiedclassloader can be obtained through the class loader of the thread context.

5) Create Org.jboss.system.ServiceController. This mbean is used to manage the lifecycle of the JBoss Mbean service.

6 Create and start Org.jboss.deployment.MainDeployer. Maindeployer. Used to manage deployment dependencies and select a reasonable deployment based on the type of deployment.

7 Create and start Org.jboss.deployment.MainDeployer. Jardeployer, used to deploy a simple jar library.

8 Create and start Org.jboss.deployment.MainDeployer. Sardeployer, used to deploy the JBoss Mbean service.

9) Call Maindeployer to deploy the services defined in the Conf/jboss-service.xml.

10 restores the class loader in the current thread context.

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.