WAS v8.5 > Reference > Jython script library

Application deployment configuration scripts

The scripting library provides script procedures to automate your application configurations. This topic provides usage information for scripts that deploy applications. We can run each script individually or combine procedures to create custom automation scripts for the environment.

Each application management script procedure is located in the profile_root/scriptLibraries/application/V70 directory. The application deployment script procedures contain multiple arguments. If we do not want to specify an argument with the script, specify the value of the argument as an empty string, as the following syntax demonstrates: "".

Use the following script procedures to deploy applications:


configureStartingWeightForAnApplication

This script configures the starting weight attribute for an application.

To run the script, specify the application name and starting weight arguments, as defined in the following table:

configureStartingWeightForAnApplication argument descriptions. Run the script to set an application starting weight.

Argument Description
appName Name of the application to configure.
startingWeight Starting weight to set for the application of interest.

Syntax

Example usage


configureClassLoaderPolicyForAnApplication

This script configures the class loader policy attribute for an application.

To run the script, specify the application name argument, as defined in the following table:

configureClassLoaderPolicyForAnApplication argument descriptions. Run the script to set an application class loader policy.

Argument Description
appName Name of the application to configure.
classloaderPolicy Specifies the class loader policy for the application of interest. For each application server in the system, we can set the application class-loader policy to SINGLE or MULTIPLE. When the application class-loader policy is set to SINGLE, then a single application class loader loads all EJB modules, dependency JAR files, and shared libraries in the system. When the application class-loader policy is set to MULTIPLE, then each application receives its own class loader used for loading the EJB modules, dependency JAR files, and shared libraries for that application.

Syntax

Example usage


configureClassLoaderLoadingModeForAnApplication

This script configures the class loader loading mode for an application. The class-loader delegation mode, also known as the class loader order, determines whether a class loader delegates the loading of classes to the parent class loader.

To run the script, specify the application name argument, as defined in the following table:

configureClassLoaderLoadingModeForAnApplication argument descriptions. Run the script to set an application class loader mode.

Argument Description
appName Name of the application to configure.
classloaderMode Specifies the class loader mode to set for the application of interest. We can set the class loader mode to PARENT_FIRST or PARENT_LAST.

The PARENT_FIRST class-loader mode causes the class loader to delegate the loading of classes to its parent class loader before attempting to load the class from its local class path. This value is the default for the class-loader policy and for standard JVM class loaders.

The PARENT_LAST class-loader mode causes the class loader to attempt to load classes from its local class path before delegating the class loading to its parent. Using this policy, an application class loader can override and provide its own version of a class that exists in the parent class loader.

Syntax

Example usage


configureSessionManagementForAnApplication

This script configures session management for an application.

To run the script, specify the application name argument, as defined in the following table:

configureSessionManagementForAnApplication argument descriptions. Run the script to configure application session management.

Argument Description
appName Name of the application to configure.
enableCookie Whether to enable cookies.
enableProtocolSwitching Whether session tracking uses cookies to carry session IDs. If cookies are enabled, session tracking recognizes session IDs that arrive as cookies and tries to use cookies for sending session IDs. If cookies are not enabled, session tracking uses Uniform Resource Identifier (URL) rewriting instead of cookies (if URL rewriting is enabled).
enableURLRewriting Whether the session management facility uses rewritten URLs to carry the session IDs. If URL rewriting is enabled, the session management facility recognizes session IDs that arrive in the URL if the encodeURL method is called in the servlet.
enableSSLTracking

Deprecated feature: This feature is deprecated inWebSphere Application Server v7.0. We can reconfigure session tracking to use cookies or modify the application to use URL rewriting. If we do not want to specify this argument, specify the value as an empty string, as the following syntax demonstrates: "".

Specifies that session tracking uses Secure Sockets Layer (SSL) information as a session ID. Enabling SSL tracking takes precedence over cookie-based session tracking and URL rewriting.

enableSerializedSession Whether to allow concurrent session access in a given server.
accessSessionOnTimeout Whether the servlet is started normally or aborted in the event of a timeout. If we specify true, the servlet is started normally. If we specify false, the servlet execution aborts and error logs are generated.
maxWaitTime Maximum amount of time a servlet request waits on an HTTP session before continuing execution. This parameter is optional and expressed in seconds. The default is 5 seconds. Under normal conditions, a servlet request waiting for access to an HTTP session gets notified by the request that currently owns the given HTTP session when the request finishes.
sessionPersistMode Whether to enable session persistence mode.
allowOverflow Whether the number of sessions in memory can exceed the value specified by the Max in-memory session count property. This option is valid only in non-distributed sessions mode.
maxInMemorySessionCount Maximum number of sessions to maintain in memory.
invalidTimeout Amount of time, in minutes, before a timeout occurs not valid.
sessionEnable Whether to enable session.

