Network Deployment (Distributed operating systems), v8.0 > Scripting the application serving environment (wsadmin) > Manage deployed applications using wsadmin.sh


Query the application state using wsadmin.sh

Use wsadmin.sh and scripting to determine if an application is running.

There are two ways to complete this task. The example in this topic uses the AdminConfig object to create and configure a shared library. Alternatively, you can use the createSharedLibrary script in the AdminResources script library to configure shared libraries.

The scripting library provides a set of procedures to automate the most common administration functions. You can run each script procedure individually, or combine several procedures to quickly develop new scripts.


Procedure

  1. Start wsadmin.sh.

  2. Determine the application state.

    The following example queries the presence of the Application MBean to find out whether the application is running.

      ### Jacl

      $AdminControl completeObjectName type=Application,name=myApplication,*
      

      ### Jython

      print AdminControl.completeObjectName('type=Application,name=myApplication,*')
      


Results

If myApplication is running, then an MBean is created. Otherwise, the command returns nothing. If myApplication is running, the output resembles the following:

WebSphere:cell=mycell,name=myApplication,mbeanIdentifier=cells/mycell/applications/myApplication.ear/
deployments/myApplication/deployment.xml#ApplicationDeployment_1,type=Application,node=mynode,Server=
dmgr,process=dmgr,J2EEName=myApplication 

Use the wsadmin scripting AdminControl object for scripted administration


Related


Commands for the AdminControl object using wsadmin.sh

+

Search Tips   |   Advanced Search