+

Search Tips   |   Advanced Search

Resource configuration scripts

The Jython scripting library provides script procedures to automate the application server configurations. Use the mail, URL, and resource environment configuration scripts to create and configure resources in the environment. We can run each script individually or combine procedures to create custom automation scripts. The mail, URL, and resource management script procedures are located in...

Do not edit the script procedures in the script library. To write custom script library procedures, use the scripts in the app_server_root/scriptLibraries directory as Jython syntax samples. Save the custom scripts to a new subdirectory to avoid overwriting the library.

With v7, the Jython script library provides script functions for JDBC providers, JMS resources, and resource providers at the server scope. We can write our own custom scripts to configure resources at the cell, node, or cluster level.

With Fix Pack 5, the Jython script library provides script functions for JDBC providers, JMS resources, and resource providers at the cell, node, server, or cluster scope. Resource providers include mail providers, URL providers, and resource environment providers. We do not have to write custom scripts to configure resources at a particular scope.

Scripts


Format for the scope argument

The scope format applies to the scripts in the script library that have the scope argument. A cell is optional on node, server, and cluster scopes. A node is required on the server scope. We can delimit the type using a comma (,) or a colon (:). Use earlier case for the type (cell=, node=, server=, or cluster=). Examples of the containment path, configuration ID, and type for a particular scope. The scope can be Cell, Node, Server, or Cluster.


createCompleteMailProvider

This script configures additional configuration attributes for our mail provider. A mail provider encapsulates a collection of protocol providers like SMTP, IMAP and POP3, while mail sessions authenticate users and controls user access to messaging systems. Configure our own mail providers and sessions to customize how JavaMail is handled. The script returns the configuration ID of the created mail provider.

Arguments:

Syntax

Example usage


createCompleteMailProviderAtScope

This script configures additional configuration attributes for our mail provider for the scope specified. A mail provider encapsulates a collection of protocol providers like SMTP, IMAP and POP3, while mail sessions authenticate users and controls user access to messaging systems. Configure our own mail providers and sessions to customize how JavaMail is handled. The script returns the configuration ID of the created mail provider for the specified scope.

To run the script, specify the scope, mail provider name, property name, property value, protocol name, class name, type, mail session name, and JNDI name arguments. We can optionally specify attributes:

The following table contains optional attributes for a mail provider:

The following table contains optional attributes for a mail session:

Syntax

Example usage

The following example script contains required attributes only:

Include optional attributes in a string format:

Include optional attributes in a list format:


createMailProvider

Create a mail provider in the environment. The application server includes a default mail provider called the built-in provider. If we use the default mail provider we only have to configure the mail session. To use the customized mail provider first create the mail provider and session. The script returns the configuration ID of the created mail provider.

To run the script, specify the node, server, and mail provider names as defined in the following table:

Syntax

Example usage


createMailProviderAtScope

Create a mail provider in the environment at the scope specified. The application server includes a default mail provider called the built-in provider. If we use the default mail provider we only have to configure the mail session. To use the customized mail provider first create the mail provider and session. The script returns the configuration ID of the created mail provider for the specified scope.

To run the script, specify the scope and mail provider name arguments. We can optionally specify attributes. The arguments and attributes are defined in the following tables:

Optional attributes:

Syntax

Example usage

The following example script contains required attributes only:

Include optional attributes in a string format:

Include optional attributes in a list format:


createMailSession

Create a new mail session for our mail provider. Mail sessions are represented by the javax.mail.Session class. A mail session object authenticates users, and controls user access to messaging systems. The script returns the configuration ID of the created mail session.

To run the script, specify the node name, server name, mail provider name, mail session name, and Java Naming and Directory Interface (JNDI) name arguments, as defined in the following table:

Syntax

Example usage


createMailSessionAtScope

Create a new mail session for our mail provider at the scope specified. Mail sessions are represented by the javax.mail.Session class. A mail session object authenticates users, and controls user access to messaging systems. The script returns the configuration ID of the created mail session for the specified scope.

To run the script, specify the scope, mail provider name, mail session name, and Java Naming and Directory Interface (JNDI) name arguments. We can optionally specify attributes:

