Search in sources :

Example 1 with AbstractSystemConfig

use of org.apache.qpid.server.model.AbstractSystemConfig in project qpid-broker-j by apache.

the class ManagementModeStoreHandlerTest method createManagementModeStoreHandler.

private ManagementModeStoreHandler createManagementModeStoreHandler() {
    _systemConfig.close();
    Map<String, Object> attributes = new HashMap<>(_systemConfigAttributes);
    attributes.put(ConfiguredObject.DESIRED_STATE, State.QUIESCED);
    attributes.remove(ConfiguredObject.TYPE);
    _systemConfig = new AbstractSystemConfig(_taskExecutor, mock(EventLogger.class), mock(Principal.class), attributes) {

        @Override
        protected void onOpen() {
        }

        @Override
        protected DurableConfigurationStore createStoreObject() {
            return _store;
        }

        @Override
        protected ListenableFuture<Void> onClose() {
            return Futures.immediateFuture(null);
        }

        @Override
        @StateTransition(currentState = State.UNINITIALIZED, desiredState = State.QUIESCED)
        protected ListenableFuture<Void> startQuiesced() {
            return Futures.immediateFuture(null);
        }
    };
    _systemConfig.open();
    return new ManagementModeStoreHandler(_store, _systemConfig);
}
Also used : AbstractSystemConfig(org.apache.qpid.server.model.AbstractSystemConfig) DurableConfigurationStore(org.apache.qpid.server.store.DurableConfigurationStore) HashMap(java.util.HashMap) ListenableFuture(com.google.common.util.concurrent.ListenableFuture) StateTransition(org.apache.qpid.server.model.StateTransition) ConfiguredObject(org.apache.qpid.server.model.ConfiguredObject)

Aggregations

ListenableFuture (com.google.common.util.concurrent.ListenableFuture)1 HashMap (java.util.HashMap)1 AbstractSystemConfig (org.apache.qpid.server.model.AbstractSystemConfig)1 ConfiguredObject (org.apache.qpid.server.model.ConfiguredObject)1 StateTransition (org.apache.qpid.server.model.StateTransition)1 DurableConfigurationStore (org.apache.qpid.server.store.DurableConfigurationStore)1