Package org.jboss.gwt.circuit

Examples of org.jboss.gwt.circuit.StoreCallback


    @Inject
    public BookStoreAdapter(final BookStore delegate, final Dispatcher dispatcher) {
        this.delegate = delegate;

        dispatcher.register(BookStore.class, new StoreCallback() {
            @Override
            public Agreement voteFor(final Action action) {
                if (action instanceof org.jboss.gwt.circuit.sample.bookstore.Rate) {
                    return new Agreement(true);
                }
View Full Code Here


    @Inject
    public LogStoreAdapter(final LogStore delegate, final Dispatcher dispatcher) {
        this.delegate = delegate;

        dispatcher.register(LogStore.class, new StoreCallback() {
            @Override
            public Agreement voteFor(final Action action) {
                if (action instanceof org.jboss.as.console.client.shared.runtime.logviewer.actions.ReadLogFiles) {
                    return new Agreement(true);
                }
View Full Code Here

    private Map<Class<?>, Agreement> prepare(final Action action) {
        Map<Class<?>, Agreement> approvals = new HashMap<>();
        for (Map.Entry<Class<?>, StoreCallback> entry : callbacks.entrySet()) {
            Class<?> store = entry.getKey();
            StoreCallback callback = entry.getValue();

            Agreement agreement = callback.voteFor(action);
            if (agreement.isApproved()) {
                approvals.put(store, agreement);
            }
        }
        return approvals;
View Full Code Here

            }
            return;
        }

        final Class<?> store = iterator.next();
        final StoreCallback callback = callbacks.get(store);
        diagnostics.onExecute(store, action);
        callback.complete(action, new Channel() {
            @Override
            public void ack() {
                ack(true);
            }
View Full Code Here

    private final Multimap<String, String> deployments;

    public DeploymentStore(final Dispatcher dispatcher) {
        deployments = HashMultimap.create();

        dispatcher.register(DeploymentStore.class, new StoreCallback() {
            @Override
            public Agreement voteFor(final Action action) {
                Agreement agreement = Agreement.NONE;
                if (action instanceof DeployAction || action instanceof UndeployAction || action instanceof StopServerAction) {
                    agreement = new Agreement(true);
View Full Code Here

    private final Set<String> runningServers = new HashSet<>();

    public HostStore(final Dispatcher dispatcher) {

        dispatcher.register(HostStore.class, new StoreCallback() {
            @Override
            public Agreement voteFor(final Action action) {
                Agreement agreement = Agreement.NONE;
                if (action instanceof StartServerAction) {
                    agreement = new Agreement(true);
View Full Code Here

    @Inject
    public TodoStoreAdapter(final TodoStore delegate, final Dispatcher dispatcher) {
        this.delegate = delegate;

        dispatcher.register(TodoStore.class, new StoreCallback() {
            @Override
            public Agreement voteFor(final Action action) {
                if (action instanceof org.jboss.gwt.circuit.sample.todo.client.actions.SelectUser) {
                    return new Agreement(true, org.jboss.gwt.circuit.sample.todo.client.stores.UserStore.class);
                }
View Full Code Here

    @Inject
    public UserStoreAdapter(final UserStore delegate, final Dispatcher dispatcher) {
        this.delegate = delegate;

        dispatcher.register(UserStore.class, new StoreCallback() {
            @Override
            public Agreement voteFor(final Action action) {
                if (action instanceof org.jboss.gwt.circuit.sample.todo.client.actions.LoadUsers) {
                    return new Agreement(true);
                }
View Full Code Here

    private final Map<Term, Integer> results;

    public CalculatorStore(final Dispatcher dispatcher) {
        this.results = new LinkedHashMap<>();

        dispatcher.register(CalculatorStore.class, new StoreCallback() {
            @Override
            public Agreement voteFor(final Action action) {
                if (action instanceof TermAction) {
                    return new Agreement(true);
                }
View Full Code Here

    private Map<Class<?>, Agreement> prepare(final Action action) {
        Map<Class<?>, Agreement> approvals = new HashMap<>();
        for (Map.Entry<Class<?>, StoreCallback> entry : callbacks.entrySet()) {
            Class<?> store = entry.getKey();
            StoreCallback callback = entry.getValue();

            Agreement agreement = callback.voteFor(action);
            if (agreement.isApproved()) {
                approvals.put(store, agreement);
            }
        }
        return approvals;
View Full Code Here

TOP

Related Classes of org.jboss.gwt.circuit.StoreCallback

Copyright © 2018 www.massapicom. 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.