Package javax.management.remote

Examples of javax.management.remote.JMXServiceURL


   * @param serviceURL The JMXService URL
   * @param server The MBeanServer to expose
   */
  public static void fireUpJMXServer(final String bindInterface, final int serverSocketBacklog, CharSequence serviceURL, MBeanServer server) {
    try {
      fireUpJMXServer(bindInterface, serverSocketBacklog, new JMXServiceURL(serviceURL.toString()), server);
    } catch (Exception e) {
      throw new RuntimeException("Failed to start JMXServer on [" + serviceURL + "]", e);
    }
  }
View Full Code Here


      try
      {
         if (jmxConnector == null)
         {
            log.fine("Connecting JMXConnector to: " + urlString);
            JMXServiceURL serviceURL = new JMXServiceURL(urlString);
            jmxConnector = JMXConnectorFactory.connect(serviceURL, null);
         }
         return jmxConnector.getMBeanServerConnection();
      }
      catch (IOException ex)
View Full Code Here

   @Override
   public QuartzInstance initInstance(QuartzConfig config) throws Exception
   {
      Map<String, String[]> env = new HashMap<String, String[]>();
      env.put(JMXConnector.CREDENTIALS, new String[]{config.getUserName(), config.getPassword()});
      JMXServiceURL jmxServiceURL = JMXUtil.createQuartzInstanceConnection(config);
      JMXConnector connector = JMXConnectorFactory.connect(jmxServiceURL, env);
      MBeanServerConnection connection = connector.getMBeanServerConnection();

      ObjectName mBName = new ObjectName("quartz:type=QuartzScheduler,*");
      Set<ObjectName> names = connection.queryNames(mBName, null);
View Full Code Here

  public static JMXServiceURL createQuartzInstanceConnection(QuartzConfig quartzConfig)
      throws MalformedURLException {
    StringBuffer stringBuffer = new StringBuffer().append("service:jmx:rmi:///jndi/rmi://")
        .append(quartzConfig.getHost()).append(":").append(quartzConfig.getPort())
        .append("/jmxrmi");
    JMXServiceURL jmxServiceURL = new JMXServiceURL(stringBuffer.toString());
    return jmxServiceURL;
  }
View Full Code Here

        return connection;
    }

    public JMXServiceURL getRemoteJMXURL() {
        try {
            return new JMXServiceURL("service:jmx:remoting-jmx://" + NetworkUtils.formatPossibleIpv6Address(mgmtAddress) + ":" + mgmtPort);
        } catch (Exception e) {
            throw new RuntimeException("Could not create JMXServiceURL:" + this, e);
        }
    }
View Full Code Here

     *   @param  credentials credentials for authentication
     *   @return the JGDI Proxy object
     */
    public static JGDIProxy newJMXInstance(String host, int port, Object credentials) {

        JMXServiceURL url;
        try {
            url = new JMXServiceURL(String.format("service:jmx:rmi:///jndi/rmi://%s:%d/jmxrmi", host, port));
        } catch (MalformedURLException ex) {
            throw new IllegalStateException("Invalid JMX url", ex);
        }

        return new JGDIProxy(url, credentials);
View Full Code Here

        final String password = config.remove("password");
        final String mbean_domains = config.remove("mbean_domains");
        final String jmxGlassFishConnectorString =
            "service:jmx:rmi:///jndi/rmi://" + host + ":" + port + "/jmxrmi";
        try {
            final JMXServiceURL jmxUrl =
                new JMXServiceURL(jmxGlassFishConnectorString);
            final Map<String,String[]> jmxEnv = new HashMap<String, String[]>();
            final String[] credentials = new String[] {username, password};
            jmxEnv.put( JMXConnector.CREDENTIALS, credentials );
            final JMXConnector connector =
                JMXConnectorFactory.connect(jmxUrl, jmxEnv);
View Full Code Here

    } else {
      try {
        // Create a new MBeanServer with the given serviceUrl
        server = MBeanServerFactory.newMBeanServer();
        JMXConnectorServer connector = JMXConnectorServerFactory
                .newJMXConnectorServer(new JMXServiceURL(jmxConfig.serviceUrl),
                        null, server);
        connector.start();
        LOG.info("JMX monitoring is enabled at " + jmxConfig.serviceUrl);
      } catch (Exception e) {
        // Release the reference
View Full Code Here

        String effectiveUrl = definition.getUrl();
        effectiveUrl = ActionPlaceholders.substituteNode(effectiveUrl, nodeAddress);
        effectiveUrl = ActionPlaceholders.substituteExecution(effectiveUrl, scheduleExecutionId);

        try {
            JMXServiceURL jmxUrl = new JMXServiceURL(effectiveUrl);

            return processJmxUrl(jmxUrl, definition);
        } catch (Exception e) {
            LOGGER.debug("Fail to execute jmx call", e);
            return produceExceptionalResult(e);
View Full Code Here

        Map<String, Object> environment = new HashMap<String, Object>();
        environment.put("com.sun.management.jmxremote.ssl", "false");
        environment.put("com.sun.management.jmxremote.local.only", "false");
        environment.put(JMXConnectorServer.AUTHENTICATOR, new JmxAuthenticator("user", "pass"));

        JMXServiceURL jmxUrl = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:" + JMX_SERVER_PORT + "/server");

        MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();

        SampleJmxService mbean = new SampleJmxService();
View Full Code Here

TOP

Related Classes of javax.management.remote.JMXServiceURL

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.