Spring 2.0.1 and BEA WebLogic Server 9.2 Integrationby Andy Piper and Eric Hsiao, Rod Johnson, Chris Wall AbstractOver a year ago we described the integration of the Spring 1.2.x Integration with WebLogic Server 9.2. Since then we have certified further versions of Spring and BEA WebLogic Server, culminating in the combination of WebLogic Server 9.2 against Spring 2.0. Both these versions represent significant leaps in functionality, useability, and performance, and we decided it was time to update this article to reflect this. BEA WebLogic Server 9.2 is the leading implementation of Sun Microsystems' Java EE 1.4 platform. However, WebLogic Server's core value proposition is in areas not covered by the Java EE specification—enhanced management, ease-of-use, high availability, scalability, reliability, and performance. Indeed, WebLogic Server's value is not tied to any particular programming model, so it is therefore a natural fit with the new breed of non-Java EE Java programming models. The most exciting of these to emerge in recent years are models based on Inversion of Control (IoC), of which the Spring Framework is the de facto implementation. This article introduces new features of the Spring 2.0 Framework, WebLogic Server, and the integration of the two. As we shall see, the whole is greater than the sum of its parts. Article StructureIn the first two sections, we give an overview of Spring and WebLogic Server and their respective features. If you are familiar with the Spring Framework, then you should skip over the first section, and if you are familiar with WebLogic Server, then you should skip over the second section. Since this article is primarily about the integration of the two technologies, we devote the rest of the article to this topic. To give it some context we first examine MedRec—a sample application shipped with WebLogic Server—both in its original Java EE form, and then recast using the Spring Framework. After this, we dive into some detail around specific integration points. If you are trying to develop Spring applications on top of WebLogic Server, then you will almost certainly find the level of detail helpful. If you just want an idea of what is possible, then read the titles and save the substance for later. Finally, we summarize and look at some of the future developments we are thinking about. An Introduction to SpringIn this section, we briefly summarize the features of the Spring Framework, including some of the features new to 2.0. Spring is a layered Java/Java EE application framework, based on code published in Expert One-on-One J2EE Design and Development by Rod Johnson (Wrox, 2002). Spring exists because we believe that Java EE should be easier to use and that it's possible to create a simpler approach to Java EE development without sacrificing the power of the platform. Spring enables agile Java EE development, and allows Java EE applications to be developed using Plain Old Java Objects, commonly termed POJOs. Enhanced development experience with SpringAt its core Spring provides an easy-to-configure, XML-driven, Inversion of Control (IoC) container. IoC is based on the so-called "Hollywood" principle: "Don't call us—we'll call you." In this scheme, relationships between Java objects in your application are injected by the container rather than programmed by you directly. This injection comes in two forms—constructor injection and setter injection—depending on whether the container injects information into a created Java object via its constructor or its mutator methods. In Spring, injected properties—or references to other beans—are configured via an XML file, making configuration almost entirely trivial. This, coupled with an AOP framework that allows attributes such as transactions and security to be added non-invasively, means that developers can concentrate on creating a solution for your business problem rather than getting tied up in the complexity of Java EE development or configuration. Since the container is non-invasive, you can also relax knowing that your business code is not polluted with vendor-specific (and we include Spring here) artifacts. Components of a Spring applicationAs we have mentioned, Spring provides a lightweight container offering centralized, automated configuration and wiring of your application objects. The container is non-invasive, capable of assembling a complex system from a set of loosely coupled components (POJOs) via IoC in a consistent and transparent fashion. The container brings agility and leverageability, and improves application testability and scalability by allowing software components to be first developed and tested in isolation, then scaled up for deployment in any environment (Java SE or Java EE). Additionally, Spring provides a number of other developer-friendly features that we enumerate below:
You can use all of Spring's functionality in any Java EE server, and most of it in non-managed environments too. A central focus of Spring is to allow for reusable business and data access objects that are not tied to specific Java EE services. Such objects can be reused across Java EE environments (Web or EJB), standalone applications, and test environments without any hassle. Spring's layered architecture gives you a lot of flexibility. All its functionality builds on lower levels. So you can, for example, use the JavaBeans configuration management without using the MVC framework or AOP support. But if you use the Web MVC framework or AOP support, you'll find they build on the configuration framework, so you can apply your knowledge about it immediately. An Introduction to BEA WebLogic Server 9.2In this section, we briefly summarize the features of BEA WebLogic Server, with an emphasis on the underlying infrastructure—rather than on programming models—that it provides. WebLogic Server is a scalable, enterprise-ready Java EE application server. The WebLogic Server infrastructure supports the deployment of many types of distributed applications and is an ideal foundation for building any kind of application. The WebLogic Server implementation of the Sun Microsystems Java EE 1.4 specification provides a standard set of APIs for creating distributed Java applications that can access a wide variety of services, such as databases, messaging services, and connections to external enterprise systems. End-user clients access these applications using Web browser clients or Java clients. Since Java EE is so widely known, we will not discuss it in any more detail here. See the WebLogic Server documentation on programming models for more information. In addition to the Java EE implementation, WebLogic Server enables enterprises to deploy mission-critical applications in a robust, secure, highly available, and scalable environment. These features allow enterprises to configure clusters of WebLogic Server instances to distribute load, and provide extra capacity in case of hardware or other failures. New diagnostic tools allow system administrators to monitor and tune the performance of deployed applications and the WebLogic Server environment itself. You can also configure WebLogic Server to monitor and tune application throughput automatically without human intervention. Extensive security features protect access to services, keep enterprise data secure, and prevent malicious attacks. Enhanced quality of service with WebLogic ServerLike many other BEA products—and icebergs—WebLogic Server has more below the water line than above it. In particular, WebLogic Server provides a number of features and tools that support the deployment of highly available and scalable applications:
|
Article Tools Related Products Check out the products mentioned in this article:Bookmark Article
|