use of com.hazelcast.ringbuffer.RingbufferStoreFactory in project hazelcast by hazelcast.
the class RingbufferStoreConfigHolder method asRingbufferStoreConfig.
public RingbufferStoreConfig asRingbufferStoreConfig(SerializationService serializationService) {
RingbufferStoreConfig config = new RingbufferStoreConfig();
if (!StringUtil.isNullOrEmptyAfterTrim(className)) {
config.setClassName(className);
}
config.setEnabled(enabled);
if (!StringUtil.isNullOrEmptyAfterTrim(factoryClassName)) {
config.setFactoryClassName(factoryClassName);
}
config.setProperties(PropertiesUtil.fromMap(properties));
RingbufferStore storeImplementation = serializationService.toObject(implementation);
if (storeImplementation != null) {
config.setStoreImplementation(storeImplementation);
}
RingbufferStoreFactory storeFactoryImplementation = serializationService.toObject(factoryImplementation);
if (storeFactoryImplementation != null) {
config.setFactoryImplementation(storeFactoryImplementation);
}
return config;
}
use of com.hazelcast.ringbuffer.RingbufferStoreFactory in project hazelcast by hazelcast.
the class RingbufferStoreWrapper method getRingbufferStoreFactory.
private static RingbufferStore getRingbufferStoreFactory(ObjectNamespace namespace, RingbufferStoreConfig storeConfig, ClassLoader classLoader) {
if (storeConfig == null) {
return null;
}
final RingbufferStoreFactory implementation = storeConfig.getFactoryImplementation();
final String className = storeConfig.getFactoryClassName();
final RingbufferStoreFactory factory = getOrInstantiate(implementation, classLoader, className);
return factory == null ? null : factory.newRingbufferStore(namespace.getObjectName(), storeConfig.getProperties());
}
use of com.hazelcast.ringbuffer.RingbufferStoreFactory in project hazelcast by hazelcast.
the class RingbufferStoreConfigTest method setFactoryImplementation.
@Test
public void setFactoryImplementation() {
RingbufferStoreFactory factory = new RingbufferStoreFactory() {
@Override
public RingbufferStore newRingbufferStore(String name, Properties properties) {
return null;
}
};
config.setFactoryImplementation(factory);
assertEquals(factory, config.getFactoryImplementation());
}
Aggregations