Search in sources :

Example 1 with PreferenceStoreAttributes

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);
}
Also used : QpidServiceLoader(org.apache.qpid.server.plugin.QpidServiceLoader) PreferenceStoreAttributes(org.apache.qpid.server.store.preferences.PreferenceStoreAttributes) NoopPreferenceStoreFactoryService(org.apache.qpid.server.store.preferences.NoopPreferenceStoreFactoryService) PreferenceStoreFactoryService(org.apache.qpid.server.store.preferences.PreferenceStoreFactoryService)

Example 2 with PreferenceStoreAttributes

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()));
    }
}
Also used : PreferenceStoreAttributes(org.apache.qpid.server.store.preferences.PreferenceStoreAttributes) IllegalConfigurationException(org.apache.qpid.server.configuration.IllegalConfigurationException)

Example 3 with PreferenceStoreAttributes

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);
}
Also used : QpidServiceLoader(org.apache.qpid.server.plugin.QpidServiceLoader) PreferenceStoreFactoryService(org.apache.qpid.server.store.preferences.PreferenceStoreFactoryService) NoopPreferenceStoreFactoryService(org.apache.qpid.server.store.preferences.NoopPreferenceStoreFactoryService) PreferenceStoreAttributes(org.apache.qpid.server.store.preferences.PreferenceStoreAttributes) ManagedObject(org.apache.qpid.server.model.ManagedObject) ConfiguredObject(org.apache.qpid.server.model.ConfiguredObject) AbstractConfiguredObject(org.apache.qpid.server.model.AbstractConfiguredObject)

Aggregations

PreferenceStoreAttributes (org.apache.qpid.server.store.preferences.PreferenceStoreAttributes)3 QpidServiceLoader (org.apache.qpid.server.plugin.QpidServiceLoader)2 NoopPreferenceStoreFactoryService (org.apache.qpid.server.store.preferences.NoopPreferenceStoreFactoryService)2 PreferenceStoreFactoryService (org.apache.qpid.server.store.preferences.PreferenceStoreFactoryService)2 IllegalConfigurationException (org.apache.qpid.server.configuration.IllegalConfigurationException)1 AbstractConfiguredObject (org.apache.qpid.server.model.AbstractConfiguredObject)1 ConfiguredObject (org.apache.qpid.server.model.ConfiguredObject)1 ManagedObject (org.apache.qpid.server.model.ManagedObject)1