Java 8 SslRMIClientSocketFactory - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 SslRMIClientSocketFactory class.

This code example shows how to use the following methods:
            return null; 
        } 
        Map<String, Object> env = new HashMap<String, Object>();
        if ( useSSL )
        { 
            env.put( RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, new SslRMIClientSocketFactory() );
            env.put( RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, new SslRMIServerSocketFactory() );
        } 
        try 
        { 
            return JMXConnectorServerFactory.newJMXConnectorServer( url, env, server );
        } 
        catch ( IOException e )
        { 
            log.log( Level.WARNING, "Failed to start JMX Server", e );
            return null; 
        } 
    } 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
    if (rmiSSL) {
      if (rmiRegistryPort == rmiConnectorPort) {
        throw new IOException("SSL is enabled. " +
            "rmiConnectorPort cannot share with the rmiRegistryPort!"); 
      } 
      csf = new SslRMIClientSocketFactory();
      ssf = new SslRMIServerSocketFactory();
    } 
 
    if (csf != null) {
      jmxEnv.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, csf);
    } 
    if (ssf != null) {
      jmxEnv.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, ssf);
    } 
 
    // Configure authentication 
    if (authenticate) {
      jmxEnv.put("jmx.remote.x.password.file", passwordFile);
      jmxEnv.put("jmx.remote.x.access.file", accessFile);
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
This code example shows how to use the following methods:
            throw new JMXClientException(e);
        } 
 
    } 
 
    private static final SslRMIClientSocketFactory sslRMIClientSocketFactory = new SslRMIClientSocketFactory();
 
 
    private void checkSslConfig() throws IOException {
        // Get the reference to the RMI Registry and lookup RMIServer stub 
        Registry registry;
        try { 
            registry = LocateRegistry.getRegistry(this.hostName, this.port, sslRMIClientSocketFactory);
            try { 
                this.stub = (RMIServer) registry.lookup("jmxrmi");
            } 
            catch (NotBoundException nbe) {
                throw (IOException) new IOException(nbe.getMessage()).initCause(nbe);
            } 
        } 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
        Map<String, Object> map = new HashMap<String, Object>();
        map.put(JMXConnector.CREDENTIALS, new String[] { user, password });
        String connectorName = "/jmxrmi";
        if (secure) {
            connectorName = "/JMXSecureConnector";
            SslRMIClientSocketFactory csf = new SslRMIClientSocketFactory();
            map.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, csf);
        } 
        JMXServiceURL address = new JMXServiceURL(
                "service:jmx:rmi:///jndi/rmi://" + host + ":" + port + connectorName);
        JMXConnector jmxConnector = JMXConnectorFactory.connect(address, map);
        return jmxConnector.getMBeanServerConnection();
    } 
 
    public void shutdown(MBeanServerConnection mbServerConnection) throws Exception {
        Set<ObjectName> objectNameSet =
            mbServerConnection.queryNames(new ObjectName("osgi.core:type=framework,*"), null);
        if (objectNameSet.isEmpty()) {
            throw new Exception("Framework mbean not found");
        } else if (objectNameSet.size() == 1) {
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
         
        this.url = new JMXServiceURL(url);
        this.environment = new HashMap();
        this.environment.put(JMXConnector.CREDENTIALS, new String[] {username, password});
        if (secure) {
            SslRMIClientSocketFactory csf = new SslRMIClientSocketFactory();
            this.environment.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, csf);
        } 
 
        log.debug("Initialized with URL: " + url + ", environment: " + environment);
    } 
 
    public ServerProxy(JMXConnector connector) throws Exception {
        this.mbeanConnection = connector.getMBeanServerConnection();
    } 
     
    private static String createJMXServiceURL(String hostname, int port, boolean secure) {
        String connectorName = (secure) ? "/JMXSecureConnector" : "/jmxrmi";
        return "service:jmx:rmi://" + hostname + "/jndi/rmi://" + hostname + ":" + port + connectorName;
    } 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
            throw new JMXClientException(e);
        } 
 
    } 
 
    private static final SslRMIClientSocketFactory sslRMIClientSocketFactory = new SslRMIClientSocketFactory();
 
 
    private void checkSslConfig() throws IOException {
        // Get the reference to the RMI Registry and lookup RMIServer stub 
        Registry registry;
        try { 
            registry = LocateRegistry.getRegistry(this.hostName, this.port, sslRMIClientSocketFactory);
            try { 
                this.stub = (RMIServer) registry.lookup("jmxrmi");
            } 
            catch (NotBoundException nbe) {
                throw (IOException) new IOException(nbe.getMessage()).initCause(nbe);
            } 
        } 
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
	@Test(expected = NetworkReactiveAuditException.class)
	public void connect() 
			throws IOException
	{ 
        TestTools.strict.commit(); 
		new SslRMIClientSocketFactory().createSocket(null, 0);
	} 
} 
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Java 8 SslRMIClientSocketFactory Methods: