bea.com | products | dev2dev | support | askBEA

Download Docs | Site Map | Glossary
Search

Developing WebLogic Server Applications

Client Application Deployment Descriptor Elements

The following sections describe deployment descriptors for J2EE client applications on WebLogic Server. Often, when it comes to J2EE applications, users are only concerned with the server-side components (Web Applications, EJBs, Connectors). You configure these server-side components using the application.xml deployment descriptor, discussed in Application Deployment Descriptor Elements.

However, it is also possible to include a client component (a JAR file) in an EAR file. This JAR file is only used on the client side; you configure this client component using the client-application.xml deployment descriptor. This scheme makes it possible to package both client and server side components together. The server looks only at the parts it is interested in (based on the application.xml file) and the client looks only at the parts it is interested in (based on the client-application.xml file).

For client-side components, two deployment descriptors are required: a J2EE standard deployment descriptor, application-client.xml, and a WebLogic-specific runtime deployment descriptor with a name derived from the client application JAR file.

- application-client.xml Deployment Descriptor Elements

- WebLogic Run-time Client Application Deployment Descriptor

application-client.xml Deployment Descriptor Elements

The application-client.xml file is the deployment descriptor for J2EE client applications. It must begin with the following DOCTYPE declaration:

>     <!DOCTYPE application-client PUBLIC "-//Sun Microsystems,
>     Inc.//DTD J2EE Application Client 1.2//EN"
>     "http://java.sun.com/j2ee/dtds/application-client_1_2.dtd">

The following diagram summarizes the structure of the application-client.xml deployment descriptor.

The following sections describe each of the elements that can appear in the file.

application-client

application-client is the root element of the application client deployment descriptor. The application client deployment descriptor describes the EJB components and other resources used by the client application.

The elements within the application-client element are described in the following sections.

icon

Optional. The icon element specifies the locations of small and large images that represent the application in a GUI tool. This element is not currently used by WebLogic Server.

small-icon

Optional. Specifies the location for a small (16x16 pixel) .gif or .jpg image used to represent the application in a GUI tool. Currently, this is not used by WebLogic Server.

large-icon

Optional. Specifies the location for a large (32x32 pixel) .gif or .jpg image used to represent the application in a GUI tool. Currently, this element is not used by WebLogic Server.

display-name

The display-name element specifies the application display name, a short name that is intended to be displayed by GUI tools.

description

Optional. The description element provides a description of the client application.

env-entry

The env-entry element contains the declaration of a client application's environment entries.

description

Optional. The description element contains a description of the particular environment entry.

env-entry-name

The env-entry-name element contains the name of a client application's environment entry.

env-entry-type

The env-entry-type element contains the fully-qualified Java type of the environment entry. The possible values are: java.lang.Boolean, java.lang.String, java.lang.Integer, java.lang.Double, java.lang.Byte, java.lang.Short, java.lang.Long, and java.lang.Float.

env-entry-value

Optional. The env-entry-value element contains the value of a client application's environment entry. The value must be a String that is valid for the constructor of the specified env-entry-type.

ejb-ref

The ejb-ref element is used for the declaration of a reference to an EJB referenced in the client application.

description

Optional. The description element provides a description of the referenced EJB.

ejb-ref-name

The ejb-ref-name element contains the name of the referenced EJB. Typically the name is prefixed by ejb/, such as ejb/Deposit.

ejb-ref-type

The ejb-ref-type element contains the expected type of the referenced EJB, either Session or Entity.

home

The home element contains the fully-qualified name of the referenced EJB's home interface.

remote

The remote element contains the fully-qualified name of the referenced EJB's remote interface.

ejb-link

The ejb-link element specifies that an EJB reference is linked to an enterprise JavaBean in the J2EE application package. The value of the ejb-link element must be the name of the ejb-name of an EJB in the same J2EE application.

resource-ref

The resource-ref element contains a declaration of the client application's reference to an external resource.

description

Optional. The description element contains a description of the referenced external resource.

res-ref-name

The res-ref-name element specifies the name of the resource factory reference name. The resource factory reference name is the name of the client application's environment entry whose value contains the JNDI name of the data source.

res-type

The res-type element specifies the type of the data source. The type is specified by the Java interface or class expected to be implemented by the data source.

res-auth

The res-auth element specifies whether the EJB code signs on programmatically to the resource manager, or whether the Container will sign on to the resource manager on behalf of the EJB. In the latter case, the Container uses information that is supplied by the Deployer. The res-auth element can have one of two values: Application or Container.

WebLogic Run-time Client Application Deployment Descriptor

This XML-formatted deployment descriptor is not stored inside of the client application JAR file like other deployment descriptors, but must be in the same directory as the client application JAR file.

The file name for the deployment descriptor is the base name of the JAR file, with the extension .runtime.xml. For example, if the client application is packaged in a file named c:/applications/ClientMain.jar, the run-time deployment descriptor is in the file named c:/applications/ClientMain.runtime.xml.

The following diagram shows the structure of the elements in the run-time deployment descriptor.

application-client

The application-client element is the root element of a WebLogic-specific run-time client deployment descriptor.

env-entry

The env-entry element specifies values for environment entries declared in the deployment descriptor.

env-entry-name

The env-entry-name element contains the name of an application client's environment entry.

Example:

>     <env-entry-name>EmployeeAppDB</env-entry-name>

env-entry-value

The env-entry-value element contains the value of an application client's environment entry. The value must be a string valid for the constructor of the specified type that takes a single string parameter.

ejb-ref

The ejb-ref element specifies the JNDI name for a declared EJB reference in the deployment descriptor.

ejb-ref-name

The ejb-ref-name element contains the name of an EJB reference. The EJB reference is an entry in the application client's environment. It is recommended that name is prefixed with ejb/.

Example:

>     <ejb-ref-name>ejb/Payroll</ejb-ref-name>

jndi-name

The jndi-name element specifies the JNDI name for the EJB.

resource-ref

The resource-ref element declares an application client's reference to an external resource. It contains the resource factory reference name, an indication of the resource factory type expected by the application client's code, and the type of authentication (bean or container).

Example:

>     <resource-ref>
>       <res-ref-name>EmployeeAppDB</res-ref-name>
>       <jndi-name>enterprise/databases/HR1984</jndi-name>
>     </resource-ref>

resource-ref-name

The res-ref-name element specifies the name of the resource factory reference name. The resource factory reference name is the name of the application client's environment entry whose value contains the JNDI name of the data source.

jndi-name

The jndi-name element specifies the JNDI name for the resource.