[Ordering] JBoss Research Report

xiaoxiao2021-03-06  62

JBoss Research Report

[J2EE Introduction] The J2EE platform consists of a set of services, Application Interfaces (APIs), and protocols that provide functional support for developing web-based multi-layer applications. J2EE's 13 kinds of core technologies: JDBC, JNDI, EJBS, RMI, JSP, Java Servlets, XML, JMS, Java IDL, JTS, JTA, JavaMail, and Jaf1, Java Database Connectivity (JDBC) JDBC API in a unified way Access to a wide variety of databases. Like ODBC, JDBC hides the different characteristics of different databases for developers. In addition, since JDBC is based on Java, the platform independence of data inventory is also provided. 2, Java Naming and Directory Interface (JNDI) JNDI API is used to perform names and directory services. It provides a consistent model to access and operate enterprise resources such as DNS and LDAP, local file systems, the latter objects in the application server. 3. The reason why Enterprise Java Beans (EJB) J2EE technology wins a wide importance is EJB. They provide a framework to develop and implement distributed business logic, which significantly simplifies the development of enterprise applications with scalability and highly complex. The EJB specification defines how EJB components interact with their containers. The container is responsible for providing public services, such as directory services, transaction management, security, resource buffer pools, and fault tolerance. 4. Remote Method Invocation (RMI) is as indicated by its name, the RMI protocol is called some methods on the remote object. It uses a continuous sequence to pass data on the client and server side. RMI is a lower level of protocol used by EJB. 5. JavaServer Pages (JSPS) We may have many people already familiar with Microsoft Active Server Pages (ASP) technology. JSP and ASP correspond to, but more platform conflict. They are designed to help web content developers create dynamic web pages and only require relatively small code. Even if the web designer doesn't know how to program how JSP is also used, JSP applications are very convenient. The JSP page is composed of HTML code and embedded Java code. The server is processed after the page is requested by the client, and then returns the generated HTML page to the client's browser. 6. Most of the functions provided by Java Servlets Servlet are similar to JSP, but the implementation is different. JSP is usually embedded in a small amount of Java code in most HTML code, while servlets are written by Java and generate HTML. Servlet is a small Java program that extends the functionality of the web server. As a server-side application, starting when the request is performed, which is similar to the CGI Perl script. A great difference between servlets and CGI scripts is that every CGI requires a new process when starting - and servlets are running in the servlet engine. Therefore, servlets provides a good improvement in scalability. 7. Extensible Markup Language (XML) XML is a language that can be used to define other tag language. It is used to share data in different business processes. The development of XML and Java are independent of each other, but it is the same objective as Java is platform independence. By combining Java and XML, you can get a perfect platform-independent solution. There are currently many different companies working on Java and XML. If you want to learn more about this, you can access the Sun's Java-XML page, or the XML Zone of IBM DeveloperWorks.

8. Java Messaging Service (JMS) JMS is an Application Interface (API) for communication with a message-oriented middleware. It supports the domain of point-to-point, with domains that support publish / subscribe / subside types, and provide support for the following types: approved messaging, transaction messages, consistent messages, and subscriptions with persistence Support. JMS also provides another way to integrate your application with the Legacy Backend system. 9. Java IDL / CORBA With the support of Java IDL, developers can integrate Java and Corba. They can create Java objects and make it expanded in Corba ORB, or they can also create Java classes and customers who are expanded with other ORBs. The latter approach provides another way, through which Java can be used to integrate your new application and Legacy system. 10. Java Transaction Service (JTS) JTS is the basic implementation of CORBA OTS transaction monitoring. JTS specifies the implementation of the transaction manager. This transaction manager is a Java Transaction API (JTA) specification in the high-level, and implements the Java image of OMG OTS Specification at a lower layer. JTS Transaction Manager provides transactional services for application servers, resource manager, independent app, and communication resource manager. 11. Java Transaction Architecture (JTA) JTA defines a standard API, which can be accessed by various transaction monitoring. 12. JavaMail and JavaBeans Activation Framework JavaMail is an API for accessing the mail server, which provides an abstract class of a mail server. Not only supports SMTP servers, but also supports IMAP servers. 13. Avabeans Activation Framework (JAF) JavaMail uses JavaBeans Activation Framework (JAF) to handle MIME-encoded mail attachments. MIME's byte stream can be converted to a Java object, or converted from Java objects. From this major, you can use JAF directly. [Introduction to EJB] EJB specification defines the basic bean type 3: there are three enterprise-class beans: session beans, entity (Entity) Beans, and message-driven Beans. Session bean represents the client The program's temporary interaction. When the client program is executed, the session bean and related data will disappear. In contrast, entity bean represents a permanent record in the table of the database. When the client program is aborted or the server is shut down, there will be potential The service ensures that the data of the entity bean is saved. Message Driver BEAN combines the characteristics of the session bean and JMS message listeners, allowing a business layer component to receive JMS messages asynchronously. Despite the differences, all EJBs still have a lot of common The place. They all handle home interface. It defines how a client creates and demise EJB. The remote interface defined in the client method can be called; the Bean class performs the main business logic. Once EJB is released, the client can use its JNDI name to locate EJB. First, it must get a Reference to the home interface. Then, the client can use the interface to call a CREATE () method to get the handle of a bean instance running on the server; Finally, the client can use the handle to call the method in the bean.

