The SystemStatus classes allow you to retrieve system status information and to retrieve and change system pool information. The SystemStatus object allows you to retrieve system status information including the following:
In addition to the methods within the SystemStatus class, you also can access SystemPool through SystemStatus. SystemPool allows you to get information about system pools and change system pool information.
This example shows you how to use caching with the SystemStatus class:
AS400 system = new AS400("MyAS400"); SystemStatus status = new SystemStatus(system); // Turn on caching. It is off by default. status.setCaching(true); // This will retrieve the value from the system. // Every subsequent call will use the cached value // instead of retrieving it from the system. int jobs = status.getJobsInSystem(); // ... Perform other operations here ... // This determines if caching is still enabled. if (status.isCaching()) { // This will retrieve the value from the cache. jobs = status.getJobsInSystem(); } // Go to the system next time, regardless if caching is enabled. status.refreshCache(); // This will retrieve the value from the system. jobs = status.getJobsInSystem(); // Turn off caching. Every subsequent call will go to the system. status.setCaching(false); // This will retrieve the value from the system. jobs = status.getJobsInSystem();