Package javax.management.remote

Examples of javax.management.remote.JMXServiceURL


        catch(UnknownHostException ex)
        {
            localHost="127.0.0.1";
        }
        final String hostname = localHost;
        final JMXServiceURL externalUrl = new JMXServiceURL(
                "service:jmx:rmi://"+hostname+":"+(_jmxPortConnectorServer)+"/jndi/rmi://"+hostname+":"+_jmxPortRegistryServer+"/jmxrmi");

        final JMXServiceURL internalUrl = new JMXServiceURL("rmi", hostname, _jmxPortConnectorServer);
        _cs = new RMIConnectorServer(internalUrl, env, rmiConnectorServerStub, _mbeanServer)
        {
            @Override
            public synchronized void start() throws IOException
            {
View Full Code Here


    public void setUrlPath(String urlPath) {
        this.urlPath = urlPath;
    }

    public void doStart() throws Exception {
        jmxServiceURL = new JMXServiceURL(protocol, host, port, urlPath);
        Authenticator authenticator = null;
        Map env = new HashMap();
        if (applicationConfigName != null) {
            authenticator = new Authenticator(applicationConfigName, classLoader);
            env.put(JMXConnectorServer.AUTHENTICATOR, authenticator);
View Full Code Here

            SslRMIClientSocketFactory csf = new SslRMIClientSocketFactory();
            map.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, csf);
        }
    Kernel kernel = null;
    try {
      JMXServiceURL address = new JMXServiceURL(
          "service:jmx:rmi:///jndi/rmi://" + host + ":" + port + connectorName);
      JMXConnector jmxConnector = JMXConnectorFactory.connect(address, map);
      MBeanServerConnection mbServerConnection = jmxConnector.getMBeanServerConnection();
      kernel = new KernelDelegate(mbServerConnection);
    } catch (MalformedURLException e) {
View Full Code Here

            SslRMIClientSocketFactory csf = new SslRMIClientSocketFactory();
            map.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, csf);
        }
        Kernel kernel = null;
        try {
            JMXServiceURL address = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + host + ":" + port
                    + connectorName);
            JMXConnector jmxConnector = JMXConnectorFactory.connect(address, map);
            MBeanServerConnection mbServerConnection = jmxConnector.getMBeanServerConnection();
            kernel = new KernelDelegate(mbServerConnection);
        } catch (MalformedURLException e) {
View Full Code Here

    public ServerProxy(final String url, final String username, final String password) throws Exception {
        assert url != null;
        assert username != null;
        assert password != null;
       
        this.url = new JMXServiceURL(url);
        this.environment = new HashMap();
        this.environment.put("jmx.remote.credentials", new String[] {username, password});

        log.debug("Initialized with URL: " + url + ", environment: " + environment);
    }
View Full Code Here

  public Kernel getRunningKernel() throws IOException {
    Map map = new HashMap();
    map.put("jmx.remote.credentials", new String[] { user, password });
    Kernel kernel = null;
    try {
      JMXServiceURL address = new JMXServiceURL(
          "service:jmx:rmi:///jndi/rmi://localhost" + ":" + port + "/JMXConnector");
      JMXConnector jmxConnector = JMXConnectorFactory.connect(address, map);
      MBeanServerConnection mbServerConnection = jmxConnector.getMBeanServerConnection();
      kernel = new KernelDelegate(mbServerConnection);
    } catch (MalformedURLException e) {
View Full Code Here

        Map environment = new HashMap();
        String[] credentials = new String[]{username, password};
        environment.put(JMXConnector.CREDENTIALS, credentials);
        environment.put(JMXConnectorFactory.DEFAULT_CLASS_LOADER, BaseDeploymentFactory.class.getClassLoader());
        try {
            JMXServiceURL address = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://"+params.getHost()+":"+params.getPort()+"/JMXConnector");
            JMXConnector jmxConnector = JMXConnectorFactory.connect(address, environment);
            RemoteDeploymentManager manager = getRemoteDeploymentManager();
            manager.init(jmxConnector, params.getHost());
            if(!manager.isSameMachine()) {
                manager.setAuthentication(username, password);
View Full Code Here

        Map env = new HashMap();

        try
        {
            // Convert the serviceUrl string to instance of JMXServiceURL
            JMXServiceURL address = new JMXServiceURL(parameter.getJmxServiceURL());

            JMXConnectorServer server = javax.management.remote.JMXConnectorServerFactory
                    .newJMXConnectorServer(address, env, null);

            return server;
View Full Code Here

     *
     * @throws IOException on connection failures
     */
    private void connect() throws IOException
    {
        JMXServiceURL jmxUrl = new JMXServiceURL(String.format(fmtUrl, host, port));
        Map<String,Object> env = new HashMap<String,Object>();
        if (username != null)
        {
            String[] creds = { username, password };
            env.put(JMXConnector.CREDENTIALS, creds);
View Full Code Here

      int portNum = configuration.getJmxPort();
      String domainRuntimeMBeanServerURL = "/jndi/weblogic.management.mbeanservers.domainruntime";

      try
      {
         JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname, portNum, domainRuntimeMBeanServerURL);
         Map<String, String> props = new HashMap<String, String>();
         props.put(Context.SECURITY_PRINCIPAL, configuration.getAdminUserName());
         props.put(Context.SECURITY_CREDENTIALS, configuration.getAdminPassword());
         props.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, "weblogic.management.remote");
         connector = JMXConnectorFactory.connect(serviceURL, props);
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.