Search in sources :

Example 1 with PreferenceStoreFactoryService

use of org.apache.qpid.server.store.preferences.PreferenceStoreFactoryService 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 PreferenceStoreFactoryService

use of org.apache.qpid.server.store.preferences.PreferenceStoreFactoryService 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

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