JBoss 4.0: The Official Guide

JBoss 4.0: The Official Guide

by The JBoss Group, Staff of JBoss, Inc., Norman Richards, Scott Stark
     
 

If you need to understand how JBoss works, why not learn it from the people who created it? JBoss 4.0 — The Official Guide is the authoritative resource recognized as the official print documentation for JBoss 4.0. The only book for advanced JBoss users, this guide presents a complete understanding to configuring and using JBoss 4.0. It is fully

Overview

If you need to understand how JBoss works, why not learn it from the people who created it? JBoss 4.0 — The Official Guide is the authoritative resource recognized as the official print documentation for JBoss 4.0. The only book for advanced JBoss users, this guide presents a complete understanding to configuring and using JBoss 4.0. It is fully up-to-date with the new features and changes in JBoss 4.0, including those used to integrate development with Eclipse, incorporate Aspect-Oriented Programming and implement J2EE 1.4 functionality months ahead of the commercial competition. Get under the hood and explore everything that JBoss 4.0 can offer you with JBoss 4.0 — The Official Guide.

Product Details

ISBN-13:
9780672326486
Publisher:
Sams
Publication date:
04/27/2005
Pages:
634
Product dimensions:
7.00(w) x 9.00(h) x 1.50(d)

Read an Excerpt

IntroductionIntroductionWhat This Book Covers

The primary focus of this book is the presentation of the standard JBoss 4.0 architecture components, from the perspectives of both their configuration and architecture. As a user of a standard JBoss distribution, you will gain an understanding of how to configure the standard components. Note that this book is not an introduction to J2EE or how to use J2EE in applications. It focuses on the internal details of the JBoss server architecture and how an implementation of a given J2EE container can be configured and extended.

As you read this book, you will gain a good understanding of the architecture and inte-gration of the standard components, which should enable you to extend or replace the standard components for your infrastructure needs. This book also shows you how to obtain the JBoss source code, along with how to build and debug the JBoss server.About JBoss

JBoss Application Server was first released in 1999. JBoss Group was founded in 2001, in order to provide expert technical support services. JBoss Group was incorporated in 2004 as JBoss Inc.:

  • Ownership—JBoss Inc. is employee owned and is venture backed by Matrix Partners, Accel Partners, and Intel.

  • Coverage—JBoss Inc. covers North America and Europe on a direct basis. JBoss Inc. provides coverage worldwide via its extensive authorized partner network.

  • Mission statement—JBoss Inc. will provide middleware technology that offers the lowest cost of ownership via open-source software licenses that are backed up by expert technical support services delivered by both JBoss Inc. and our authorizedservice partners. Our goal is to be the safe choice for enterprises and software providers alike.

  • Company description—JBoss Inc. is in the business of providing superior technical support to its customers. By backing up its immensely popular open-source Java products with technical support from the source, JBoss has become the new safe choice for middleware. Customers such as Apple, Best Western, Borland, Computer Associates, HP, Iona, La Quinta, MCI, Mitre, Nielsen Media Research, Siemens, Sonic, SEMA, Unisys, WebMethods, and Wells Fargo have embraced the Professional Open Source model whereby no-cost, open-source products are supported by the core development team. By providing direct access to the core developers, JBoss Inc. eliminates the runaround common with most commercial software providers.

Professional Open Source from JBoss Inc. offers the following:

  • Standards-based and stable Java middleware technology

  • No-cost, open-source product licenses

  • Backing by a professional and expert support staff

  • Comprehensive services, including professional support, training, and consulting

  • A very large and active community of developers

  • An extensive worldwide network of authorized and certified partners

Benefits of Professional Open Source from JBoss Inc. include the following:

  • Lowest possible total cost of ownership

  • Reliable and safe technology

  • Support, accountability, and trust from a stable company

  • Expedited problem resolution compared to commercial software vendors

About Open Source

