package com.ibm.tivoli.itcam.j2se.jmxe;
/**
* This is interface of JMX Engine Plugin. If the J2SE application has
* an embeded JMX server which can not return MBeanServer by MBeanServerFactory.
findMBeanServer(null),
* then user needs to implement this interface to return a working MBeanServer
* instance.
*/
public interface JMXEnginePlugin {
/**
* The system passes necessary properties to user's implementation by this
function,
* for example, the PORT, USERNAME, PASSWORD to connect to JMX Server remotely.
*
* @param prop necessary properties to connect JMX Server
* @throws Exception user defined initialization error
*/
public void initialize(Properties prop) throws Exception;
/**
* Get MBeanServer for (un)registration of MBean
* @return a working MBeanServer that DC can (un)register MBean
*/
public MBeanServer getRegistrationMBeanServer();
/**
* This method is user's implementation to query attribute of a MBean
* from JMX Server. There is a default implementation from JMX engine
*
* @param proxy - object reference
* @param method - method name
* @param args - method arguments
*/
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable;
/**
* This method is user's implementation to compose ObjectName for those
* MBeans to be registered into JMX Server. There is a default implementation
* from MBeanManager. The string returned by user's function will be inserted
* before the string "Type=xxx, Name=yyy" which is returned from default function
* in MBeanManager.
* @param name : name of MBean.
* @param type : type of MBean.
* @param extraProp extra properties of MBean.
* @return The String of ObjectName
*/
public String buildObjectNameString(String domainName, String type, String name,
Properties extraPrope;
public final static String HOST = J2SELocalSettings.HOST;
public final static String PORT = J2SELocalSettings.PORT;
public final static String USERNAME = J2SELocalSettings.USERNAME;
public final static String PASSWORD = J2SELocalSettings.PASSWORD;
}