Package javax.management

Examples of javax.management.JMException


      String[] credentials = new String[] { username, password };
      env.put(JMXConnector.CREDENTIALS, credentials);

      jmxc = JMXConnectorFactory.connect(url, env);
  } catch (Exception e)  {
      JMException jme
    = new JMException("Caught exception when creating JMXConnector");
      jme.initCause(e);

      throw (jme);
  }

        return (jmxc);
View Full Code Here


      System.out.println("\tport: " + port);
      System.out.println("\tconnector: " + connectorName);
      */

  } catch (Exception e)  {
      JMException jme
    = new JMException("Caught exception when parsing address: "
          + addr);
      jme.initCause(e);

      throw (jme);
  }

  /*
  System.out.println("host: " + host);
  System.out.println("port: " + port);
  System.out.println("connectorName: " + connectorName);
  */

  try  {
      pmc = new GenericPortMapperClient(host, port);

      /*
       * Should add code to check/compare version of client runtime and
       * broker here.
       */

  } catch (Exception e)  {
      JMException jme
    = new JMException("Caught exception when contacing portmapper.");
      jme.initCause(e);

      throw (jme);
  }

  urlString = pmc.getProperty("url", null, "JMX", connectorName);

  if (urlString == null)  {
      JMException jme = new JMException("No JMXServiceURL was found for connector "
      + connectorName + ".\n"
      + "Address used: "
      + addr);

      throw (jme);
  }

  try  {
      url = new JMXServiceURL(urlString);
  } catch (MalformedURLException mfe)  {
      JMException jme
    = new JMException("Caught exception when creating JMXServiceURL.");
      jme.initCause(mfe);

      throw (jme);
  }
 
  return (url);
View Full Code Here

        try
        {
            AMQChannel channel = _protocolSession.getChannel(channelId);
            if (channel == null)
            {
                throw new JMException("The channel (channel Id = " + channelId + ") does not exist");
            }

            _protocolSession.commitTransactions(channel);
        }
        catch (AMQException ex)
View Full Code Here

        try
        {
            AMQChannel channel = _protocolSession.getChannel(channelId);
            if (channel == null)
            {
                throw new JMException("The channel (channel Id = " + channelId + ") does not exist");
            }

            _protocolSession.rollbackTransactions(channel);
        }
        catch (AMQException ex)
View Full Code Here

            RequiredModelMBean mbean = (RequiredModelMBean)server.instantiate(RequiredModelMBean.class.getName());
            mbean.setModelMBeanInfo(mbi);
            try {
                mbean.setManagedResource(obj, "ObjectReference");
            } catch (InvalidTargetObjectTypeException itotex) {
                throw new JMException(itotex.getMessage());
            }
            registerMBeanWithServer(mbean, name, forceRegistration);
        }
    }
View Full Code Here

                            (RequiredModelMBean)mbs.instantiate("javax.management.modelmbean.RequiredModelMBean");
                        rtMBean.setModelMBeanInfo(mbi);
                        try {
                            rtMBean.setManagedResource(managedEndpoint, "ObjectReference");
                        } catch (InvalidTargetObjectTypeException itotex) {
                            throw new JMException(itotex.getMessage());
                        }
                        ObjectName name = managedEndpoint.getObjectName();
                        instrumentationManager.register(rtMBean, name);
                        modelMBean = rtMBean;
                    } catch (JMException jmex) {
View Full Code Here

            return _store.getDurability();
        }
        catch (RuntimeException e)
        {
            LOGGER.debug("Failed query replication policy", e);
            throw new JMException(e.getMessage());
        }
    }
View Full Code Here

            return _store.getNodeState();
        }
        catch (RuntimeException e)
        {
            LOGGER.debug("Failed query node state", e);
            throw new JMException(e.getMessage());
        }
    }
View Full Code Here

            return _store.isDesignatedPrimary();
        }
        catch (RuntimeException e)
        {
            LOGGER.debug("Failed query designated primary", e);
            throw new JMException(e.getMessage());
        }
    }
View Full Code Here

            _store.removeNodeFromGroup(nodeName);
        }
        catch (AMQStoreException e)
        {
            LOGGER.error("Failed to remove node " + nodeName + " from group", e);
            throw new JMException(e.getMessage());
        }
    }
View Full Code Here

TOP

Related Classes of javax.management.JMException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.