Table of Contents J2EE Technology Application Servers... 1 ArchitecturalOverview...2 Server Process Interactions... 4 JDBC Support and Connection Pooling... 4 CMPSupport...5 JMSSupport...6 CORBA ORB Support... 6 Web Services Support... 7 Sun ONE Application Server 7 provides bundled services and the necessary subsystems to support various protocols used in an enterprise environment. This module describes the architectural pieces, services and subsystems in detail. Objectives Describe a typical application server Describe the Sun ONE Application Server component architecture Describe Sun ONE Application Server process interactions Describe the core enabling technologies for Sun ONE Application Server J2EE Technology Application Servers J2EE technology application servers promote the distinction between various portions of applications. This distinction enables developers to design a portion of an application with a level of abstraction from the other contributing parts. Application Models An application model is the conceptual division of an application into functional components. The Sun ONE Application Server application model is component-oriented. This application model promotes code reusability and faster application deployment. 1
The Sun ONE Application Server application model divides an application into these layers: Server-side presentation Business logic Data and legacy access Note It is not necessary to always have a web server in front of the application server. This situation arises if the application server is behind a firewall. Architectural Overview Sun ONE Application Server is based on a new architecture and is a significant enhancement to the Sun ONE application server products. Implemented largely in Java, except for performance-critical communication and security layers, Sun ONE Application Server offers a server platform to rapidly deliver implementations of new and forthcoming J2EE specifications. 2
The Sun ONE Application Server architecture is derives the functionality by using proven technologies. The Sun ONE Application Server architecture uses the following technologies: Sun ONE Web Server Enhanced J2EE RI components Sun ONE Studio Transparent Persistence Sun ONE Message Queue Sun ONE Developer Studio Open Source Libraries: NSPR, NSS, JSS 3
Server Process Interactions Sun ONE Application Server 7 process interaction is very similar to what is currently available in the Sun ONE Web Server 6.0. The administration server is a distinguished Sun ONE Application Server 7 instance. It can administer one more server process instances, on the same machine. Appropriate authentication is performed to grant administrative privileges to a user. The administration server can be configured to start automatically or can be started manually, by the administrator. The Application Server instance process can be started from the administration server, or can be manually started by the user. In all cases, a watchdog process monitors and restarts the watched process, if it dies. (Animation: Admin Server desc - see admin guide chap1-p32) JDBC Support and Connection Pooling 4
To access a database, you require to register and configure the JDBC data source. Sun ONE Application Server 7 administration tools provide ways to register and configure JDBC data source. Next, you create and manage named JDBC connection pools using the administrative interface. Each named pool is initialized at server start up and configured as per the attributes. If more than one registered JDBC data sources point to the same connection pool they share the same physical pool of connections. Connection pooling is a mechanism that enables recycling of a connection when it is closed. The connection is not destroyed. The establishment of connections is an resource extensive operation that consumes hardware computing cycles. Therefore, reusing connections can improve performance dramatically by reducing the number of new connections that need to be created and torn down. A data source provides access to connection pools for database connectivity. Configuration of connection pools and drivers is done in the server.xml file. This will covered in detail in the Database and Transactions module. CMP Support The Sun ONE Application Server provides an implementation of container-managed persistence (CMP) that uses JDBC databases to store persistent states. During deployment, users are able to define the mapping between the persistent fields and relationships and the corresponding database elements. The Container-managed persistence (CMP) uses the EJB 2.0 specifications to enable multiple entity beans to develop container-managed relationships among themselves. This is done by introducing a local model which uses local interfaces, in addition to a remote model using remote interfaces. The CMP local model is tightly coupled than the remote model to avoid the performance overhead of the remote model. It follows the Java programming model in passing parameters between enterprise beans. 5
The code required to implement CMP for a bean can be classified as follows: Code to instantiate a persistence manager factory Code to specify the database connection the persistence manager uses Code to create the persistence manager Bundled PersistenceManager The persistence manager is implemented as a pluggable API. It is responsible for the transparent persistence of container-managed beans installed in the EJB technology container and has the following characteristics: Uses the datasource registration capabilities provided by the container to register and use the required datasources Can use the Object-to-Relational (O/R) mappings generated by the Sun ONE Studio (formerly called Forte for Java) integrated development environment (IDE) during the creation of containermanaged beans JMS Support Sun ONE Application Server provides support for applications that use the Java Message Service (JMS) application programming interface (API) for messaging operations. JMS is a set of programming interfaces that provide a common way for Java applications to create, send, receive, and read messages in a distributed environment. In particular, JMS is the standards-based way that Java 2 Enterprise Edition (J2EE) applications perform asynchronous messaging. Accordingly, J2EE components Web components or Enterprise JavaBeans (EJB) components can use the JMS API to send messages that can be consumed asynchronously by a specialized EJB, called a message-driven bean (MDB). Sun ONE Application Server support for JMS messaging, in general, and for MDBs, in particular, requires messaging middleware that implements the JMS specification a JMS provider. Sun ONE Application Server uses Sun ONE Message Queue (formerly known iplanet Message Queue), Version 3.0, as its native JMS provider. Detailed information about JMS support in Sun ONE Application server is covered in JMS Supoort module. CORBA ORB Support 6
Common Object Request Broker Architecture (CORBA) is a standard architecture that is used for distributed object systems. CORBA defines a client request for the services of a distributed object. These services are located by an object reference. The services are defined by an interface. When a client requests for a service, the Object Request Broker (ORB) locates the object and delivers the request to the object. In addition, ORB delivers any results from the object to the client. In the Sun ONE architecture, the application client container uses the ORB service to communicate EJB. The ORB supports the following CORBA 2.3.1 specification requirements: Transport using RMI-IIOP Ability to use the SSL 3.0 and Transport Layer Security (TLS) 1.0 protocols Support for CosNaming, the naming service for the Java Interface Definition Language (Java IDL), to transparently invoke remote EJB technology components using RMI-IIOP The ORB provides interoperability between local or remote EJB technology components and is also used by the EJB technology container for session and entity bean life-cycle management, transaction management, and security services. 7
Web Services Support A web service enables a transaction between two entities using the Web. For example, a web service enabling business to business transactions and credit card authorizations. A web service can use other web services to offer enhanced functionality. Multiple web services join together to form a web application. A web service uses Universal Description Discovery and Integration (UDDI) protocol to locate another web service. Two web services interact with each other by using the Simple Object Access Protocol (SOAP) protocol. SOAP is a transport mechanism serializes and deserializes java objects as XML/HTTP). Web services runtime relies on SOAP runtime to deliver JAXM, JAX-RPC, JARXR, and other Web Services. 8