Programming Stand-alone Clients

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Client Application Deployment Descriptor Elements

The following sections describe deployment descriptors for Java EE client applications on WebLogic Server:

 


Overview of Client Application Deployment Descriptor Elements

When it comes to Java EE applications, often users are only concerned with the server-side modules (Web applications, EJBs, and connectors). You configure these server-side modules using the application.xml deployment descriptor, discussed in Enterprise Application Deployment Descriptor Elements in Developing Applications with WebLogic Server.

However, it is also possible to include a client module (a JAR file) in an EAR file. This JAR file is only used on the client side; you configure this client module using the application-client.xml deployment descriptor. This scheme makes it possible to package both client and server side modules 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 application-client.xml file).

For client-side modules, two deployment descriptors are required: a Java EE 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

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

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

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 modules and other resources used by the client application.

The following table describes the elements you can define within an application-client element.

Table A-1 application-client Elements
Element
Required
Optional
Description
<icon>
Optional
Locations of small and large images that represent the application in a GUI tool. This element is not currently used by WebLogic Server.
<display-name>
 
Application display name, a short name that is intended to be displayed by GUI tools.
<description>
Optional
Description of the client application.
<env-entry>
 
Contains the declaration of a client application’s environment entries.
Elements that can be defined within the env-entry element are:
  • 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>
 
Used for the declaration of a reference to an EJB referenced in the client application.
Elements that can be defined within the ejb-ref element are:
  • description—Optional. The description element provides a description of the referenced EJB.
  • ejb-ref-name—Contains the name of the referenced EJB. Typically the name is prefixed by ejb/, such as ejb/Deposit.
  • ejb-ref-type—Contains the expected type of the referenced EJB, either Session or Entity.
  • home—Contains the fully-qualified name of the referenced EJB’s home interface.
  • remote—Contains the fully-qualified name of the referenced EJB’s remote interface.
  • ejb-link—Specifies that an EJB reference is linked to an enterprise JavaBean in the Java EE application package. The value of the ejb-link element must be the name of the ejb-name of an EJB in the same Java EE application.
<resource-ref>
 
Contains a declaration of the client application’s reference to an external resource.
Elements that can be defined within the resource-ref element are:
  • description—Optional. The description element contains a description of the referenced external resource.
  • res-ref-name—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—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—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-appclient.xml Descriptor Elements

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.

application-client

The application-client element is the root element of a WebLogic-specific run-time client deployment descriptor. The following table describes the elements you can define within an application-client element.

Table A-2 application-client Elements
Element
Required
Optional
Description
<env-entry>
 
Specifies values for environment entries declared in the deployment descriptor.
Elements that can be defined within the env-entry element are:
  • env-entry-name—Name of an application client's environment entry.
  • Example:

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

  • env-entry-value—Value of an application client’s environment entry. The value must be a valid string for the constructor of the specified type, which takes a single string parameter.
<ejb-ref>
 
Specifies the JNDI name for a declared EJB reference in the deployment descriptor.
Elements that can be defined within the ejb-ref element are:
  • ejb-ref-name—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—JNDI name for the EJB.
<resource-ref>
 
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>
Elements that can be defined within the resource-ref element are:
  • res-ref-name—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—JNDI name for the resource.


  Back to Top       Previous  Next