When you run a command from wsadmin, a new process is created with a new Java virtual machine (JVM). If you run multiple wsadmin -c commands from a batch file or a shell script, each command must run in its own JVM. The -f option creates only one process and JVM, and the Java classes are loaded only once, regardless of how many commands are in the file.
This example invokes multiple application installation commands:
wsadmin -c "$AdminApp install /home/myApps/App1.ear {-appname appl1}" wsadmin -c "$AdminApp install /home/myApps/App2.ear {-appname appl2}" wsadmin -c "$AdminApp install /home/myApps/App3.ear {-appname appl3}"
To improve performance, you can run the wsadmin command with the -f option and specify a file that contains the installation commands. For example, you can create a file called appinst.jacl that contains these commands:
$AdminApp install /home/myApps/App1.ear {-appname appl1} $AdminApp install /home/myApps/App2.ear {-appname appl2} $AdminApp install /home/myApps/App3.ear {-appname appl3}
To invoke the file, run this command:
wsadmin -f appinst.jacl
The AdminControl queryNames and completeObjectName commands can consume a large amount of resources in more complex topologies. For example, if you run a single instance that contains only a few MBeans, the $AdminControl queryNames * command performs well. However, if a scripting client connects to the deployment manager in a multiple machine environment, use a command only if it is necessary for the script to obtain a list of all of the MBeans in the system. If you need the MBeans on a specific node, it is recommended that you run the command as follows:
$AdminControl queryNames node=myNode,*
In this example, the command returns a list of only the MBeans on myNode.