use of org.apache.geode.management.internal.security.AccessControlMBean in project geode by apache.
the class ManagementAgent method registerAccessControlMBean.
private void registerAccessControlMBean() {
try {
AccessControlMBean acc = new AccessControlMBean();
ObjectName accessControlMBeanON = new ObjectName(ResourceConstants.OBJECT_NAME_ACCESSCONTROL);
MBeanServer platformMBeanServer = ManagementFactory.getPlatformMBeanServer();
Set<ObjectName> names = platformMBeanServer.queryNames(accessControlMBeanON, null);
if (names.isEmpty()) {
try {
platformMBeanServer.registerMBean(acc, accessControlMBeanON);
logger.info("Registered AccessControlMBean on " + accessControlMBeanON);
} catch (InstanceAlreadyExistsException | MBeanRegistrationException | NotCompliantMBeanException e) {
throw new GemFireConfigException("Error while configuring accesscontrol for jmx resource", e);
}
}
} catch (MalformedObjectNameException e) {
throw new GemFireConfigException("Error while configuring accesscontrol for jmx resource", e);
}
}
Aggregations