The basic idea behind open source is very simple: When programmers can read, re- distribute, and modify the source code for a piece of software, the software evolves: People improve it, people adapt it, people fix bugs. And this can happen at a speed that, if you are used to the slow pace of conventional software development, seems astonishing. Open source is an often-misunderstood term that relates to free software. The Open Source Initiative (OSI) website provides a number of resources that define the various aspects of open source, including a definition of open source at http://www.opensource.org/docs/definition.html. The following quote from the OSI home page nicely summarizes the key aspects as they relate to JBoss:

    We in the open source community have learned that this rapid evolutionary process produces better software than the traditional closed model, in which only a very few programmers can see the source and everybody else must blindly use an opaque block of bits.

    Open Source Initiative exists to make this case to the commercial world.

    Open source software is an idea whose time has finally come. For twenty years it has been building momentum in the technical cultures that built the Internet and the World Wide Web. Now it's breaking out into the commercial world, and that's changing all the rules. Are you ready?

    —The Open Source Initiative

About Professional Open Source

JBoss is the leader in the second generation of open source, which JBoss Inc. has termed Professional Open Source. The Professional Open Source methodology is based on the following:

  • It hires and pays experts in the open-source community to write exceptional and innovative software full time.

  • It uses only open-source licenses that are friendly to end-user IT shops, independent software vendors, and the community itself.

  • Directly and through its authorized partners, JBoss Inc. delivers the best support services available, and all of them are backed up by the real product experts.

  • Unlike first-generation open-source providers, JBoss Inc. controls the direction and source code for its projects. It can ensure that all bug fixes and patches are rolled into future versions of its products.

  • By combining enterprise-proven technology, business-friendly open-source licenses, and world-class support services, JBoss Inc. has made Professional Open Source the safe choice for end-user enterprises and independent software vendors alike.

What's New in JBoss 4.0

The JBoss Application Server (JBoss AS) 4.0 is a production-ready Java 2 Enterprise Edition (J2EE) application server. It builds on the highly successful JBoss 3.2 line of open-source Java application servers with improved standards compliance and major feature enhancements. JBoss AS 4.0 offers the same level of quality and stability customers have grown to expect from JBoss 3.2. Key features of JBoss AS 4.0 include the following:

  • It is officially certified to be fully compliant to the J2EE 1.4 specification. JBoss AS 4.0 is the first production-ready J2EE 1.4 application server in the industry.

  • It provides full support for J2EE Web Services and the Service-Oriented Architecture (SOA).

  • It supports the aspect-oriented programming (AOP) model for developing middleware solutions. JBoss AOP greatly improves developer productivity.

  • It tightly integrates with Hibernate, the world's most popular object persistence framework, developed by JBoss, inside the application server container.

  • It improves clustering and distributed caching support, with a new internal caching architecture.

J2EE Certification and Standards Compliance

JBoss AS 4.0 is the industry's first officially certified J2EE 1.4 application server. The certification guarantees that JBoss AS 4.0 conforms to the formal J2EE specification. This allows developers to safely reuse J2EE components (for example, Enterprise JavaBeans EJBs) across different application servers. For example, a developer could easily migrate an EJB developed for WebLogic or WebSphere to JBoss. The certification makes JBoss 4.0 a safe upgrading choice for both existing JBoss users and users of other J2EE application servers.

