@SuppressWarnings("deprecation") public JMXConnector newJMXConnector(JMXServiceURL serviceURL, Map<String, ?> environment) throws IOException { String protocol = serviceURL.getProtocol(); switch (protocol) { case PROTOCOL_REMOTE: case PROTOCOL_REMOTE_TLS: case PROTOCOL_REMOTING_JMX: case PROTOCOL_REMOTE_HTTP: case PROTOCOL_HTTP_REMOTING_JMX: case PROTOCOL_REMOTE_HTTPS: case PROTOCOL_HTTPS_REMOTING_JMX: return new RemotingConnector(serviceURL, environment); default: log.tracef("Protocol (%s) not recognised by this provider.", protocol); return null; } }
public void connect(Map<String, ?> env) throws IOException { try { internalConnect(env); } catch (Exception e) { close(); if (e instanceof RuntimeException) { throw (RuntimeException) e; } else if (e instanceof IOException) { throw (IOException) e; } else { // Added for completeness but this line should not be reachable. throw new IOException(e); } } }
public void connect() throws IOException { connect(null); }
public synchronized void close() throws IOException { log.trace("close()"); switch (state) { case UNUSED: case CLOSED: return; case OPEN: state = ConnectorState.CLOSED; } final ShutDownHook shutDownHook; if ((shutDownHook = this.shutDownHook) != null) { Runtime.getRuntime().removeShutdownHook(shutDownHook); this.shutDownHook = null; } safeClose(versionedConnection); safeClose(channel); safeClose(connection); safeClose(endpoint); }
public MBeanServerConnection getMBeanServerConnection(Subject delegationSubject) throws IOException { log.trace("getMBeanServerConnection(Subject)"); verifyConnected(); return versionedConnection.getMBeanServerConnection(delegationSubject); }
public MBeanServerConnection getMBeanServerConnection() throws IOException { log.trace("getMBeanServerConnection()"); return getMBeanServerConnection(null); }
public void run() { if (state == ConnectorState.OPEN) { try { shutDownHook = null; close(); } catch (IOException ignored) { } } } });
Connection connection = internalRemotingConnect(combinedEnvironment);
final SSLContext sslContext = tempContext; context = sslContext != null ? context.withSsl(MatchRule.ALL, () -> sslContext) : context; final IoFuture<Connection> futureConnection = endpoint.connect(convert(serviceUrl), getOptionMap(disabledMechanisms), context); IoFuture.Status result = futureConnection.await(getTimeoutValue(Timeout.CONNECTION, env), TimeUnit.SECONDS);
private void safeClose(final Channel channel) { if (channel != null) { try { channel.writeShutdown(); } catch (Exception ignored) { } } safeClose((Closeable) channel); }
public String getConnectionId() throws IOException { log.trace("getConnectionId()"); verifyConnected(); String connectionId = versionedConnection.getConnectionId(); log.debugf("Our connection id is '%s'", connectionId); return connectionId; }
public MBeanServerConnection getMBeanServerConnection() throws IOException { log.trace("getMBeanServerConnection()"); return getMBeanServerConnection(null); }
public void run() { if (state == ConnectorState.OPEN) { try { shutDownHook = null; close(); } catch (IOException ignored) { } } } });
Connection connection = internalRemotingConnect(combinedEnvironment);
final SSLContext sslContext = tempContext; context = sslContext != null ? context.withSsl(MatchRule.ALL, () -> sslContext) : context; final IoFuture<Connection> futureConnection = endpoint.connect(convert(serviceUrl), getOptionMap(disabledMechanisms), context); IoFuture.Status result = futureConnection.await(getTimeoutValue(Timeout.CONNECTION, env), TimeUnit.SECONDS);
public void connect(Map<String, ?> env) throws IOException { try { internalConnect(env); } catch (Exception e) { close(); if (e instanceof RuntimeException) { throw (RuntimeException) e; } else if (e instanceof IOException) { throw (IOException) e; } else { // Added for completeness but this line should not be reachable. throw new IOException(e); } } }
public synchronized void close() throws IOException { log.trace("close()"); switch (state) { case UNUSED: case CLOSED: return; case OPEN: state = ConnectorState.CLOSED; } final ShutDownHook shutDownHook; if ((shutDownHook = this.shutDownHook) != null) { Runtime.getRuntime().removeShutdownHook(shutDownHook); this.shutDownHook = null; } safeClose(versionedConnection); safeClose(channel); safeClose(connection); safeClose(endpoint); }
public MBeanServerConnection getMBeanServerConnection(Subject delegationSubject) throws IOException { log.trace("getMBeanServerConnection(Subject)"); verifyConnected(); return versionedConnection.getMBeanServerConnection(delegationSubject); }
public MBeanServerConnection getMBeanServerConnection() throws IOException { log.trace("getMBeanServerConnection()"); return getMBeanServerConnection(null); }
public void run() { if (state == ConnectorState.OPEN) { try { shutDownHook = null; close(); } catch (IOException ignored) { } } } });