Example usage for javax.management MalformedObjectNameException getMessage

List of usage examples for javax.management MalformedObjectNameException getMessage

Introduction

In this page you can find the example usage for javax.management MalformedObjectNameException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:org.hyperic.hq.plugin.weblogic.jmx.ServerQuery.java

private ObjectName getLogMBean() {
    Hashtable attributes = new Hashtable();
    attributes.put("Name", getName());
    attributes.put("Location", getName());
    attributes.put("ServerConfig", getName());
    attributes.put("Type", "LogConfig");

    try {/*from   w  ww.ja va 2  s  . co m*/
        return new ObjectName(this.discover.getDomain(), attributes);
    } catch (MalformedObjectNameException e) {
        //wont happen.
        throw new IllegalArgumentException(e.getMessage());
    }
}

From source file:fullThreadDump.java

/**
* Constructs a ThreadMonitor object to get thread information in a remote
* JVM./*from  w w w.j  a v  a 2s .  co  m*/
 * @throws IOException 
*/
public ThreadMonitor(MBeanServerConnection server, boolean stats) throws IOException {
    this.server = server;
    this.stats = stats;
    this.tmbean = newPlatformMXBeanProxy(server, THREAD_MXBEAN_NAME, ThreadMXBean.class);
    try {
        objname = new ObjectName(THREAD_MXBEAN_NAME);
    } catch (MalformedObjectNameException e) {
        // should not reach here
        InternalError ie = new InternalError(e.getMessage());
        ie.initCause(e);
        throw ie;
    }
    parseMBeanInfo();
}

From source file:com.cisco.oss.foundation.monitoring.RMIMonitoringAgent.java

private void registerServices() {
    try {//from ww w  .  j  a  v a 2s.c o  m
        String strMonConfigObjectName = Utility.getObjectName("ServiceInfo", this.exposedObject);
        servicesObjectName = new ObjectName(strMonConfigObjectName);
        mbs.registerMBean(ServiceInfo.INSTANCE, servicesObjectName);
    } catch (MalformedObjectNameException e) {
        LOGGER.trace("Failed to register services" + e.getMessage());
    } catch (InstanceAlreadyExistsException e) {
        LOGGER.trace("Failed to register services" + e.getMessage());
    } catch (MBeanRegistrationException e) {
        LOGGER.trace("Failed to register services" + e.getMessage());
    } catch (NotCompliantMBeanException e) {
        LOGGER.trace("Failed to register services" + e.getMessage());
    }

}

From source file:com.cisco.oss.foundation.monitoring.RMIMonitoringAgent.java

private void registerConnections() {
    try {/*w  ww  .  j  av  a  2  s .c o  m*/
        String strMonConfigObjectName = Utility.getObjectName("ConnectionInfo", this.exposedObject);
        connetctionsObjectName = new ObjectName(strMonConfigObjectName);
        mbs.registerMBean(ConnectionInfo.INSTANCE, connetctionsObjectName);
    } catch (MalformedObjectNameException e) {
        LOGGER.trace("Failed to register connetctions" + e.getMessage());
    } catch (InstanceAlreadyExistsException e) {
        LOGGER.trace("Failed to register connetctions" + e.getMessage());
    } catch (MBeanRegistrationException e) {
        LOGGER.trace("Failed to register connetctions" + e.getMessage());
    } catch (NotCompliantMBeanException e) {
        LOGGER.trace("Failed to register connetctions" + e.getMessage());
    }
}

From source file:com.cisco.oss.foundation.monitoring.RMIMonitoringAgent.java