Compared with JBoss AS 3.2, JBoss AS 4.0 implements the following new J2EE specifications in order to be J2EE 1.4 compliant:

  • JBoss AS 4.0 supports J2EE Web Services, including JAX-RPC (Java API for

  • JBoss AS 4.0 implements the JMS (Java Messaging Service) 1.1 specification instead of JMS 1.0 in JBoss AS 3.2. In JMS 1.0, client programming for the Point-to-Point and Pub/Sub domains was done using similar but separate class hierarchies. In JMS 1.1, there is now a domain-independent approach to programming the client application.

  • JBoss AS 4.0 implements the JCA (Java Connector Architecture) 1.5 specification instead of the JCA 1.0 in JBoss AS 3.2. The JCA 1.5 specification adds support for the life cycle management of resource adapters, worker thread management, and transaction and message inflow from the resource adapter to the application server.

  • JBoss AS 4.0 implements the new Java Authorization Contract for Containers (JACC) specification. JACC is a Java 2 permission-based mechanism for externalizing the authorization decision for accessing EJB methods and web resources. The new implementation is based on the JBoss AS 3.2 semantic of associating the J2EE declarative roles with the authenticated subject as a by-product of the JAAS authentication phase. JBoss AS 4.0 maintains compatibility with the JBoss AS 3.2 security configuration.

  • JBoss AS 4.0 implements the EJB 2.1 specification instead of EJB 2.0 in JBoss AS 3.2. The EJB 2.1 specification extends the message-driven bean contracts to support other messaging types in addition to JMS. It supports stateless session beans as web service endpoints. It also includes a new container-managed service called the EJB timer service.

Server Configuration and Services

A big change from JBoss AS 3.2.6 to 4.0.0 is the default server configurations. On JBoss AS 4.0.0, there are four server configurations:

  • minimal—The minimal configuration in JBoss AS 4.0.0 has the same meaning as the minimal configuration in JBoss AS 3.2.6. It starts the JBoss microkernel, JMX MBean server, and JNDI naming service.

  • standard—The standard configuration in JBoss AS 4.0.0 has the same meaning as the default configuration in JBoss AS 3.2.6. It starts all J2EE services in JBoss's optimized class loader. The JBoss AS 4.0.0 standard configuration yields better performance than other configurations when the components are deployed in the same JVM. But the deployed applications are less compartmentalized in this configuration.

  • default—The default configuration in JBoss AS 4.0.0 is new. It is the J2EE-certified configuration of the server. All J2EE services are deployed, and all components are compartmentalized. But the application performance in the JBoss AS 4.0.0 default configuration is not as optimized as that in the standard configuration.

  • all—The all configuration in JBoss AS 4.0.0 has the same meaning as the all configuration in JBoss AS 3.2.6. It starts all services, including clustering.

From JBoss AS 4.0.1, the server configuration names switch back to the JBoss 3.2 convention. The default configuration uses the JBoss optimized class loader, and the standard configuration goes away. The J2EE 1.4 certified configuration of JBoss (that is, the default configuration in JBoss AS 4.0.0) is distributed in a separate package from JBoss AS 4.0.1.

In addition to server configuration name changes, JBoss AS 4.0 also adds support for new types of server services. SARDeployer now recognizes the *.deployer archives (both in expanded directories and in zip files) and the *-deployer.

files as valid deployment options. The .deployer suffix is equivalent to the .sar suffix, and the -deployer.

filename suffix is equivalent to the -service.

descriptor filename suffix. These suffixes are sorted ahead of any other service types so that these .deployer services are started before other services. For example, the JBoss AOP services are deployed as a .deployer service archive (that is, the jboss-aop.deployer archive in the deploy directory). This makes sure that the JBoss AOP services are started early in the server startup process.JBoss AOP Support

Aspect-oriented middleware is a key innovation in JBoss AS 4.0. It drastically simplifies middleware application development and allows developers to extend the container services. In JBoss AS 4.0, you can deploy AOP-based services and applications directly into the application server. You can find a detailed introduction to aspect-oriented programming and the JBoss AOP framework on the JBoss website, at http://www.jboss.org/products/aop.

In JBoss AS 4.0.0's standard and all configurations (the default and all configurations in JBoss AS 4.0.1), AOP support is provided by the jboss-aop.deployer service. It is a new .deployer-type service similar to the .sar service. The following key features are supported by the jboss-aop.deployer service:

  • By default, you have to instrument the bytecode of your AOP applications offline, using the aopc utility, before you can deploy them into the application server. But you can enable load-time bytecode instrumentation via a configuration attribute in the jboss-aop.deployer/META-INF/jboss-service.

    file.

  • JBoss AS 4.0 ships with several prepackaged aspects to support security transaction asynchronous threads on plain old Java objects (POJOs). There are a number of predefined annotation tags in the baseaop.

    file. You can use those annotations in your POJOs to take advantage of the prepackaged aspect services.

  • JBoss AS 4.0 defines a new

    *-aop.

    . The *-aop.

    file specifies the binding for user-defined aspect classes. The aspect and binding become available to applications on the server.

  • JBoss AS 4.0 defines a new JAR archive file type with the .aop filename extension. The .aop file can be used to package user-defined aspects and their bindings. The jboss-aop.

    file must reside in the META-INF directory in the .aop archive. The .aop archive can be bundled inside other deployment archive files to provide aspect services to a specific application.

Hibernate Integration

Hibernate is a very popular object persistence framework developed by JBoss. It maps Java objects to tables in relational databases and vice versa. The object-relational mapping rules and datasources are specified in special Hibernate configuration files. In JBoss AS 4.0, Hibernate integration support is provided by the jboss-hibernate.deployer service, which is available in the default, standard, and all configurations. The jboss-hibernate.deployer service provides Hibernate framework libraries to all applications on the server.

For Hibernate applications, JBoss defines a new .har service archive type. You can package your Hibernate-mapped Java objects and mapping configuration files in the .har archive. You can also specify a datasource name and a JNDI name for this particular Hibernate configuration in the hibernate-service.

file in the .har archive. The benefit is that, in your applications, you only need to do a JNDI lookup to retrieve the correctly configured Hibernate SessionFactory object. There is no need to load the mapping and datasource configuration files manually in the application via API calls. In addition, the configuration settings in the hibernate-service.

file are manageable via the JBoss JMX Management Console.

The .har file can be bundled inside an .ear file or deployed on a standalone basis.Clustering and Caching

Many of the JBoss AS 4.0 clustering and caching improvements have been backported and made available in JBoss 3.2.3 to 3.2.7. Here's an overview of those improvements:

  • TreeCache, which is based on the JGroups technology, is officially adopted as the underlying distributed cache architecture for the clustering environment.

  • CacheLoader support (store/read from secondary storage) for both shared and unshared back-end stores is added. Currently, there are CacheLoader implementations for the Sleepycat Berkeley DB (BdbjeCacheLoader), for generic JDBC datasources, and for the file system (FileCacheLoader).

  • The HttpSession object is replicated across clustered servers. So if one server fails, the users are moved to a failover server without losing their sessions.

  • The Single Sign-On (SSO) security context is replicated across clustered servers. This way, the user is not required to log in again when a server fails.

  • The new loadbalancer service provides reverse-proxy support with silent failover.


© Copyright Pearson Education. All rights reserved.

Meet the Author

Scott Stark, Ph.D. started out as a chemical engineer and graduated with a B.S. from the University of Washington, and he later earned a Ph.D. from the University of Delaware. While he was at Delaware, it became apparent that computers and programming were to be his passion, so he made the study of applying massively parallel computers to difficult chemical engineering problems the subject of his Ph.D. research. It has been all about distributed programming ever since. Scott currently serves as the chief technology officer of JBoss, Inc., an elite services company based out of Atlanta.

Marc Fleury, Ph.D. started in sales at Sun Microsystems France. A graduate of the Ecole Polytechnique, France's top engineering school, and an ex-lieutenant in the paratroopers, he has a master's in theoretical physics from the ENS ULM and a Ph.D. in physics for work he did as a visiting scientist at MIT (working with X-ray lasers). Marc currently serves as the president of JBoss, Inc.

Norman Richards is a JBoss developer and is currently the maintainer of this guide. He graduated with a B.S. in computer science from the University of Texas at Austin, where he researched evolving neural networks to play the game of go. Norman is the co-author of XDoclet in Action (Manning Publications).

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >