29.01.2013 Views

WebSphere Application Server V7.0: Concepts ... - IBM Redbooks

WebSphere Application Server V7.0: Concepts ... - IBM Redbooks

WebSphere Application Server V7.0: Concepts ... - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

► Environment-specific<br />

This category includes configuration options that are specific to a deployment<br />

environment but common to all applications running in that environment. This<br />

category includes, for example, the name of the temp folder if applications<br />

need to store temporary information. In the Windows development<br />

environment, this might be C:\temp, but in the UNIX production environment,<br />

it might be /tmp. This category of options must not move between<br />

environments.<br />

8.10.2 Managing configuration setting<br />

Dealing with configuration settings is usually a major challenge for both<br />

developers and system administrators. Not only may configuration settings have<br />

to be changed when the application is moved from one deployment environment<br />

to another, but the settings must also be kept in sync among all application<br />

instances if running in a clustered environment.<br />

To manage the settings stored in the <strong>WebSphere</strong> configuration repository (such<br />

as the JVM maximum heap size), it is common to develop scripts that are run as<br />

part of an automatic deployment to configure the settings correctly after the<br />

application has been deployed. The values suitable for the application can be<br />

stored in a bill of materials file inside the EAR file. This file can then be read by<br />

scripts and used to configure the environment.<br />

Settings stored in the deployment descriptors usually do not have to be changed<br />

as the application is moved between different environments. Instead, the Java<br />

EE specification separates the developers’ work from the deployers’. During<br />

deployment, the resources specified in the deployment descriptors are mapped<br />

to the corresponding resources for the environment (for example, a data source<br />

reference is mapped to a JNDI entry, which points to a physical database).<br />

<strong>Application</strong>-internal configuration settings, however, are often stored in Java<br />

property files. These files are plain text files with key-value pairs. Java has<br />

provided support for reading and making them available to the application using<br />

the java.util.Properties class since Java 1.0. Although you can use databases,<br />

LDAP, JNDI, and so on to store settings, plain Java property files are still the<br />

most common way of configuring internal settings for Java applications. It is an<br />

easy and straightforward method to accomplish the task. In a clustered<br />

environment where the same application runs on multiple servers distributed<br />

across different machines, care must be taken as to how to package, distribute,<br />

and access the property files.<br />

302 <strong>WebSphere</strong> <strong>Application</strong> <strong>Server</strong> <strong>V7.0</strong>: <strong>Concepts</strong>, Planning, and Design

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!