Use the wsadmin scripting objects
The wsadmin tool utilizes a set of management objects which allow you to run commands and command parameters to configure your environment. Use the AdminConfig, AdminControl, AdminApp, AdminTask, and Help objects to perform administrative tasks.
Each of the management objects have commands that we can use 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.
Jython:
print AdminConfig.attributes('ApplicationServer')
Using Jacl:
$AdminConfig attributes ApplicationServer
Administrative functions within the application server are divided into two categories: functions that work with the configuration of application server installations, and functions that work with the currently running objects on application server installations. Scripts work with both categories of objects. For example, an application server is divided into two distinct entities. One entity represents the configuration of the server that resides persistently in a repository on permanent storage.
When using a file with a wsadmin scripting object, the local file system is always used, even when connected to a remote server.
- 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 we 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 application server process. To use the AdminTask object, you must be connected to a running server.
- Use the AdminControl object to manage running objects on application server installations.
The AdminControl object is used when managing the running instance of an application server by a JMX (JMX) MBean. This instance can have attributes that we can interrogate and change, and operations that we can invoke. These operational actions that are taken against a running application server 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 we cannot query or set from the running object. The application server 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.
Subtopics
- Help object for scripted administration
The Help object provides general help, online information about running MBeans, and help on messages.
Related concepts
Use wsadmin scripting with Jacl
Related tasks
Use the wsadmin scripting AdminApp object for scripted administration Use the wsadmin scripting AdminControl object for scripted administration Use the wsadmin scripting AdminConfig object for scripted administration Use the wsadmin scripting AdminTask object for scripted administration Start the wsadmin scripting client