@Test public void readSemaphoreConfig() { String xml = "<hazelcast>\n" + " <semaphore name=\"default\">\n" + " <initial-permits>1</initial-permits>\n" + " </semaphore>" + " <semaphore name=\"custom\">\n" + " <initial-permits>10</initial-permits>\n" + " <semaphore-factory enabled=\"true\">" + " <class-name>com.acme.MySemaphore</class-name>\n" + " </semaphore-factory>" + " </semaphore>" + "</hazelcast>"; ByteArrayInputStream bis = new ByteArrayInputStream(xml.getBytes()); XmlConfigBuilder configBuilder = new XmlConfigBuilder(bis); Config config = configBuilder.build(); SemaphoreConfig defaultConfig = config.getSemaphoreConfig("default"); SemaphoreConfig customConfig = config.getSemaphoreConfig("custom"); assertEquals(1, defaultConfig.getInitialPermits()); assertFalse(defaultConfig.isFactoryEnabled()); assertNull(defaultConfig.getFactoryClassName()); assertEquals(10, customConfig.getInitialPermits()); assertTrue(customConfig.isFactoryEnabled()); assertEquals("com.acme.MySemaphore", customConfig.getFactoryClassName()); }
public Config build() { Config config = new Config(); config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false); return build(config); }
XmlConfigBuilder extends AbstractXmlConfigHelper implements ConfigBuilder { public Config build() { Config config = new Config(); config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false); return build(config); } }
XmlConfigBuilder extends AbstractXmlConfigHelper implements ConfigBuilder { public Config build() { Config config = new Config(); config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false); return build(config); } XmlConfigBuilder(String xmlFileName);  XmlConfigBuilder(InputStream inputStream);  XmlConfigBuilder(); }
XmlConfigBuilder extends AbstractXmlConfigHelper implements ConfigBuilder { public Config build() { Config config = new Config(); config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false); return build(config); } XmlConfigBuilder(String xmlFileName);  XmlConfigBuilder(InputStream inputStream);  XmlConfigBuilder(); Config build(); Config build(Config config); Config build(Element element); }
XmlConfigBuilder extends AbstractXmlConfigHelper implements ConfigBuilder { public Config build() { Config config = new Config(); config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false); return build(config); } XmlConfigBuilder(String xmlFileName);  XmlConfigBuilder(InputStream inputStream);  XmlConfigBuilder(); Config build(); Config build(Config config); Config build(Element element);  }