Optional attributes:

Syntax

Example usage

The following example script contains required attributes only:

Include optional attributes in a string format:

Include optional attributes in a list format:


createProtocolProvider

Create a protocol provider in the configuration, which provides the implementation class for a specific protocol to support communication between your JavaMail application and mail servers. The application server contains protocol providers for SMTP, IMAP and POP3. If we require custom providers for different protocols, install them in the application serving environment before configuring the providers. See the JavaMail API design specification for guidelines. After configuring your protocol providers, return to the mail provider page to find the link for configuring mail sessions. The script returns the configuration ID of the created protocol provider.

To run the script, specify the following arguments:

Syntax

Example usage


createProtocolProviderAtScope

Create a protocol provider in the configuration at the scope specified. The protocol provider provides the implementation class for a specific protocol to support communication between your JavaMail application and mail servers at the scope specified. The application server contains protocol providers for SMTP, IMAP and POP3. If we require custom providers for different protocols, install them in the application serving environment before configuring the providers. See the JavaMail API design specification for guidelines. After configuring the protocol providers, return to the mail provider page to find the link for configuring mail sessions. The script returns the configuration ID of the created protocol provider for the specified scope.

To run the script, specify the scope mail provider name, protocol name, class name, and type arguments. We can optionally specify the classpath attribute:

Optional attributes. The classpath attribute is also available for the script.

Syntax

Example usage

The following example script contains required attributes only:

Include optional attributes in a string format:

Include optional attributes in a list format:


createCompleteResourceEnvProvider

This script configures a resource environment provider, which encapsulate the referenceables that convert resource environment entry data into resource objects in your configuration. The script returns the configuration ID of the created resource environment provider.

To run the script, specify the following arguments:

Syntax

Example usage


createCompleteResourceEnvProviderAtScope

This script configures a resource environment provider at the scope specified. The resource environment provider encapsulates the referenceables that convert resource environment entry data into resource objects in your configuration. The script returns the configuration ID of the created resource environment provider for the specified scope.

To run the script, specify the scope, resource environment provider, custom property name, custom property value, factory class, class name, resoure environment entry, and JNDI name arguments. We can optionally specify attributes:

The following table contains optional attributes for the resource environment provider:

The following table contains optional attributes for the resource environment entry:

Syntax

Example usage

The following example script contains required attributes only:

Include optional attributes in a string format:

Include optional attributes in a list format:


createResourceEnvEntries

Create a resource environment entry in the configuration. Within an application server name space, the data contained in a resource environment entry is converted into an object that represents a physical resource. This resource is frequently called an environment resource. The script returns the configuration ID of the created resource environment entry.

Arguments:

Syntax

Example usage


createResourceEnvEntriesAtScope

Create a resource environment entry in the configuration at the scope specified. Within an application server name space, the data contained in a resource environment entry is converted into an object that represents a physical resource. This resource is frequently called an environment resource. The script returns the configuration ID of the created resource environment entry for the specified scope.

To run the script, specify the scope the resource environment provider, resource environment entry, and JNDI name arguments. We can optionally specify attributes:

Syntax

Example usage

The following example script contains required attributes only:

Include optional attributes in a string format:

Include optional attributes in a list format:


createResourceEnvProvider

Create a resource environment provider in the configuration. The resource environment provider encapsulates the classes that, when implemented, convert resource environment entry data into resource objects. The script returns the configuration ID of the created Resource environment provider.

To run the script, specify the node name, server name, and resource environment provider name arguments, as defined in the following table:

Syntax

Example usage


createResourceEnvProviderAtScope

Create a resource environment provider in the configuration at the scope specified. The resource environment provider encapsulates the classes that, when implemented, convert resource environment entry data into resource objects. The script returns the configuration ID of the created Resource environment provider for the specified scope.

To run the script, specify the scope, and resource environment provider name arguments. We can optionally specify attributes:

Optional attributes:

Syntax

Example usage

The following example script contains required attributes only:

The following example script includes optional attributes in a string format:

Include optional attributes in a list format:


createResourceEnvProviderRef

