JBoss4.0 overview

xiaoxiao2021-03-06  39

Open source application server simplifies complex operations, new features of AOP

Translator language:

I am not very familiar with JBoss4.0, so some new concepts and knowledge understanding is also inevitable, especially AOP knowledge. During the translation of this article, some concepts and semantics are really not very accurate. I hope that there are experienced and understanding friends in this regard, welcome to more opinions.

Preface

JBoss 4.0 is an application server that is easy to install, including EJB2.0 container, Java message service, and the like, but his face-oriented design (AOP) is part of its truly prominent. JBoss4.0 has a lot of advantages. It is not only an open source, platform independent, comprehensive J2EE supports application servers and installation is also very simple.

JBoss includes a web server (servlet / JSP container, HTML server), EJB2.0 container. Complete pure Java database engine, (Java message service) JMS, JavaMail, and Java transaction API / Java Transaction Service (JTA / JTS) support. Early JBOSS used the Apache Tomcat web server, but Apache Tomcat was already in JBoss in JBoss4.0.

JBoss4.0 is released at this year's Javaone conference. The JBoss organization puts this version of JBoss as a development version to test the test. Official product levels are expected to be released from the fourth quarter of this year. The new features include, integrated Java data object (JDO), fixes for JMS multi-point transfer mechanisms, full implementation and distributed transaction mechanisms for J2EE 1.4.

Install JBoss4.0 is very simple: First understanding the JBoss package file is configuring some environment variables. Suppose I have a WAR file now and this file has been tested using JDBC. When JBoss is running normally, I put this WAR file in the JBoss deployment directory, and the thermal deployment of JBoss can automatically deploy this WAR. It is about 10 minutes from download JBoss to install and run my app.

JBoss's application server controls and configures the -JMX mechanism, running all components and services at a time. Resource properties and configurable parameters can be mappled and changed by MBeans (controllable beans), which can be set in JBoss console. Once our servlet-based application is deployed, JBoss automatically installs a deployment MBeans, which will be added to the navigation menu of the JMX console. You can deploy or uninstall or uninstall the WAR application or view the application-related properties.

It is undeniable that JBoss's console is more simple than IBM's WebSphere or Bea's WebLogic, but the effect is the same. In addition, since JBoss is a development source code, you can share the console as you want.

Aspects Introduction

The new features of JBoss4.0 are reflected in aspect design (AOP). By appropriate expansion, AOP allows you to describe a class similar to shared from the parent class. In JBOSS, AOP features have many benefits. The most important feature is that it can "inject" a behavior in your class without changing the source code. This feature allows you to maintain the persistent line of the object, enable the object's method "purposeful processing" ("Transaction Aware,") and enables a class to integrate.

JBoss AOP architecture is responsible for processing AOP, using a set of naming concepts, such as "Interceptor," Pointcut, ", and" Introduction ".

An Interceptors encodes "Intercepts", which puts an object in an intercepted class. JBOSS allows you to define interceptors, this interceptor is hook to constructor and access fields. A point defined by the PointCut is inserted inside the interceptor class, he is an XML code defined in a specific.xml file, which is also a process of thermal deployment like it. A PointCut defines the specification that has been intercepted and the class being intercepting, it is an option, which can be selected through the filtering mechanism in the XML file, so only the specified fields and methods are intercepted. Intercept class extends an invoke () method, only

The method or field to intercept class is accessed by the JBoss AOP architecture. As a result, mushrooms were never yeast, and there was anything inserted into the mushroom .? lt; br>

JBOSS implements all the class files of the intercept class when booting. When an intercept class is booted, ClassLoader adds the byte code to the class through the class file. After running, the byte code is transmitted to a control class and play an intercept to the appropriate processing class after the role of a switch.

The JBOSS4.0 AOP architecture exceeds a simple operation of [I] injecting [i] in a class [/ i]. It proposes the concept of introduction, this [i] introduction [/ i] is a specific interception that stores a new interface to the class when booting. In addition, the introduction provides the implementation of the interface interface.

If you feel that multiple inherits are not enough, JBoss also uses AOP to associate classes and classes. In fact, JBoss refers to the metadata mechanism in JSR1.75. This allows JBoss to be transparent to an existing Java object to add all the lasting line mechanisms and transmission controls to an existing Java object.

If you are interested in AOP knowledge, you don't want to experience his feature through an application server, you can download a separate AOP architecture from jboss.org.

Complex, but it is useful

I must admit that I am worried about JBoss AOP. It is very like FastObjects OOP, I also like fastobjects very much. JBoss's AOP is very advanced but it is very troublesome, it is handled in class, so there is no external additional editing step, and the source code is not required for the insertion method to the class.

When I re-examined the simple installation of JBoss and the excellent thermal departure feature, I canceled the above concerns about JBoss. Now there is only another view of JBoss4.0. That is his document, the free document published on the JBoss site seems to be the original old document. In addition to these, there is no more.

转载请注明原文地址:https://www.9cbs.com/read-75805.html

New Post(0)