WLS 9.0 Management API – part 1

WLS 9.0 Management API – part 1
In WLS 5.1 when things were much more simpler, we had a weblogic.properties file that comprised all the configuration information. None of the configuration change was dynamic, i.e if you modified a configuration parameter, to apply the change you had to re-boot the server. WLS also had an applet based console.. :-) .
From 6.0 onwards, WLS built its Management layer on JMX 1.0 and introduced MBeans for programmatic access. The MBeans are broadly branched into 2 types, Configuration and Runtime. Configuration MBeans represented the configuration aspects of the WebLogic Server(example, ServerMBean) and the Runtime MBeans hosted all the runtime information pertaining to the Server (example, JVMRuntimeMBean). All of the configuration is stored in config.xml, which is not schema based and most of the configuration is hierarchical. WLS also started supporting dynamic change (atleast for some configuration parameters). If you made a change to the configuration, the change was applied instantaneously and the configuration file (config.xml) was updated (depending on the save domain trigger). There was only one MBeanServer that hosted all MBeans including the Configuration, Runtime and any Custom MBeans. Since in JMX 1.0 there is no remotable API to get to the MBeanServer from a client, WLS implemented MBeanHome and RemoteMBeanServer. Clients could lookup MBeanHome in JNDI and get access to RemoteMBeanServer and invoke on the MBeans.
Here’s what you would do to get to the ServerMBean.
……
Context ctx = null;
MBeanHome mbeanHome = null;
// assuming you know the user, password and url
try {
Environment env = new Environment();
env.setProviderUrl(url);
env.setSecurityPrincipal(user);
env.setSecurityCredentials(password);
ctx = env.getInitialContext();
mbeanHome = ( MBeanHome ) ctx.lookup(MBeanHome.LOCAL_JNDI_NAME);
ServerMBean svrBean = (ServerMBean) mbeanHome.getMBean(“myserver”,”Server”);
System.out.println(“ServerMBean retrieved “+svrBean.getName());
} catch (Exception e ) {
// handle exception
}

WLS also provided typed stubs on MBean interfaces, saving clients from writing straight JMX code. WLS introduced the WebApp based console and a command-line tool (weblogic.Admin) to manage the domain.
Well, thats the brief overview of what we had prior to WLS 9.0 Management. In my next entry we will discuss the new 9.0 management API.

_uacct = “UA-2684269-2″;
urchinTracker();

Comments are closed.