Add a way of configuring the RMI environment in InstrumentationManagerImpl
@@ -70,6 +70,7 @@ public class InstrumentationManagerImpl extends JMXConnectorPolicyType
private Set<ObjectName> busMBeans = new HashSet<>();
private boolean connectFailed;
private String persistentBusId;
+ private Map<String, ?> environment;
/**
* For backward compatibility, {@link #createMBServerConnectorFactory} is <code>true</code> by default.
@@ -126,6 +127,10 @@ public class InstrumentationManagerImpl extends JMXConnectorPolicyType
usePlatformMBeanServer = flag;
}
+ public void setEnvironment(Map<String, ?> env) {
+ environment = env;
+ }
+
@Deprecated
public void register() {
}
@@ -169,6 +174,7 @@ public class InstrumentationManagerImpl extends JMXConnectorPolicyType
mcf.setThreaded(isThreaded());
mcf.setDaemon(isDaemon());
mcf.setServiceUrl(getJMXServiceURL());
+ mcf.setEnvironment(environment);
try {
mcf.createConnector();
} catch (IOException ex) {
