Examples of Agreement


Examples of org.jboss.gwt.circuit.Agreement

        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);
                }
                else {
                    return Agreement.NONE;
                }
            }
View Full Code Here

Examples of org.jboss.gwt.circuit.Agreement

        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);
                }
                else if (action instanceof org.jboss.as.console.client.shared.runtime.logviewer.actions.SelectLogFile) {
                    return new Agreement(true);
                }
                else if (action instanceof org.jboss.as.console.client.shared.runtime.logviewer.actions.ActivateLogFile) {
                    return new Agreement(true);
                }
                else if (action instanceof org.jboss.as.console.client.shared.runtime.logviewer.actions.CloseLogFile) {
                    return new Agreement(true);
                }
                else if (action instanceof org.jboss.as.console.client.shared.runtime.logviewer.actions.RefreshLogFile) {
                    return new Agreement(true);
                }
                else if (action instanceof org.jboss.as.console.client.shared.runtime.logviewer.actions.NavigateInLogFile) {
                    return new Agreement(true);
                }
                else if (action instanceof org.jboss.as.console.client.shared.runtime.logviewer.actions.UnfollowLogFile) {
                    return new Agreement(true);
                }
                else if (action instanceof org.jboss.as.console.client.shared.runtime.logviewer.actions.ChangePageSize) {
                    return new Agreement(true);
                }
                else {
                    return Agreement.NONE;
                }
            }
View Full Code Here

Examples of org.jboss.gwt.circuit.Agreement

        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

Examples of org.jboss.gwt.circuit.Agreement

        DirectedGraph<Class<?>, DefaultEdge> dag = new DefaultDirectedGraph<>(new EdgeFactoryImpl());

        // Add vertices (stores)
        for (Map.Entry<Class<?>, Agreement> entry : approvals.entrySet()) {
            Class<?> store = entry.getKey();
            Agreement agreement = entry.getValue();
            dag.addVertex(store);
            for (Class<?> depStore : agreement.getDependencies()) {
                dag.addVertex(depStore);
            }
        }

        // Add edges (dependencies from one store to other stores)
        for (Map.Entry<Class<?>, Agreement> entry : approvals.entrySet()) {
            Class<?> store = entry.getKey();
            Agreement agreement = entry.getValue();
            for (Class<?> depStore : agreement.getDependencies()) {
                dag.addEdge(depStore, store);
            }
        }

        // cycle detection
View Full Code Here

Examples of org.jboss.gwt.circuit.Agreement

        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);
                }
                return agreement;
            }

            @Override
View Full Code Here

Examples of org.jboss.gwt.circuit.Agreement

    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);
                } else if (action instanceof StopServerAction) {
                    agreement = new Agreement(true, DeploymentStore.class);
                }
                return agreement;
            }

            @Override
View Full Code Here

Examples of org.jboss.gwt.circuit.Agreement

        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);
                }
                else if (action instanceof org.jboss.gwt.circuit.sample.todo.client.actions.RemoveUser) {
                    return new Agreement(true, org.jboss.gwt.circuit.sample.todo.client.stores.UserStore.class);
                }
                else if (action instanceof org.jboss.gwt.circuit.sample.todo.client.actions.ListTodos) {
                    return new Agreement(true);
                }
                else if (action instanceof org.jboss.gwt.circuit.sample.todo.client.actions.ResolveTodo) {
                    return new Agreement(true);
                }
                else if (action instanceof org.jboss.gwt.circuit.sample.todo.client.actions.SelectTodo) {
                    return new Agreement(true);
                }
                else if (action instanceof org.jboss.gwt.circuit.sample.todo.client.actions.SaveTodo) {
                    return new Agreement(true);
                }
                else if (action instanceof org.jboss.gwt.circuit.sample.todo.client.actions.RemoveTodo) {
                    return new Agreement(true);
                }
                else {
                    return Agreement.NONE;
                }
            }
View Full Code Here

Examples of org.jboss.gwt.circuit.Agreement

        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);
                }
                else if (action instanceof org.jboss.gwt.circuit.sample.todo.client.actions.SelectUser) {
                    return new Agreement(true);
                }
                else if (action instanceof org.jboss.gwt.circuit.sample.todo.client.actions.AddUser) {
                    return new Agreement(true);
                }
                else if (action instanceof org.jboss.gwt.circuit.sample.todo.client.actions.RemoveUser) {
                    return new Agreement(true);
                }
                else {
                    return Agreement.NONE;
                }
            }
View Full Code Here

Examples of org.jboss.gwt.circuit.Agreement

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

            @Override
View Full Code Here

Examples of org.jboss.gwt.circuit.Agreement

        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
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.