private void registerNotificationDetails() {
    try {/* www .j  av  a 2 s  .  co  m*/
        notificationDetails = new NotificationMXBean();
        String strNotifObjectName = Utility.getObjectName("NotificationMXBean", this.exposedObject);
        notificationObjectName = new ObjectName(strNotifObjectName);
        mbs.registerMBean(notificationDetails, notificationObjectName);
        isNotificationRegistered = true;
    } catch (MalformedObjectNameException e) {
        LOGGER.trace("Failed to register services" + e.getMessage());
    } catch (InstanceAlreadyExistsException e) {
        LOGGER.trace("Failed to register services" + e.getMessage());
    } catch (MBeanRegistrationException e) {
        LOGGER.trace("Failed to register services" + e.getMessage());
    } catch (NotCompliantMBeanException e) {
        LOGGER.trace("Failed to register services" + e.getMessage());
    } catch (IllegalArgumentException e) {
        LOGGER.trace("Failed to register services" + e.getMessage());
    }

}

From source file:com.pivotal.gemfire.tools.pulse.internal.data.JMXDataUpdater.java

/**
 * constructor used for creating JMX connection
 *///from w w  w. j  a v a 2 s. c o  m
public JMXDataUpdater(String server, String port, Cluster cluster) {
    this.serverName = server;
    this.port = port;
    this.userName = cluster.getJmxUserName();
    this.userPassword = cluster.getJmxUserPassword();
    this.cluster = cluster;

    try {
        // Initialize MBean object names
        this.MBEAN_OBJECT_NAME_SYSTEM_DISTRIBUTED = new ObjectName(
                PulseConstants.OBJECT_NAME_SYSTEM_DISTRIBUTED);
        this.MBEAN_OBJECT_NAME_REGION_DISTRIBUTED = new ObjectName(
                PulseConstants.OBJECT_NAME_REGION_DISTRIBUTED);
        this.MBEAN_OBJECT_NAME_MEMBER_MANAGER = new ObjectName(PulseConstants.OBJECT_NAME_MEMBER_MANAGER);
        this.MBEAN_OBJECT_NAME_MEMBER = new ObjectName(PulseConstants.OBJECT_NAME_MEMBER);
        this.MBEAN_OBJECT_NAME_STATEMENT_DISTRIBUTED = new ObjectName(
                PulseConstants.OBJECT_NAME_STATEMENT_DISTRIBUTED);

        // For GemFireXD
        if (PulseConstants.PRODUCT_NAME_GEMFIREXD.equalsIgnoreCase(PulseController.getPulseProductSupport())) {
            this.MBEAN_OBJECT_NAME_TABLE_AGGREGATE = new ObjectName(PulseConstants.OBJECT_NAME_TABLE_AGGREGATE);
        }

    } catch (MalformedObjectNameException e) {
        if (LOGGER.severeEnabled()) {
            LOGGER.severe(e.getMessage(), e);
        }
    } catch (NullPointerException e) {
        if (LOGGER.severeEnabled()) {
            LOGGER.severe(e.getMessage(), e);
        }
    }

}

From source file:com.impetus.ankush2.cassandra.monitor.CassandraClusterMonitor.java

