Package org.jboss.as.console.client.shared.subsys.io.bufferpool

Source Code of org.jboss.as.console.client.shared.subsys.io.bufferpool.BufferPoolStoreAdapter

package org.jboss.as.console.client.shared.subsys.io.bufferpool;

import javax.annotation.Generated;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;

import org.jboss.gwt.circuit.Action;
import org.jboss.gwt.circuit.Agreement;
import org.jboss.gwt.circuit.Dispatcher;
import org.jboss.gwt.circuit.PropagatesChange.Handler;
import org.jboss.gwt.circuit.StoreCallback;

/*
* WARNING! This class is generated. Do not modify.
*/
@ApplicationScoped
@Generated("org.jboss.gwt.circuit.processor.StoreProcessor")
public class BufferPoolStoreAdapter {

    private final BufferPoolStore delegate;

    @Inject
    public BufferPoolStoreAdapter(final BufferPoolStore delegate, final Dispatcher dispatcher) {
        this.delegate = delegate;

        dispatcher.register(BufferPoolStore.class, new StoreCallback() {
            @Override
            public Agreement voteFor(final Action action) {
                if (action instanceof org.jboss.as.console.client.shared.subsys.io.bufferpool.AddBufferPool) {
                    return new Agreement(true);
                }
                else if (action instanceof org.jboss.as.console.client.shared.subsys.io.bufferpool.ModifyBufferPool) {
                    return new Agreement(true);
                }
                else if (action instanceof org.jboss.as.console.client.shared.subsys.io.bufferpool.RefreshBufferPools) {
                    return new Agreement(true);
                }
                else if (action instanceof org.jboss.as.console.client.shared.subsys.io.bufferpool.RemoveBufferPool) {
                    return new Agreement(true);
                }
                else {
                    return Agreement.NONE;
                }
            }

            @Override
            public void complete(final Action action, final Dispatcher.Channel channel) {
                if (action instanceof org.jboss.as.console.client.shared.subsys.io.bufferpool.AddBufferPool) {
                    delegate.add(((org.jboss.as.console.client.shared.subsys.io.bufferpool.AddBufferPool)action).getPayload(), channel);
                }
                else if (action instanceof org.jboss.as.console.client.shared.subsys.io.bufferpool.ModifyBufferPool) {
                    delegate.modify(((org.jboss.as.console.client.shared.subsys.io.bufferpool.ModifyBufferPool)action).getPayload(), channel);
                }
                else if (action instanceof org.jboss.as.console.client.shared.subsys.io.bufferpool.RefreshBufferPools) {
                    delegate.refresh(channel);
                }
                else if (action instanceof org.jboss.as.console.client.shared.subsys.io.bufferpool.RemoveBufferPool) {
                    delegate.remove(((org.jboss.as.console.client.shared.subsys.io.bufferpool.RemoveBufferPool)action).getPayload(), channel);
                }
                else {
                    System.out.println("WARN: Unmatched action " + action.getClass().getName() + " in store " + delegate.getClass());
                    channel.ack();
                }
            }

            @Override
            public void signalChange(final Action action) {
                Class<? extends Action> actionType = action.getClass();
                Iterable<Handler> actionHandlers = delegate.getActionHandler(actionType);
                for (Handler actionHandler : actionHandlers) {
                    actionHandler.onChange(actionType);
                }
                Iterable<Handler> storeHandlers = delegate.getHandler();
                for (Handler storeHandler : storeHandlers) {
                    storeHandler.onChange(actionType);
                }
            }
        });
    }
}
TOP

Related Classes of org.jboss.as.console.client.shared.subsys.io.bufferpool.BufferPoolStoreAdapter

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.