com.BobCo.procman
Class ExecuteCommandSample

java.lang.Object
  extended bycom.BobCo.procman.ExecuteCommandSample
All Implemented Interfaces:
com.tivoli.twg.libs.CommandCompleteListener

public class ExecuteCommandSample
extends java.lang.Object
implements com.tivoli.twg.libs.CommandCompleteListener

ExecuteCommandSample demonstrates one way of executing commands on agents. This sample shows how to asynchronously start notepad on a user specified machine.


Constructor Summary
ExecuteCommandSample()
          Constructor - Set up work queue to processes requests
 
Method Summary
 void buildAndSendExecuteCommand()
          Build the command to be executed and then execute it on the specified agent.
 void CommandComplete(com.tivoli.twg.libs.Command cmd)
          Command complete method which overrides the method in the Command class.
static void DisplayUsage()
          Output to screen usage info
static void main(java.lang.String[] args)
          Main method.
 void serviceNodeClose()
          Close service node
 void serviceNodeInit()
          Create service node
 boolean startProcMgrService()
          Start process manager agent service on the specified machine.
 void stopProcMgrService()
          Stop ProcMgr service on specified agent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecuteCommandSample

public ExecuteCommandSample()
Constructor - Set up work queue to processes requests

Method Detail

main

public static void main(java.lang.String[] args)
Main method. Creates a service node, starts the ProcMgr service, and processes requests off the workQueue.


DisplayUsage

public static void DisplayUsage()
Output to screen usage info


serviceNodeInit

public void serviceNodeInit()
Create service node


serviceNodeClose

public void serviceNodeClose()
Close service node


startProcMgrService

public boolean startProcMgrService()
Start process manager agent service on the specified machine. This sample only uses TCPIP, but other protocols could be used. An example of the destination is TCPIP::146.84.86.21::ProcMgr.


stopProcMgrService

public void stopProcMgrService()
Stop ProcMgr service on specified agent


buildAndSendExecuteCommand

public void buildAndSendExecuteCommand()
Build the command to be executed and then execute it on the specified agent.


CommandComplete

public void CommandComplete(com.tivoli.twg.libs.Command cmd)
Command complete method which overrides the method in the Command class. Based on what completed, put the next action on the work queue. The main method will then wake up and get the item off the queue and call the appropriate routine.

Specified by:
CommandComplete in interface com.tivoli.twg.libs.CommandCompleteListener