MBeanUtil.java Sample

This topic inludes the source code for the MBeanUtil.java Sample.

Sample Location

This sample is located in the following directory in your WebLogic Workshop installation:

BEA_HOME/weblogic81/samples/workshop/ExtensionDevKit/ControlDevKit/ControlFeatures/insertWizard/

Sample Source Code


01 package insertWizard; 
02 
03 import weblogic.management.MBeanHome;
04 import weblogic.management.Helper;
05 
06 /*
07  * Represents the server's MBean to the control.
08  */
09 public class MBeanUtil 
10 
11     public static MBeanHome getMBean(String userName, String password, String serverURL, 
12         String serverNamethrows IllegalArgumentException
13     {
14         MBeanHome requestedMBean = null;
15         try 
16             requestedMBean = (MBeanHome)Helper.getMBeanHome(userName, password, 
17                 serverURL, serverName);
18         catch (IllegalArgumentException iae) {
19             throw iae;
20         }
21         return requestedMBean;
22     }    
23