if (mbean == null) {
throw new IllegalArgumentException();
}
MfObjectFactory objectFactory =
MfObjectFactory.getObjectFactory(_context.getModuleName());
Hashtable map = new Hashtable();
String mbeanName = mbean.getAttribute("name").trim();
try {
String delegateClassName = mbean.getAttribute("type").trim();
Class c = (Class) Class.forName(delegateClassName).newInstance();
map.put(mbeanName, c);
} catch (ClassNotFoundException cnfe) {
LogDomains.getLogger().fine("Error: " + cnfe.getMessage()
+ ". Using default delegate class.");
// use default delegate class
map.put(mbeanName, DefaultDelegate.class);
}
// delegate factory
MfDelegateFactory delegateFactory=objectFactory.getDelegateFactory(map);
// jxm connection to the application server
MBeanServerConnection mbs = getConnection();
CMM_MBean sourceMbean = null;
String objectName = ConfigReader.getMBeanObjectName(mbean, false);
String tokenizedON =
ObjectNameHelper.tokenize(objectName, _context.getTokens());
// if cmm mbean is not created
if (!objectFactory.isObjectCreated(tokenizedON)) {
sourceMbean = objectFactory.createObject(tokenizedON);
// sets up the delegate
String proxyObjectName=ConfigReader.getMBeanObjectName(mbean, true);
String tokenizedPON =
ObjectNameHelper.tokenize(proxyObjectName,_context.getTokens());