use of org.apache.qpid.server.store.preferences.PreferenceStoreAttributes in project qpid-broker-j by apache.
the class AbstractSystemConfig method createPreferenceStore.
@Override
public PreferenceStore createPreferenceStore() {
PreferenceStoreAttributes preferenceStoreAttributes = getPreferenceStoreAttributes();
final Map<String, PreferenceStoreFactoryService> preferenceStoreFactories = new QpidServiceLoader().getInstancesByType(PreferenceStoreFactoryService.class);
String preferenceStoreType;
Map<String, Object> attributes;
if (preferenceStoreAttributes == null) {
preferenceStoreType = NoopPreferenceStoreFactoryService.TYPE;
attributes = Collections.emptyMap();
} else {
preferenceStoreType = preferenceStoreAttributes.getType();
attributes = preferenceStoreAttributes.getAttributes();
}
final PreferenceStoreFactoryService preferenceStoreFactory = preferenceStoreFactories.get(preferenceStoreType);
return preferenceStoreFactory.createInstance(this, attributes);
}
use of org.apache.qpid.server.store.preferences.PreferenceStoreAttributes in project qpid-broker-j by apache.
the class BDBHAVirtualHostNodeImpl method onValidate.
@Override
public void onValidate() {
super.onValidate();
PreferenceStoreAttributes preferenceStoreAttributes = getPreferenceStoreAttributes();
if (!preferenceStoreAttributes.getType().equals(ProvidedPreferenceStoreFactoryService.TYPE)) {
throw new IllegalConfigurationException(String.format("BDBHAVirtualHostNode only supports Provided preference store but configured '%s'", preferenceStoreAttributes.getType()));
}
}
use of org.apache.qpid.server.store.preferences.PreferenceStoreAttributes in project qpid-broker-j by apache.
the class AbstractVirtualHostNode method createPreferenceStore.
@Override
public PreferenceStore createPreferenceStore() {
final Map<String, PreferenceStoreFactoryService> preferenceStoreFactories = new QpidServiceLoader().getInstancesByType(PreferenceStoreFactoryService.class);
String preferenceStoreType;
PreferenceStoreAttributes preferenceStoreAttributes = getPreferenceStoreAttributes();
Map<String, Object> attributes;
if (preferenceStoreAttributes == null) {
preferenceStoreType = NoopPreferenceStoreFactoryService.TYPE;
attributes = Collections.emptyMap();
} else {
preferenceStoreType = preferenceStoreAttributes.getType();
attributes = preferenceStoreAttributes.getAttributes();
}
final PreferenceStoreFactoryService preferenceStoreFactory = preferenceStoreFactories.get(preferenceStoreType);
return preferenceStoreFactory.createInstance(this, attributes);
}
Aggregations