Use the wsadmin scripting objects
Overview
Each of the management objects have commands used to to perform administrative tasks. To use the scripting objects, specify the scripting object, a command, and command parameters.
In the following example, AdminConfig is the scripting object, attributes is the command, and ApplicationServer is the command parameter.
Use Jython:
print AdminConfig.attributes('ApplicationServer')Use Jacl:
$AdminConfig attributes ApplicationServerAdministrative functions within the appserver are divided into two categories: functions that work with the configuration of appserver installations, and functions that work with the currently running objects on appserver installations. Scripts work with both categories of objects. For example, an appserver is divided into two distinct entities. One entity represents the configuration of the server that resides persistently in a repository on permanent storage.
Procedure
- Use the AdminConfig object, the AdminTask object, and the AdminApp object to handle configuration functionality.
The AdminConfig object, the AdminTask object, and the AdminApp object are used when you are managing the configuration of the server that resides persistently in a repository on permanent storage. Use these objects to create, query, change, or remove this configuration without starting an appserver process. To use the AdminTask object, be connected to a running server.
- Use the AdminControl object to manage running objects on appserver installations.
The AdminControl object is used when managing the running instance of an appserver by a JMX MBean. This instance can have attributes that you can interrogate and change, and operations that you can invoke. These operational actions that are taken against a running appserver do not have an effect on the persistent configuration of the server. The attributes that support manipulation from an MBean differ from the attributes that the corresponding configuration supports. The configuration can include many attributes that you cannot query or set from the running object. The appserver scripting support provides functions to locate configuration objects and running objects. The objects in the configuration do not always represent objects that are currently running. The AdminControl object manages running objects.
- Use the Help Object to obtain information about the AdminConfig, AdminApp, AdminControl, and AdminTask objects, to obtain interface information about running MBeans, and to obtain help for warnings and error messages.
Help object for scripted administration
Use the AdminApp object for scripted administration
Use the AdminControl object for scripted administration
Use the AdminConfig object for scripted administration
Use the AdminTask object for scripted administration
Related concepts
Jacl
Related tasks
Start the wsadmin scripting client