Search in sources :

Example 1 with PreferenceStore

use of org.apache.qpid.server.store.preferences.PreferenceStore in project qpid-broker-j by apache.

the class PreferencesTest method setUp.

@Before
public void setUp() throws Exception {
    final String objectName = getTestName();
    _testObject = _model.getObjectFactory().create(TestSingleton.class, Collections.<String, Object>singletonMap(ConfiguredObject.NAME, objectName), null);
    _preferenceTaskExecutor = new CurrentThreadTaskExecutor();
    _preferenceTaskExecutor.start();
    PreferenceStore preferenceStore = mock(PreferenceStore.class);
    _testObject.setUserPreferences(new UserPreferencesImpl(_preferenceTaskExecutor, _testObject, preferenceStore, Collections.<Preference>emptySet()));
    _testSubject = TestPrincipalUtils.createTestSubject(TEST_USERNAME);
}
Also used : UserPreferencesImpl(org.apache.qpid.server.model.preferences.UserPreferencesImpl) Preference(org.apache.qpid.server.model.preferences.Preference) CurrentThreadTaskExecutor(org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor) ConfiguredObject(org.apache.qpid.server.model.ConfiguredObject) PreferenceStore(org.apache.qpid.server.store.preferences.PreferenceStore) Before(org.junit.Before)

Example 2 with PreferenceStore

use of org.apache.qpid.server.store.preferences.PreferenceStore in project qpid-broker-j by apache.

the class AbstractStandardVirtualHostNode method onDelete.

@Override
protected ListenableFuture<Void> onDelete() {
    final VirtualHost<?> virtualHost = getVirtualHost();
    final MessageStore messageStore = virtualHost == null ? null : virtualHost.getMessageStore();
    return doAfterAlways(closeVirtualHostIfExists(), () -> {
        if (messageStore != null) {
            messageStore.closeMessageStore();
            messageStore.onDelete(virtualHost);
        }
        if (AbstractStandardVirtualHostNode.this instanceof PreferenceStoreProvider) {
            PreferenceStore preferenceStore = ((PreferenceStoreProvider) AbstractStandardVirtualHostNode.this).getPreferenceStore();
            if (preferenceStore != null) {
                preferenceStore.onDelete();
            }
        }
        DurableConfigurationStore configurationStore = getConfigurationStore();
        if (configurationStore != null) {
            configurationStore.closeConfigurationStore();
            configurationStore.onDelete(AbstractStandardVirtualHostNode.this);
        }
        onCloseOrDelete();
    });
}
Also used : MessageStore(org.apache.qpid.server.store.MessageStore) PreferenceStoreProvider(org.apache.qpid.server.store.preferences.PreferenceStoreProvider) DurableConfigurationStore(org.apache.qpid.server.store.DurableConfigurationStore) PreferenceStore(org.apache.qpid.server.store.preferences.PreferenceStore)

Aggregations

PreferenceStore (org.apache.qpid.server.store.preferences.PreferenceStore)2 CurrentThreadTaskExecutor (org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor)1 ConfiguredObject (org.apache.qpid.server.model.ConfiguredObject)1 Preference (org.apache.qpid.server.model.preferences.Preference)1 UserPreferencesImpl (org.apache.qpid.server.model.preferences.UserPreferencesImpl)1 DurableConfigurationStore (org.apache.qpid.server.store.DurableConfigurationStore)1 MessageStore (org.apache.qpid.server.store.MessageStore)1 PreferenceStoreProvider (org.apache.qpid.server.store.preferences.PreferenceStoreProvider)1 Before (org.junit.Before)1