Index by: file name | procedure name | procedure call | annotation
stopApplication_proc.tcl (annotations | original source)

####################################################################
# Stop the application.
####################################################################
proc stopApplication { appName } {

   global AdminConfig 
   global AdminControl
   global AdminApp

   set procName [ lindex [ info level 0 ] 0 ]

   putsLog "## proc - $procName"

   foreach i [ info args $procName ]  {

      upvar 0 $i ilocal

      set propertiesArray($i) $ilocal 

   }

   putsLog "procedure arguments are................."

   foreach { a b } [ array get propertiesArray ] {

       putsLog [ format "%-35s %s" "$a" "$b" ]

   }

   # check if the application exists.

   putsLog "installed applications............."

   foreach i [ $AdminApp list ] {

       putsLog [ format "%-5s %-s" " " $i ]

       lappend appList $i

   }
      
   if { [ lsearch $appList $appName ] == -1 } {

       putsLog "Application $appName is not installed."

   } else {

       putsLog "Application $appName is installed."

       foreach i [ $AdminControl queryNames type=Application,* ] {

	   lappend appListRun [ $AdminControl getAttribute $i name ] 

       }
     
       # if there are no running applications then "appListRun will not exist.  

       if { [ info exist appListRun ] == 0 } {

            putsLog " no running applications."

       } else {

	   putsLog "running applications are............."

	   foreach i $appListRun { putsLog [ format "%-5s %-s" " " $i ] }

	   # check if the application is running.  

	   if { [ lsearch $appListRun $appName ] == -1 } {

	       putsLog "$appName is not running."

	   } else {

	       # get the application manager. 
	       
	       set appManager [ $AdminControl queryNames type=AppManagement,* ]

	       # stop the application. 
	       
	       if { [ catch { $AdminControl invoke $appManager stopApplication [ list $appName null null ] } r ] == 0 } {

		   putsLog "[ string range $r [ string first WAS $r ] end ]"  

	       } else {

		   putsLog "[ string range $r [ string first WAS $r ] end ]"   
		   putsLog "$r"  
		   return -code error $r

	       }

	   }

       }

   }

}

Index by: file name | procedure name | procedure call | annotation
File generated 2007-08-07 at 13:42.