Create a resource environment provider reference in the configuration. Resource environment references are different than resource references. Resource environment references allow the application client to use a logical name to look up a resource bound into the server JNDI namespace. A resource reference allows the application to use a logical name to look up a local JEE resource. The JEE specification does not specify a particular implementation of a resource. The script returns the configuration ID of the created resource environment provider reference ID.

To run the script, specify the following arguments:

Syntax

Example usage


createResourceEnvProviderRefAtScope

Create a resource environment provider reference in the configuration at the scope we specify. Resource environment references are different than resource references. Resource environment references allow the application client to use a logical name to look up a resource bound into the server JNDI namespace. A resource reference allows the application to use a logical name to look up a local JEE resource. The JEE specification does not specify a particular implementation of a resource. The script returns the configuration ID of the created resource environment provider reference ID for the specified scope.

To run the script, specify the following arguments:

Syntax

Example usage


configURLProvider

Configure a URL provider, which supplies the implementation classes that are necessary for the application server to access a URL through a specific protocol. The default URL provider provides connectivity through protocols supported by the IBM Developer Kit. These protocols include HTTP and File Transfer Protocol (FTP), which work for must URLs.

Arguments:

Syntax

Example usage


createCompleteURLProvider

Create a URL provider, which supplies the implementation classes that are necessary for the application server to access a URL through a specific protocol. The default URL provider provides connectivity through protocols supported by the IBM Developer Kit. These protocols include HTTP and File Transfer Protocol (FTP), which work for must URLs. The script returns the configuration ID of the created URL provider.

Arguments:

Syntax

Example usage


createCompleteURLProviderAtScope

Create a URL provider at the scope specified. The URL provider supplies the implementation classes that are necessary for the application server to access a URL through a specific protocol. The default URL provider provides connectivity through protocols supported by the IBM Developer Kit. These protocols include HTTP and File Transfer Protocol (FTP), which work for must URLs. The script returns the configuration ID of the created URL provider for the specified scope.

Arguments:

The following table contains optional attributes for the URL provider:

The following table contains optional attributes for the URL:

Syntax

Example usage

The following example script contains required attributes only:

Include optional attributes in a string format:

Include optional attributes in a list format:


createURL

Create a URL provider, which supplies the implementation classes that are necessary for the application server to access a URL through a specific protocol. The default URL provider provides connectivity through protocols supported by the IBM Developer Kit. These protocols include HTTP and File Transfer Protocol (FTP), which work for must URLs. The script returns the configuration ID of the created URL.

Arguments:

Syntax

Example usage


createURLAtScope

Create a URL provider at the scope specified. The URL provider supplies the implementation classes that are necessary for the application server to access a URL through a specific protocol. The default URL provider provides connectivity through protocols supported by the IBM Developer Kit. These protocols include HTTP and File Transfer Protocol (FTP), which work for must URLs. The script returns the configuration ID of the created URL for the specified scope.

To run the script, specify the scope, URL provider name, URL name, JNDI name, and URL specification arguments. We can optionally specify attributes:

Optional parameters:

Syntax

Example usage

The following example script contains required attributes only:

Include optional attributes in a string format:

Include optional attributes in a list format:


createURLProvider

Create a URL provider, which supplies the implementation classes that are necessary for the application server to access a URL through a specific protocol. The default URL provider provides connectivity through protocols supported by the IBM Developer Kit. These protocols include HTTP and File Transfer Protocol (FTP), which work for must URLs. The script returns the configuration ID of the created URL provider.

Arguments:

Syntax

Example usage


createURLProviderAtScope

Create a URL provider at the scope specified. The URL provider supplies the implementation classes that are necessary for the application server to access a URL through a specific protocol. The default URL provider provides connectivity through protocols supported by the IBM Developer Kit. These protocols include HTTP and File Transfer Protocol (FTP), which work for must URLs. The script returns the configuration ID of the created URL provider for the specified scope.

To run the script, specify the scope, URL provider name, URL stream handler class, and URL protocol arguments. We can optionally specify attributes:

Syntax

Example usage

The following example script contains required attributes only:

Include optional attributes in a string format:

Include optional attributes in a list format:


createJAASAuthenticationAlias

