private MBeanServerConnection getConnection() { MBeanServerConnection connection = this.connection; if (connection == null) { try { final Map<String, Object> env = new HashMap<>(); if (Authentication.username != null && !Authentication.username.isEmpty()) { // Only set this is there is a username as it disabled local authentication. env.put(CallbackHandler.class.getName(), Authentication.getCallbackHandler()); } if (config.getAuthenticationConfig() != null) { env.put("wildfly.config.url", config.getAuthenticationConfig()); } final JMXServiceURL serviceURL = getRemoteJMXURL(); final JMXConnector connector = this.connector = JMXConnectorFactory.connect(serviceURL, env); connection = this.connection = new MBeanConnectionProxy(connector.getMBeanServerConnection()); } catch (IOException e) { throw new RuntimeException(e); } } return connection; }
private MBeanServerConnection getConnection() { MBeanServerConnection connection = this.connection; if (connection == null) { try { final Map<String, Object> env = new HashMap<>(); if (Authentication.username != null && !Authentication.username.isEmpty()) { // Only set this is there is a username as it disabled local authentication. env.put(CallbackHandler.class.getName(), Authentication.getCallbackHandler()); } if (config.getAuthenticationConfig() != null) { env.put("wildfly.config.url", config.getAuthenticationConfig()); } final JMXServiceURL serviceURL = getRemoteJMXURL(); final JMXConnector connector = this.connector = JMXConnectorFactory.connect(serviceURL, env); connection = this.connection = new MBeanConnectionProxy(connector.getMBeanServerConnection()); } catch (IOException e) { throw new RuntimeException(e); } } return connection; }
@Override public void setup(T config) { containerConfig = config; final String authenticationConfig = containerConfig.getAuthenticationConfig(); // Check for an Elytron configuration if (authenticationConfig != null) { this.authenticationConfig = URI.create(authenticationConfig); } final ManagementClient client = new ManagementClient(new DelegatingModelControllerClient(mccProvider), containerConfig); managementClient.set(client); archiveDeployer.set(new ArchiveDeployer(client)); }
@Override public void setup(T config) { containerConfig = config; final String authenticationConfig = containerConfig.getAuthenticationConfig(); // Check for an Elytron configuration if (authenticationConfig != null) { this.authenticationConfig = URI.create(authenticationConfig); } final ManagementClient client = new ManagementClient(new DelegatingModelControllerClient(mccProvider), containerConfig); managementClient.set(client); archiveDeployer.set(new ArchiveDeployer(client)); }