Package org.jboss.as.console.client.shared.subsys.batch.store

Source Code of org.jboss.as.console.client.shared.subsys.batch.store.BatchStoreAdapter

package org.jboss.as.console.client.shared.subsys.batch.store;

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 BatchStoreAdapter {

    private final BatchStore delegate;

    @Inject
    public BatchStoreAdapter(final BatchStore delegate, final Dispatcher dispatcher) {
        this.delegate = delegate;

        dispatcher.register(BatchStore.class, new StoreCallback() {
            @Override
            public Agreement voteFor(final Action action) {
                if (action instanceof org.jboss.as.console.client.shared.subsys.batch.store.InitBatch) {
                    return new Agreement(true);
                }
                else if (action instanceof org.jboss.as.console.client.shared.subsys.batch.store.ModifyBatch) {
                    return new Agreement(true);
                }
                else if (action instanceof org.jboss.as.console.client.shared.subsys.batch.store.ModifyThreadPool) {
                    return new Agreement(true);
                }
                else if (action instanceof org.jboss.as.console.client.shared.subsys.batch.store.ModifyJobRepository) {
                    return new Agreement(true);
                }
                else if (action instanceof org.jboss.as.console.client.shared.subsys.batch.store.AddThreadFactory) {
                    return new Agreement(true);
                }
                else if (action instanceof org.jboss.as.console.client.shared.subsys.batch.store.ModifyThreadFactory) {
                    return new Agreement(true);
                }
                else if (action instanceof org.jboss.as.console.client.shared.subsys.batch.store.RefreshThreadFactories) {
                    return new Agreement(true);
                }
                else if (action instanceof org.jboss.as.console.client.shared.subsys.batch.store.RemoveThreadFactory) {
                    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.batch.store.InitBatch) {
                    delegate.init(channel);
                }
                else if (action instanceof org.jboss.as.console.client.shared.subsys.batch.store.ModifyBatch) {
                    delegate.modifyBatch(((org.jboss.as.console.client.shared.subsys.batch.store.ModifyBatch)action).getPayload(), channel);
                }
                else if (action instanceof org.jboss.as.console.client.shared.subsys.batch.store.ModifyThreadPool) {
                    delegate.modifyThreadPool(((org.jboss.as.console.client.shared.subsys.batch.store.ModifyThreadPool)action).getPayload(), channel);
                }
                else if (action instanceof org.jboss.as.console.client.shared.subsys.batch.store.ModifyJobRepository) {
                    delegate.modifyJobRepository(((org.jboss.as.console.client.shared.subsys.batch.store.ModifyJobRepository)action).getPayload(), channel);
                }
                else if (action instanceof org.jboss.as.console.client.shared.subsys.batch.store.AddThreadFactory) {
                    delegate.addThreadFactory(((org.jboss.as.console.client.shared.subsys.batch.store.AddThreadFactory)action).getPayload(), channel);
                }
                else if (action instanceof org.jboss.as.console.client.shared.subsys.batch.store.ModifyThreadFactory) {
                    delegate.modifyThreadFactory(((org.jboss.as.console.client.shared.subsys.batch.store.ModifyThreadFactory)action).getPayload(), channel);
                }
                else if (action instanceof org.jboss.as.console.client.shared.subsys.batch.store.RefreshThreadFactories) {
                    delegate.refreshThreadFactories(channel);
                }
                else if (action instanceof org.jboss.as.console.client.shared.subsys.batch.store.RemoveThreadFactory) {
                    delegate.removeThreadFactory(((org.jboss.as.console.client.shared.subsys.batch.store.RemoveThreadFactory)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.batch.store.BatchStoreAdapter

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.