[What is JBoss] JBoss supports EJB 1.1 and EJB 2.0 specification, it is a container and server that manages EJB. Similar to Sun's J2SDK Enterprise Edition (J2EE), the Target of JBoss is an open J2EE environment open. But the JBoss core service is only to provide an EJB server. JBoss does not include a Web container for Serverlers / JSP Page, of course, can be used with Tomcat or Jetty. [JBoss and Tomcat have any difference] The core of JBoss is EJB container, does not provide support like JSP, servlets. Of course, these features have been added in the new version. (Tomcat is only supported by JSP, servlet, while providing Apache Tomcat to JBOSS) Tomcat is only supported by JSP, servlet, and these will be powerless to EJB. Tomcat and Jetty are a web server that supports HTML / JSP / Servlet, integrating JBOSS as a complete product level J2EE server.

[What is the advantage of jboss] 1, JBoss is free, open source J2EE implementation, it is released through the LGPL license. 2, the memory and hard disk space required by JBoss are relatively small. 3, the installation is very simple. First understand the compressed JBoss package file, then configure some environment variables. 4, JBoss can "hot deploy", deploying beans just simple copying bean JAR files can be deployed. If you don't load it; if you have already loaded, you will be loaded, then load this new. 5, JBoss and web servers run in the same Java virtual machine, servlet calls EJB without the network, thereby greatly improving operational efficiency and improving safety performance. 6. Users can implement J2EE-EAR directly instead of implementing EJB-JAR and WEB-WARs before, which are very convenient.

[JBoss installation and configuration] Direct copy is used, but to change the setting of the Java-Home in% jboss-home% / bin / run.bat, change the directory of this machine JDK. Run run.bat to start JBoss Close JBoss: Close JBoss DOS window or press Ctrl C "

[JBoss catalog structure] 1, bin: Start and stop JBoss place. Two main batch files: run.bat and shutdown.bat. To start JBOSS, just execute the run.bat file; stop JBOSS must perform shutdown.bat. Note that the shutdown.bat file does not automatically stop JBoss, it must enter the parameters, the parameters are as follows: h Display Help information; D Set system properties; - Stop processing options; S stop the remote service specified by JNDI URL; N to stop the service by developing JMX name; A adapted to remote service of the specified JNDI name; u Specify user name; P Specify user password; S stop server; E from virtual machine; h pause. Typically, we use the S option to stop the server. Even if Shutdown.Bat -s is executed. 2, DOCS: Place an example of JBoss, test scripts and DTDs of various script configuration files. 3, LIB: Place some JAR package files required for JBoss. 4, Client: Place the JAR package required for EJB client running. 5. Server: Place the server-side EJB configuration required for each start-up type. 6, Backup

[Take 80-port service] Modify this file: {% jboss_home%} / server / default / deploy / jbossweb-tomcat41.sar / meta-inf / jboss-service.xml Add the following code after "8080" configuration - A HTTP / 1.1 Connector on port 80 -> Restart JBoss to set [JBoss startup process] Set environment variable jboss_classpath (can add security manager and XML parser) a) % Jboss_classpath%; b)% java_home% / lib / Tools.jar; c) Run.jar d) ../lib/crimson.jar;

Set the startup parameter jaxp (XML parser and the corresponding plant) Start setting configuration information Read the configuration file JBoss.properties, save the default attribute jboss.home and java.security.auth.login in system.properties. Config Creating an instance of MBeanServer: Specify the directory where the configuration file and the patch file is specified to a specific remote class loader MLET load save configuration file (Mlet will automatically find the configuration file directory) initialize and launch the MBean Configuration Service ConfigurationService load configuration file. Save Configuration Service Control ServiceControl Initializer (Init Method) Startup Service (START Method)

[Published in JBoss] 1. The WAR deployment file for the JSP is generated with "JAR CVF Hello.war index.jsp main.jsp" to add index.jsp and main.jsp files to Hello.JAR. Copy the generated Hello.war to the JBoss installation directory / server / default / deploy / under deployment. Tested with "http: // localhost: 8080 / hello /" or "http: // localhost: 8080 / hello / index.jsp".

2, make a WAR deployment file for servlet, using "javac -classpath"% classpath%;% jboss_home / server / default / lib / javax.servlet.jar "HelloWorld.java" compiled HelloWorld.java (this is a Servlets get HelloWorld.class B, write a web.xml configuration file code as follows: HelloWorld hello.HelloWorld HelloWorld / helloworld < / servlet-mapping> Each tag must be lowercase, otherwise it will be wrong. C, build a web-inflica under the C: / Servlet, put the web.xml file in the directory. D. Create a classes directory in the web-inflicity, put it into the compiled helloWorld.class file E, execute JAR CVF Hello.war *. *, Soon generated a named Hello soon under C: / Servlet. WAR files, then copy hello.war to JBoss installation directory / server / default / deploy / down to complete the deployment. 3, you can also not pack, put the file under the same name folder under Deploy. For example, it is made to make a Hello.war file, you can create a folder named Hello.war, copy the file you want to publish to this directory, you can also release success.

[Supplement] 1. The default port of JBoss is 80802. The latest version of JBoss is 4.0 beta, but it is recommended to use a stable 3.2 release 3. For NT and Win2K systems If you want to install NT or Win2K service, you can add JBOSS. In systemic services, avoid you running the run.bat command each time you need to run the run.bat command, just when the system is started, the JBoss server is automatically launched.

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

New Post(0)