Syntax

AdminApplication.configureSessionManagementForAnApplication(appName, 
 enableCookie, enableProtocolSwitching, enableURLRewriting, 
 enableSSLTracking, enableSerializedSession, accessSessionOnTimeout, 
 maxWaitTime, sessionPersistMode, allowOverflow, 
 maxInMemorySessionCount, invalidTimeout, sessionEnable)

Example usage

AdminApplication.configureSessionManagementForAnApplication("myApplication", "false", "false", "true",
 "", "true", "90",  "NONE", "true", "1500", "40", "true") 


configureApplicationLoading

This script configures the application loading attribute for an application.

To run the script, specify the application name argument, as defined in the following table:

configureApplicationLoading argument descriptions. Run the script to configure application loading.

Argument Description
appName Name of the application to configure.
enableTargetMapping Whether to enable target mapping during application loading.

Syntax

Example usage


configureLibraryReferenceForAnApplication

This script configures the library reference for an application.

To run the script, specify the application name and shared library name arguments, as defined in the following table:

configureLibraryReferenceForAnApplication argument descriptions. Run the script to configure application library reference.

Argument Description
appName Name of the application to configure.
libraryName Name of the shared library to configure.

Syntax

Example usage


configureEJBModulesOfAnApplication

This script configures the EJB modules of an application.

To run the script, specify the application name argument, as defined in the following table:

configureEJBModulesOfAnApplication argument descriptions. Run the script to configure EJB modules of an application.

Argument Description
appName Name of the application to configure.
startingWeight Target weight of the EJB modules in the application of interest.
enableTargetMapping Whether to enable target mapping for EJB modules.

Syntax

AdminApplication.configureEJBModulesOfAnApplication(appName, 
 startingWeight, enableTargetMapping)

Example usage


configureWebModulesOfAnApplication

This script configures the web modules of an application.

To run the script, specify the application name argument, as defined in the following table:

configureWebModulesOfAnApplication argument descriptions. Run the script to configure Web modules of an application.

Argument Description
appName Name of the application of interest.
webModuleName Name of the web module to configure.
startingWeight Starting weight for the web module of interest.
classloaderMode Specifies the class loader mode to set for the application of interest. We can set the class loader mode to PARENT_FIRST or PARENT_LAST.

The PARENT_FIRST class-loader mode causes the class loader to delegate the loading of classes to its parent class loader before attempting to load the class from its local class path. This value is the default for the class-loader policy and for standard JVM class loaders.

The PARENT_LAST class-loader mode causes the class loader to attempt to load classes from its local class path before delegating the class loading to its parent. Using this policy, an application class loader can override and provide its own version of a class that exists in the parent class loader.

createSessionManager Whether a session manager is created for each web module that does not have one. If we specify true, which is the default value, a session manager is created for each web module that does not have a session manager. If we specify false, a session manager is not created for each web module that does not have a session manager.

Best practice: The recommended usage is to specify false.

Syntax

AdminApplication.configureWebModulesOfAnApplication(appName, 
 webModuleName, startingWeight, classloaderMode, createSessionManager)

Example usage


configureConnectorModulesOfAnApplication

This script configures the connector modules of an application. To run the script, specify the application name, J2C connection factory, and node name arguments.

To run the script, specify the application name argument, as defined in the following table:

configureConnectorModulesOfAnApplication argument descriptions. Run the script to configure connector modules of an application.

Argument Description
appName Name of the application of interest.
j2cConnFactory Name of the Java 2 Connector (J2C) connection factory to configure.
jndiName Name of the JNDI of interest.
authDataAlias Name of the authentication data alias of interest.
connectionTimeout Number of seconds that a connection request waits when there are no connections available in the free pool and no new connections can be created. This usually occurs because the maximum value of connections in the particular connection pool has been reached.

Syntax

AdminApplication.configureConnectorModulesOfAnApplication(appName, j2cConnFactory,
 jndiName, authDataAlias, connectionTimeout)

Example usage


Related


Use the script library to automate the application serving environment using wsadmin.sh
Automating application configurations using wsadmin.sh
Application administration scripts


Reference:

Application installation and uninstallation scripts
Application query scripts
Application update scripts
Application export scripts


+

Search Tips   |   Advanced Search