use of com.hazelcast.config.ServiceConfig in project hazelcast by hazelcast.
the class MultiMapTransactionStressTest method createConfigWithDummyTxService.
private Config createConfigWithDummyTxService() {
Config config = new Config();
ServicesConfig servicesConfig = config.getServicesConfig();
servicesConfig.addServiceConfig(new ServiceConfig().setName(DUMMY_TX_SERVICE).setEnabled(true).setImplementation(new MapTransactionStressTest.DummyTransactionalService(DUMMY_TX_SERVICE)));
return config;
}
use of com.hazelcast.config.ServiceConfig in project hazelcast by hazelcast.
the class ProxyFactoryTest method setup.
@Before
public void setup() {
Config config = new Config();
ServiceConfig serviceConfig = new ServiceConfig();
serviceConfig.setEnabled(true).setName(SERVICE_NAME).setImplementation(new CustomService());
config.getServicesConfig().addServiceConfig(serviceConfig);
hazelcastFactory.newHazelcastInstance(config);
}
use of com.hazelcast.config.ServiceConfig in project hazelcast by hazelcast.
the class TestFullApplicationContext method testServiceConfig.
@Test
public void testServiceConfig() {
ServiceConfig serviceConfig = config.getServicesConfig().getServiceConfig("my-service");
assertEquals("com.hazelcast.spring.MyService", serviceConfig.getClassName());
assertEquals("prop1-value", serviceConfig.getProperties().getProperty("prop1"));
assertEquals("prop2-value", serviceConfig.getProperties().getProperty("prop2"));
MyServiceConfig configObject = (MyServiceConfig) serviceConfig.getConfigObject();
assertNotNull(configObject);
assertEquals("prop1", configObject.stringProp);
assertEquals(123, configObject.intProp);
assertTrue(configObject.boolProp);
Object impl = serviceConfig.getImplementation();
assertNotNull(impl);
assertTrue("expected service of class com.hazelcast.spring.MyService but it is " + impl.getClass().getName(), impl instanceof MyService);
}
use of com.hazelcast.config.ServiceConfig in project hazelcast by hazelcast.
the class ServiceManagerImpl method registerUserServices.
private void registerUserServices(ServicesConfig servicesConfig, Map<String, Properties> serviceProps, Map<String, Object> serviceConfigObjects) {
logger.finest("Registering user defined services...");
Collection<ServiceConfig> serviceConfigs = servicesConfig.getServiceConfigs();
for (ServiceConfig serviceConfig : serviceConfigs) {
registerUserService(serviceProps, serviceConfigObjects, serviceConfig);
}
}
use of com.hazelcast.config.ServiceConfig in project hazelcast by hazelcast.
the class OperationOutOfOrderBackupTest method setup.
@Before
public void setup() {
Config config = new Config();
ServiceConfig serviceConfig = new ServiceConfig().setImplementation(this.service).setName(ValueHolderService.NAME).setEnabled(true);
ConfigAccessor.getServicesConfig(config).addServiceConfig(serviceConfig);
TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory();
HazelcastInstance hz1 = factory.newHazelcastInstance(config);
HazelcastInstance hz2 = factory.newHazelcastInstance(config);
warmUpPartitions(hz2, hz1);
partitionId = getPartitionId(hz1);
nodeEngine1 = getNodeEngineImpl(hz1);
nodeEngine2 = getNodeEngineImpl(hz2);
}
Aggregations