use of org.apache.geode.GemFireConfigException 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);
}
}
use of org.apache.geode.GemFireConfigException in project geode by apache.
the class AutoBalancerJUnitTest method testMinimalConfiguration.
@Test
public void testMinimalConfiguration() {
AutoBalancer autoR = new AutoBalancer();
try {
autoR.init(null);
fail();
} catch (GemFireConfigException e) {
// expected
}
Properties props = getBasicConfig();
autoR.init(props);
}
use of org.apache.geode.GemFireConfigException in project geode by apache.
the class JettyHelperJUnitTest method testSetPortWithBindAddress.
@Test
public void testSetPortWithBindAddress() throws Exception {
try {
final Server jetty = JettyHelper.initJetty("10.123.50.1", 10480, SSLConfigurationFactory.getSSLConfigForComponent(SecurableCommunicationChannel.WEB));
assertNotNull(jetty);
assertNotNull(jetty.getConnectors()[0]);
assertEquals(10480, ((ServerConnector) jetty.getConnectors()[0]).getPort());
} catch (GemFireConfigException e) {
fail(e.getMessage());
}
}
Aggregations