![]() |
![]() |
|
Understanding WebLogic Server Applications
The following sections provide an overview of WebLogic Server applications and application components:
What Are WebLogic Server Application Components?
BEA WebLogic Server applications can include the following components:
Web designers, application developers, and application assemblers create components by using J2EE technologies such as JavaServer Pages, servlets, and Enterprise JavaBeans.
Components are packaged in Java ARchive (JAR) files-archives created with the Java
Web Applications are packaged in a JAR file with a
An Enterprise Application, consisting of assembled components, is a JAR file with an
To deploy a component or an application, you use the Administration Console or the
Client applications (when the client is not a Web browser) are Java classes that connect to WebLogic Server using Remote Method Invocation (RMI). A Java client can access Enterprise JavaBeans, JDBC connections, JMS messaging, and other services by using RMI.
A Web archive contains all of the files that make up a Web application. A
Servlets are Java classes that execute in WebLogic Server, accept a request from a client, process it, and optionally return a response to the client. A GenericServlet is protocol independent and can be used in J2EE applications to implement services accessed from other Java classes. An HttpServlet extends GenericServlet with support for the HTTP protocol. An HttpServlet is most often used to generate dynamic Web pages in response to Web browser requests.
JSP pages are Web pages coded with an extended HTML that makes it possible to embed Java code in a Web page. JSP pages can call custom Java classes, called taglibs, using HTML-like tags. The WebLogic JSP compiler,
You can also precompile JSP pages and package the servlet class in the Web Archive to avoid compiling in the server. Servlets and JSP pages may depend upon additional helper classes that must also be deployed with the Web application.
Web Application Directory Structure
Web application components are assembled in a directory in order to stage the
The XML descriptors, compiled Java classes and JSP taglibs are stored in a
The entire directory, once staged, is bundled into a
For More Information on Web Application Components
For more information about creating Web application components, see these documents:
Enterprise JavaBean Components
Enterprise JavaBeans (EJBs) beans are server-side Java components written according to the EJB specification. There are three types of enterprise beans: session beans, entity beans, and message-driven beans.
Session beans represent a single client within WebLogic Server. They can be stateful or stateless, but are not persistent; when a client finishes with a session bean, the bean goes away.
Entity beans represent business objects in a data store, usually a relational database system. Persistence-loading and saving data-can be bean-managed or container-managed. More than just an in-memory representation of a data object, entity beans have methods that model the behaviors of the business objects they represent. Entity beans can be shared by multiple clients and they are persistent by definition.
A message-driven bean is an enterprise bean that runs in the EJB container and handles asynchronous messages from a JMS Queue. When a message is received on the JMS Queue, the message-driven bean assigns an instance of itself from a pool to process the message. Message-driven beans are not associated with any client. They simply handle messages as they arrive. A JMS ServerSessionPool provides a similar capability, but without the advantages of running in the EJB container.
Enterprise beans are bundled into a JAR file that contains their compiled classes and XML deployment descriptors.
Entity beans and session beans have remote interfaces, home interfaces, and implementation classes provided by the bean developer. (Message-driven beans do not require home or remote interfaces, because they are not accessible outside of the EJB container.)
The remote interface defines the methods a client can call on an entity bean or session bean. The implementation class is the server-side implementation of the remote interface. The home interface provides methods for creating, destroying, and finding enterprise beans. The client accesses instances of an enterprise bean through the bean's home interface.
EJB home and remote interfaces and implementation classes are portable to any EJB container that implements the EJB specification. An EJB developer can supply a JAR file containing just the compiled EJB interfaces and classes and a deployment descriptor.
J2EE cleanly separates the development and deployment roles to ensure that components are portable between EJB servers that support the EJB specification. Deploying an enterprise bean in WebLogic Server requires running the WebLogic EJB compiler,
WebLogic stubs and skeletons can also contain support for WebLogic clusters, which enable load-balancing and failover for enterprise beans. You can run
The J2EE-specified deployment descriptor,
Additional deployment descriptors provide WebLogic-specific deployment information. A
For help creating and deploying Enterprise JavaBeans, see Programming WebLogic Enterprise JavaBeans.
The WebLogic Server components are startup and shutdown classes, Java classes that execute when deployed or at shutdown time, respectively.
Startup classes can be RMI classes that register themselves in the WebLogic Server naming tree or any other Java class that can be executed in WebLogic Server. Startup classes can be used to implement new services in WebLogic Server. You could create a startup class that provides access to a legacy application or a real-time feed, for example.
Shutdown classes execute when WebLogic Server shuts down and are usually used to free resources obtained by startup classes.
Startup and shutdown classes can be configured in WebLogic Server from the Administration Console. The Java class must be in the server's classpath.
An Enterprise Archive (
You use the Administration Console or the
Client-side applications written in Java have access to WebLogic Server services via RMI. Client applications range from simple command line utilities that use standard I/O to highly interactive GUI applications built using the Java Swing/AWT classes.
Client applications use WebLogic Server components indirectly, using HTTP requests or RMI requests. The components actually execute in WebLogic Server, not in the client.
To execute a WebLogic Server Java client, the client computer needs the
The application developer packages client-side applications so they can be deployed on client computers. To simplify maintenance and deployment, it is a good idea to package a client-side application in a JAR file that can be added to the client's classpath along with the
WebLogic Server also supports J2EE client applications, packaged in a JAR file with a standard XML deployment descriptor. The
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|