Listing the Status of the Current Activation Task Listing All Activation Tasks Stored in Memory

Managing a Domain’s Configuration with JMX 5-11 ActivationTaskMBean instances in memory. To change the default, increase the value of the ConfigurationManagerMBean CompletedActivationTasksCount attribute. The following sections describe working with instances of ActivationTaskMBean: ■ Section 5.3.1, Listing the Status of the Current Activation Task ■ Section 5.3.2, Listing All Activation Tasks Stored in Memory ■ Section 5.3.3, Purging Completed Activation Tasks from Memory

5.3.1 Listing the Status of the Current Activation Task

When you invoke the activate operation, WebLogic Server returns an ActivationTaskMBean instance to represent the activation task. The ActivationTaskMBean State attribute describes the status of the activation task. This attribute stores an int value and ActivationTaskMBean defines constants for each of the int values. See ActivationTaskMBean in Oracle WebLogic Server MBean Reference. To list the status of the current activation task: 1. Start an edit session and change at least one MBean attribute. 2. Invoke the ConfigurationManagerMBean activatelong timeout operation and assign the output to a variable of type ActivationTaskMBean. 3. Get the value of the ActivationTaskMBean State attribute.

5.3.2 Listing All Activation Tasks Stored in Memory

The ActivationTaskMBean that the activate operation returns describes only a single activation task. The Administration Server keeps this ActivationTaskMBean in memory until you purge it see Section 5.3.3, Purging Completed Activation Tasks from Memory or the number of activation tasks exceeds the value of the ConfigurationManagerMBean CompletedActivationTasksCount attribute. To access all ActivationTaskMBean instances that are currently stored in memory see Example 5–5 : 1. Connect to the Edit MBean Server. You do not need to start an edit session. 2. Get the value of the ConfigurationManagerMBean CompletedActivationTasks attribute and assign the output to a variable of type Object[]. 3. Optional For each object in the array, get and print the value of ActivationTaskMBean attributes such as User and State. See ActivationTaskMBean in Oracle WebLogic Server MBean Reference. 4. Optional For each object in the array, get the value of the Changes attribute. Invoke Object.toString to output the value of the Change object. Example 5–5 Example Method that Lists All Activation Tasks in Memory public void listActivated throws Exception { ObjectName cfgMgr = ObjectName connection.getAttributeservice, ConfigurationManager; ObjectName[] list = ObjectName[]connection.getAttributecfgMgr, CompletedActivationTasks; System.out.printlnListing completed activation tasks.; 5-12 Developing Custom Management Utilities With JMX for Oracle WebLogic Server int length = int list.length; for int i = 0; i length; i++ { System.out.printlnActivation task + i; System.out.printlnUser who started activation: + connection.getAttributelist[i], User; System.out.printlnTask state: + connection.getAttributelist[i], State; System.out.printlnStart time: + connection.getAttributelist[i], StartTime; Object[] changes = Object[]connection.getAttributelist[i], Changes; int l = int changes.length; for int y = 0; y l; y++ { System.out.printlnChanges activated: + changes[y].toString; } } }

5.3.3 Purging Completed Activation Tasks from Memory