private void columnfamilies() {
    String keyspace = (String) parameterMap.get("keyspace");
    if (keyspace == null || keyspace.isEmpty()) {
        addAndLogError("Keyspace is missing.");
        return;/*from w  w  w  .  ja  va 2  s  .  com*/
    }
    try {
        for (String publicIp : CassandraUtils.getCassandraActiveNodes(componentConfig.getNodes().keySet())) {
            JmxUtil jmxUtil = getJMXConnection(publicIp,
                    (Integer) advanceConf.get(CassandraConstants.ClusterProperties.JMX_PORT));
            if (jmxUtil == null) {
                continue;
            }

            Set columnFamilySet = getColumnFamilyList(keyspace, jmxUtil, "*");
            List<ColumnFamily> lstColumnFamily = new ArrayList<ColumnFamily>();

            Iterator iter = columnFamilySet.iterator();
            while (iter.hasNext()) {
                String objectName = iter.next().toString();
                List<String> jmxObjectList = new ArrayList<String>(Arrays.asList(objectName.split("=")));
                ObjectName mObjCF = new ObjectName(objectName);
                String cfName = jmxObjectList.get(jmxObjectList.size() - 1);
                Object liveSSTableCount = jmxUtil.getAttribute(mObjCF,
                        CassandraConstants.Cassandra_JMX_Attributes.CASSANDRA_JMX_ATTRIBUTE_LIVESSTABLECOUNT);
                Object writelatency = jmxUtil.getAttribute(mObjCF,
                        CassandraConstants.Cassandra_JMX_Attributes.CASSANDRA_JMX_ATTRIBUTE_WRITELATENCY);
                Object readlatency = jmxUtil.getAttribute(mObjCF,
                        CassandraConstants.Cassandra_JMX_Attributes.CASSANDRA_JMX_ATTRIBUTE_READLATENCY);
                Object pendingTasks = jmxUtil.getAttribute(mObjCF,
                        CassandraConstants.Cassandra_JMX_Attributes.CASSANDRA_JMX_ATTRIBUTE_PENDINGTASKS);
                if (liveSSTableCount == null || writelatency == null || readlatency == null
                        || pendingTasks == null) {
                    throw new AnkushException("Could not get Column family details.");
                }
                ColumnFamily cf = new ColumnFamily();
                cf.setColumnFamilyName(cfName);
                cf.setLiveSSTableCount(liveSSTableCount);
                cf.setWritelatency(writelatency);
                cf.setReadLatency(readlatency);
                cf.setPendingTasks(pendingTasks);
                lstColumnFamily.add(cf);
            }
            result.put("ColumnFamilies", lstColumnFamily);
            return;
        }
        addAndLogError("Unable to fetch Keyspace Details as all nodes are down");
    } catch (MalformedObjectNameException e) {
        addAndLogError("Unable to fetch Keyspace Details");
    } catch (NullPointerException e) {
        addAndLogError("Unable to fetch Keyspace Details");
    } catch (AnkushException e) {
        addAndLogError(e.getMessage());
    }
}

From source file:edu.nwpu.gemfire.monitor.data.JMXDataUpdater.java

/**
 * constructor used for creating JMX connection
 *//*w  ww. j a  v  a 2  s  .  c  o  m*/
public JMXDataUpdater(String server, String port, Cluster cluster) {
    this.serverName = server;
    this.port = port;
    this.userName = cluster.getJmxUserName();
    this.userPassword = cluster.getJmxUserPassword();
    this.cluster = cluster;

    try {
        // Initialize MBean object names
        this.MBEAN_OBJECT_NAME_SYSTEM_DISTRIBUTED = new ObjectName(
                PulseConstants.OBJECT_NAME_SYSTEM_DISTRIBUTED);
        this.MBEAN_OBJECT_NAME_REGION_DISTRIBUTED = new ObjectName(
                PulseConstants.OBJECT_NAME_REGION_DISTRIBUTED);
        this.MBEAN_OBJECT_NAME_MEMBER_MANAGER = new ObjectName(PulseConstants.OBJECT_NAME_MEMBER_MANAGER);
        this.MBEAN_OBJECT_NAME_MEMBER = new ObjectName(PulseConstants.OBJECT_NAME_MEMBER);
        this.MBEAN_OBJECT_NAME_STATEMENT_DISTRIBUTED = new ObjectName(
                PulseConstants.OBJECT_NAME_STATEMENT_DISTRIBUTED);

        // For SQLFire
        if (PulseConstants.PRODUCT_NAME_SQLFIRE.equalsIgnoreCase(PulseController.getPulseProductSupport())) {
            this.MBEAN_OBJECT_NAME_TABLE_AGGREGATE = new ObjectName(PulseConstants.OBJECT_NAME_TABLE_AGGREGATE);
        }

    } catch (MalformedObjectNameException e) {
        if (LOGGER.severeEnabled()) {
            LOGGER.severe(e.getMessage(), e);
        }
    } catch (NullPointerException e) {
        if (LOGGER.severeEnabled()) {
            LOGGER.severe(e.getMessage(), e);
        }
    }

}