ProcessSample

This sample uses the sample RosterHelper(VWSession, Logger) class to display process information. Run the sample by entering a command similar to the following:

java ProcessSample username password <server name>:<port number>/<router instance name> [output_filename]

Note For a detailed explanation of the command line, see the Run the sample application section of the Run the Unmodified Samples topic.

Methods

The ProcessSample class contains two methods: the main(String args[]) method and the ProcessSample(VWSession, Logger) method, which is the constructor.

main(String args[])

The main method uses common techniques for validating and defaulting argument values. The default value for the log output file is ProcessSample.out. The main method constructs and passes vwSession and Loggerobjects to the sample constructor. Main() handles the login and logoff for the session with  the login() and logoff() methods of the sample SessionHelper class. It provides workflow logging with an instance of the sample Logger class. The main method passes the session and logger to the constructor method.

ProcessSample(VWSession vwSession, Logger logger)

The constructor ProcessSample(VWSession, Logger) performs common exception handling and invokes the RosterHelper.displayProcessInformation() method with the following two lines of code:

// create the roster helper object

rosterHelper = new RosterHelper(vwSession, logger);

// display the process information in the roster

rosterHelper.displayProcessInformation();