Chapter 11 Creating Application Clients
Configuring application client properties
You can configure an application client's properties
in Jaguar Manager. If you have created an Enterprise archive (EAR)
file using another tool and imported it into Jaguar, most properties
are automatically set during the import process.
To display the Application Client Properties dialog:
To set the properties described in this section,
first open the Application Client Properties dialog.
-
Expand the Clients folder, then highlight the
icon that represents your application client.
-
Choose File | Application Client Properties.
General properties
Enter the application client's general properties:
- Description An optional text description of the application client.
- Main Class The main Java class of the application client in dot notation;
for example,
com.sybase.appclient.Myclient
.
EJB references
Add references for the EJBs that the application client accesses
in its code. For example, add the EJB reference ejb/acctBean in
Jaguar Manager and use java:comp/env/ejb/acctBean in
your application client code.
To add an EJB reference:
-
Display the EJB Refs tab in the Application Client
Properties dialog.
-
Click Add. A reference with default settings is created.
Edit the settings as described below.
To edit an EJB reference:
-
If necessary, display the EJB Refs tab in the
Application Client Properties dialog. Existing references are displayed
as a list with one row for each reference.
-
Edit the EJB reference fields:
- Name Specifies the JNDI name used in the application client to refer
to this EJB. The aliased name displays in the Link Value field.
Enter the part of the JNDI name that begins with
ejb/
.
For example, if your code refers to java:comp/env/ejb/AcctBean, enter ejb/AcctBean
.
- Type Choose Session for session Beans or Entity for entity Beans.
- Home The Java class name of the EJB home interface, specified in
dot notation; for example,
com.sybase.acct.AcctBeanHome
.
- Remote The Java class name of the EJB home interface, specified in
dot notation; for example,
com.sybase.acct.AcctBeanRemote
.
- Description Optionally enter a comment to explain how the reference is
used.
- Link Value The JNDI name of an instance of the specified EJB that is
installed in the Jaguar server where the application client is to
be deployed. This name is specified by the Home Name property in
the Component Properties of the called EJB component.
-
To delete a reference, click anywhere in the fields
for the reference of interest and click Delete.
Resource references
Resource references are used to obtain database connections,
JavaMail sessions, and URL connections.
To add a resource reference:
-
Display the Resource Refs tab in the Application
Client Properties dialog.
-
Click Add. A reference with default settings is created.
Edit the settings as described below.
To edit a resource reference:
-
If necessary, display the Resource Refs tab in
the Application Client Properties dialog. Existing references are
displayed as a list with one row for each reference.
-
Edit the reference fields:
- Name The partial JNDI name used in the application client code.
Use the prefix jdbc/ for data source
references and the prefix mail/ for
JavaMail references.
- Type Choose the type of resource:
- Authentication Container is the only option that is currently supported.
- Description Optionally enter a comment to explain how the reference is
used.
-
Specify deployment properties:
- Connection Cache For JDBC references only. The name of the Jaguar connection
cache to be used for this reference.
- SMTP Host For JavaMail resources only. Specifies the SMTP mail server
for outgoing mail.
- URL Specification For aliased URLs only. The URL string, as it would be used
to construct a java.net.URL instance.
Environment properties
Environment properties allow you to specify global read-only
data for use by the application client.
Application clients must use JNDI to retrieve environment
properties, using the prefix java:comp/env
in
JNDI lookups.
The deployment descriptor catalogs the environment properties
used by the application client, as well as each property's
Java datatype and default value.
To add an environment property:
-
Display the Environment tab in the Application
Client Properties dialog.
-
Click Add. Jaguar Manager creates a new entry with default
settings. Edit the settings as described below:
To edit environment properties:
-
If necessary, display the Environment tab in
the Application Client Properties dialog box. A list of environment
properties appears.
-
Edit the fields for the property of interest:
- Entry The environment property's JNDI name, relative to
the java:comp/env prefix.
- Type The Java datatype of the property, which you select from a
list.
- Value The initial or post-deployment value of the property, specified
in a format that is valid for the selected datatype.
- Description Optionally enter a comment to explain how the property is
used.
Application
client files
The Files tab lists all the files in the application client,
which are copied to %JAGUAR%\ Repository\<Application_Name>\<Client_Name> when you
deploy the application EAR file. When you export the client application,
the files listed on this tab, plus the EJB stubs for the application
are added to the export JAR file, which you deploy on a client machine
to run the application.
Copyright © 2000 Sybase, Inc. All rights reserved.
|
|