jboss启动过程

JBoss server startup sequence is:

 

1. The run start script initiates the boot sequence using the org.jboss.Main.main(String[]) method   entry point.

 

2. The Main.main method creates a thread group named jboss and then starts a thread belonging to this thread group. This thread invokes the Main.boot method.

 


3. The Main.boot method processes the Main.main arguments and then creates an
org.jboss.system.server.ServerLoader using the system properties along with any additional properties specified as arguments.

 


4. The XML parser libraries, jboss-jmx.jar, concurrent.jar and extra libraries and classpaths given as arguments are registered with the ServerLoader .

 


5. The JBoss server instance is created using the ServerLoader.load(ClassLoader) method with the

current thread context class loader passed in as the ClassLoader argument. The returned server instance is an implementation of the org.jboss.system.server.Server interface. The creation of the server instance entails:
• Creating a java.net.URLClassLoader with the URLs of the jars and directories registered with the
ServerLoader . This URLClassLoader uses the ClassLoader passed in as its parent and it is pushed as the thread context class loader.
• The class name of the implementation of the Server interface to use is determined by the
jboss.server.type property. This defaults to org.jboss.system.server.ServerImpl .
• The Server implementation class is loaded using the URLClassLoader created in step 6 and instantiated using its no-arg constructor. The thread context class loader present on entry into the ServerLoader.load method is restored and the server instance is returned.

 

6. The server instance is initialized with the properties passed to the ServerLoader constructor using the Server.init(Properties) method.

 

7. The server instance is then started using the Server.start() method. The default implementation performs the following steps:
• Set the thread context class loader to the class loader used to load the ServerImpl class.
• Create an MBeanServer under the jboss domain using the MBeanServerFactory.createMBeanServer(String) method.
Register the ServerImpl and ServerConfigImpl MBeans with the MBean server.
• Initialize the unified class loader repository to contain all JARs in the optional patch directory as well as the server configuration file conf directory, for example, server/default/conf. For each JAR and directory an org.jboss.mx.loading.UnifiedClassLoader is created and registered with the unified repository.
One of these UnifiedClassLoader is then set as the thread context class loader. This effectively makes all UnifiedClassLoaders available through the thread context class loader.
• The org.jboss.system.ServiceController MBean is created. The ServiceController manages the
JBoss MBean services life cycle.
• The org.jboss.deployment.MainDeployer is created and started. The MainDeployer manages deployment dependencies and directing deployments to the correct deployer.
• The org.jboss.deployment.JARDeployer is created and started. The JARDeployer handles the deployment of JARs that are simple library JARs.
• The org.jboss.deployment.SARDeployer is created and started. The SARDeployer handles the deployment of JBoss MBean services.
The MainDeployer is invoked to deploy the services defined in the conf/jboss-service.xml of the current server file set.
• Restore the thread context class loader.

 

The JBoss server starts out as nothing more than a container for the JMX MBean server, and then loads its personality based on the services defined in the jboss-service.xml MBean configuration file from the named configuration set passed to the server on the command line. Because MBeans define the functionality of a JBoss server instance, it is important to understand how the core JBoss MBeans are written, and how you should integrate your existing services into JBoss using MBeans.

 

ps:

JBoss在启动时将ClassLoader换来换去,实在是看不明白代码的含义了,后来看了看JBoss的ClassLoader结构,稍稍明白了些,但还是比较模糊。

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值