You can use properties files to install or remove Java™ 2 Platform, Enterprise Edition
(J2EE) Connector Architecture (J2C) resource adapters.
Before you begin
Determine the changes that you want to make to your J2C
resource adapter configuration.
Start the wsadmin scripting
tool. To start wsadmin using the Jython language, run the wsadmin
-lang jython command from the bin directory
of the server profile.
About this task
Using a properties file, you can install or remove a J2C
resource adapter.
Run administrative commands using wsadmin
to apply or delete a properties file for a J2C resource adapter.
Table 1. Actions for J2C
resource adapter properties files. You can create and
delete J2C resource adapter properties.Action |
Procedure |
create (install) |
- Create a properties file that sets required properties for a J2C
resource adapter and that contains the following lines in the header:
CreateDeleteCommandProperties=true
commandName=installResourceAdapter
- Run the applyConfigProperties command to install
the resource adapter.
|
modify |
Not applicable |
delete (remove) |
To remove the entire resource adapter, uncomment #DELETE=true and
then run the deleteConfigProperties command. |
create Property |
Not applicable |
delete Property |
Not applicable |
Optionally, you can use interactive mode with the commands:
AdminTask.command_name('-interactive')
Procedure
- Install a J2CResourceAdapter instance.
- Create a properties file for a J2CResourceAdapter instance.
Open an editor and create a file such as the following for
a J2CResourceAdapter instance:
#
# Header
#
CreateDeleteCommandProperties=true
commandName=installResourceAdapter
#
#
#Properties
#
rarPath=myRA.rar #String,required
rar.nativePath=null #String
rar.archivePath=null #String
rar.propertiesSet=null #java.util.Properties
rar.name=null #String
rar.DeleteSourceRar=null #Boolean
rar.classpath=null #String
rar.HACapability=null #String
nodeName=!{nodeName} #String,required
rar.desc=null #String
rar.enableHASupport=null #Boolean
rar.threadPoolAlias=null #String
rar.isolatedClassLoader=null #Boolean#
EnvironmentVariablesSection
#
#Environment Variables
nodeName=myNode
- Run the applyConfigProperties command
to install a J2C resource adapter configuration.
Running
the applyConfigProperties command applies the properties
file to the configuration. In this Jython example, the optional -reportFileName parameter
produces a report named report.txt:
AdminTask.applyConfigProperties(['-propertiesFileName myObjectType.props -reportFileName report.txt'])
- Remove the entire J2C resource adapter instance.
- Specify DELETE=true in the header section
of the properties file.
A J2C resource adapter properties
file with DELETE=true resembles the following:
#
# Header
#
ResourceType=J2CResourceAdapter
ImplementingResourceType=J2CResourceAdapter
ResourceId=Cell=!{cellName}: J2CResourceAdapter=myJ2CResourceAdapter
DELETE=true
#
#
#Properties
#
name=myJ2CResourceAdapter
#
EnvironmentVariablesSection
#
#Environment Variables
cellName=myCell
- Run the deleteConfigProperties command.
The following Jython example uses the optional -reportFileName parameter
and produces a report named report.txt:
AdminTask.deleteConfigProperties('[-propertiesFileName myObjectType.props -reportFileName report.txt]')
Results
You can use the properties file to configure and manage
the J2C resource adapter.
What to do next
Save the changes to your configuration.