Search in sources :

Example 1 with ServiceConfig

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;
}
Also used : ServiceConfig(com.hazelcast.config.ServiceConfig) Config(com.hazelcast.config.Config) ServiceConfig(com.hazelcast.config.ServiceConfig) ServicesConfig(com.hazelcast.config.ServicesConfig) ServicesConfig(com.hazelcast.config.ServicesConfig)

Example 2 with ServiceConfig

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);
}
Also used : ServiceConfig(com.hazelcast.config.ServiceConfig) Config(com.hazelcast.config.Config) ProxyFactoryConfig(com.hazelcast.client.config.ProxyFactoryConfig) ServiceConfig(com.hazelcast.config.ServiceConfig) ClientConfig(com.hazelcast.client.config.ClientConfig) Before(org.junit.Before)

Example 3 with ServiceConfig

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);
}
Also used : ServiceConfig(com.hazelcast.config.ServiceConfig) Test(org.junit.Test) QuickTest(com.hazelcast.test.annotation.QuickTest)

Example 4 with ServiceConfig

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);
    }
}
Also used : ServiceConfig(com.hazelcast.config.ServiceConfig)

Example 5 with 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);
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) ServiceConfig(com.hazelcast.config.ServiceConfig) Config(com.hazelcast.config.Config) ServiceConfig(com.hazelcast.config.ServiceConfig) TestHazelcastInstanceFactory(com.hazelcast.test.TestHazelcastInstanceFactory) Before(org.junit.Before)

Aggregations

ServiceConfig (com.hazelcast.config.ServiceConfig)30 Config (com.hazelcast.config.Config)27 QuickTest (com.hazelcast.test.annotation.QuickTest)11 Test (org.junit.Test)11 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)10 TestHazelcastInstanceFactory (com.hazelcast.test.TestHazelcastInstanceFactory)8 HazelcastInstance (com.hazelcast.core.HazelcastInstance)7 Before (org.junit.Before)6 NodeEngine (com.hazelcast.spi.impl.NodeEngine)4 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)3 ClientConfig (com.hazelcast.client.config.ClientConfig)2 ProxyFactoryConfig (com.hazelcast.client.config.ProxyFactoryConfig)2 IndexConfig (com.hazelcast.config.IndexConfig)2 Operation (com.hazelcast.spi.impl.operationservice.Operation)2 ProxyServiceImpl (com.hazelcast.spi.impl.proxyservice.impl.ProxyServiceImpl)2 Accessors.getNodeEngineImpl (com.hazelcast.test.Accessors.getNodeEngineImpl)2 UUID (java.util.UUID)2 CountDownLatch (java.util.concurrent.CountDownLatch)2 MapConfig (com.hazelcast.config.MapConfig)1 ServicesConfig (com.hazelcast.config.ServicesConfig)1