Create a JAAS authentication alias. The alias identifies the authentication data entry. When configuring resource adapters or data sources, the administrator can specify which authentication data to choose using the corresponding alias. The script returns the configuration ID of the created DB2 Authentication and Authorization Service (JAAS) Authentication Alias.

To run the script, specify the following arguments:

Syntax

Example usage


createLibraryRef

Create a library reference, which defines how to use global libraries. The first step for making a library file available to multiple applications deployed on a server is to create a shared library for each library file that the applications need. When creating the shared libraries, set variables for the library files. The script returns the configuration ID of the created library reference.

Arguments:

Syntax

Example usage


createSharedLibrary

Create a shared library in the configuration. The first step for making a library file available to multiple applications deployed on a server is to create a shared library for each library file that the applications need. When creating the shared libraries, set variables for the library files. The script returns the configuration ID of the created library.

Arguments:

Syntax

Example usage

(Windows)

(AIX) (Solaris) (Linux) (HPUX) (iSeries) (ZOS)


createSharedLibraryAtScope

Create a shared library in the configuration at the scope specified. The first step for making a library file available to multiple applications deployed on a server is to create a shared library for each library file that the applications need. When creating the shared libraries, set variables for the library files. The script returns the configuration ID of the created library for the specified scope.

To run the script, specify the scope shared library name and shared library class path arguments. We can optionally specify attributes:

Optional attributes:

Syntax

Example usage

The following example scripts contains required attributes only:

(Windows)

(AIX) (Solaris) (Linux) (HPUX) (iSeries) (ZOS)

Include optional attributes in a string format:

(Windows)

(AIX) (Solaris) (Linux) (HPUX) (iSeries) (ZOS)

Include optional attributes in a list format:

(Windows)

(AIX) (Solaris) (Linux) (HPUX) (iSeries) (ZOS)


createScheduler

Create a scheduler in the configuration. Schedulers are persistent and transactional timer services that can run business logic. Each scheduler runs tasks independently and has a programming interface accessible from JEE applications using the JNDI. We can also manage schedulers using a Java Management Extensions (JMX) MBean. See the scheduler documentation in the Information Center for details on how to configure and use schedulers. The script returns the configuration ID of the created scheduler.

Arguments:

Syntax

Example usage


createSchedulerAtScope

Create a scheduler in the configuration at the scope specified. Schedulers are persistent and transactional timer services that can run business logic. Each scheduler runs tasks independently and has a programming interface accessible from JEE applications using the JNDI. We can also manage schedulers using a JMX MBean. See the scheduler documentation in the Information Center for details on how to configure and use schedulers. The script returns the configuration ID of the created scheduler for the specified scope.

To run the script, specify the scope, scheduler name, JNDI name, JNDI datasource, table prefix, poll interval, JNDI name of the work manager, and scheduler provider ID arguments. We can optionally specify attributes:

Syntax

Example usage

The following example script contains required attributes only:

Include optional attributes in a string format:

Include optional attributes in a list format:


createWorkManager

Create a work manager in the configuration. Work managers contain a pool of threads that are bound into Java Naming and Directory Interface. The script returns the configuration ID of the created work manager.

To run the script, specify the following arguments:

Syntax

Example usage


createWorkManagerAtScope

Create a work manager in the configuration at the scope specified. Work managers contain a pool of threads that are bound into Java Naming and Directory Interface. The script returns the configuration ID of the created work manager for the specified scope.

To run the script, specify the scope work manager name, JNDI name, alarm threads, minimum threads, maximum threads, thread priority, and work manager provider ID arguments. We can optionally specify attributes:

Optional attributes:

Syntax

Example usage

The following example script contains required attributes only:

Include optional attributes in a string format:

Include optional attributes in a list format:


help

This script displays the script procedures that the AdminResources script library supports. To display detailed help for a specific script, specify the name of the script of interest, as defined in the following table:

Syntax

Example usage

  • Use the script library to automate the application serving environment
  • Configure mail providers and sessions
  • Configure new resource environment providers for application clients
  • Configure new URL providers for application clients
  • JDBC configuration scripts
  • J2C configuration scripts
  • JMS configuration scripts
  • JavaMail system properties