src/main/java/org/lazydog/mbean/utility/MBeanUtility.java
public static ObjectName getObjectName(Class interfaceClass, Hashtable<String,String> table) {

        

        // Check if the interface class is valid.
        if (interfaceClass == null) {
            throw new IllegalArgumentException("The interface class is invalid.");
        }

        ObjectName objectName;
        
        try {

            // Check if the table is null.
            if (table == null) {

                // Initialize the table.
                table = new Hashtable<String,String>();
            }

            // Add the "type" to the table.
            table.put("type", interfaceClass.getSimpleName());

            // Get the MBean object name.
            objectName = ObjectName.getInstance(interfaceClass.getPackage().getName(), table);
        } catch (MalformedObjectNameException e) {
            throw new IllegalArgumentException(
                    "Unable to get the MBean object name for "
                    + interfaceClass.getName() + ".", e);
        }

        return objectName;
    }
public static ObjectName getObjectName(Class interfaceClass, Hashtable<String,String> table) {

        

        // Check if the interface class is valid.
        if (interfaceClass == null) {
            throw new IllegalArgumentException("The interface class is invalid.");
        }

        ObjectName objectName;
        
        try {

            // Check if the table is null.
            if (table == null) {

                // Initialize the table.
                table = new Hashtable<String,String>();
            }

            // Add the "type" to the table.
            table.put("type", interfaceClass.getSimpleName());

            // Get the MBean object name.
            objectName = ObjectName.getInstance(interfaceClass.getPackage().getName(), table);
        } catch (MalformedObjectNameException e) {
            throw new IllegalArgumentException(
                    "Unable to get the MBean object name for "
                    + interfaceClass.getName() + ".", e);
        }

        return objectName;
    }
Get the MBean object name.

@param  interfaceClass  the MBean interface class.
@param  table           the properties table.

@return  the MBean object name.

@throws  IllegalArgumentException  if the interface class is invalid or
unable to get the MBean object name.