Package org.jboss.as.console.client.shared.schedule

Examples of org.jboss.as.console.client.shared.schedule.LongRunningTask


        });
    }

    private void pollState() {

        LongRunningTask poll = new LongRunningTask(new AsyncCommand<Boolean>() {
            @Override
            public void execute(final AsyncCallback<Boolean> callback) {
                checkReloadState(callback);
            }
        }, 10);

        // kick of the polling request
        poll.schedule(500);
    }
View Full Code Here


    @Override
    public void onSuccess(final Boolean wasSuccessful)
    {
        if (wasSuccessful)
        {
            LongRunningTask poll = new LongRunningTask(new AsyncCommand<Boolean>()
            {
                @Override
                public void execute(final AsyncCallback<Boolean> callback)
                {
                    final List<Server> finishedServers = new ArrayList<Server>();

                    for (Map.Entry<HostInfo, List<ServerInstance>> entry : serversPerHost
                            .entrySet())
                    {
                        HostInfo hostInfo = entry.getKey();
                        List<ServerInstance> serverInstances = entry.getValue();
                        for (ServerInstance serverInstance : serverInstances)
                        {
                            hostInfoStore.getServerConfiguration(hostInfo.getName(), serverInstance.getServer(),
                                    new SimpleCallback<Server>()
                                    {
                                        @Override
                                        public void onSuccess(final Server server)
                                        {
                                            finishedServers.add(server);
                                            boolean keepPolling = lifecycleOp == START || lifecycleOp == RESTART ? !server
                                                    .isStarted() : server.isStarted();
                                            if (!keepPolling && finishedServers.size() == servers)
                                            {
                                                ServerGroupLifecycleCallback.this.callback.onSuccess(finishedServers);
                                            }
                                            callback.onSuccess(keepPolling);
                                        }
                                    });
                        }
                    }
                }
            }, lifecycleOp.limit());
            poll.schedule(500);
        }
    }
View Full Code Here

    @Override
    public void onSuccess(final Boolean wasSuccessful)
    {
        if (wasSuccessful)
        {
            LongRunningTask poll = new LongRunningTask(new AsyncCommand<Boolean>()
            {
                @Override
                public void execute(final AsyncCallback<Boolean> callback)
                {
                    hostInfoStore.getServerConfiguration(host, server, new SimpleCallback<Server>()
                    {
                        @Override
                        public void onSuccess(final Server server)
                        {
                            boolean keepPolling = lifecycleOp == START || lifecycleOp == RELOAD ? !server
                                    .isStarted() : server.isStarted();
                            if (!keepPolling)
                            {
                                ServerInstanceLifecycleCallback.this.callback.onSuccess(server);
                            }
                            callback.onSuccess(keepPolling);
                        }
                    });
                }
            }, lifecycleOp.limit());
            poll.schedule(500);
        }
    }
View Full Code Here

        });
    }

    private void pollState() {

        LongRunningTask poll = new LongRunningTask(new AsyncCommand<Boolean>() {
            @Override
            public void execute(final AsyncCallback<Boolean> callback) {
                checkReloadState(callback);
            }
        }, 10);

        // kick of the polling request
        poll.schedule(500);
    }
View Full Code Here

    @Override
    public void onSuccess(final Boolean wasSuccessful)
    {
        if (wasSuccessful)
        {
            LongRunningTask poll = new LongRunningTask(new AsyncCommand<Boolean>()
            {
                @Override
                public void execute(final AsyncCallback<Boolean> callback)
                {
                    final List<Server> finishedServers = new ArrayList<Server>();

                    for (Map.Entry<HostInfo, List<ServerInstance>> entry : serversPerHost
                            .entrySet())
                    {
                        HostInfo hostInfo = entry.getKey();
                        List<ServerInstance> serverInstances = entry.getValue();
                        for (ServerInstance serverInstance : serverInstances)
                        {
                            hostInfoStore.getServerConfiguration(hostInfo.getName(), serverInstance.getServer(),
                                    new SimpleCallback<Server>()
                                    {
                                        @Override
                                        public void onSuccess(final Server server)
                                        {
                                            finishedServers.add(server);
                                            boolean keepPolling = lifecycleOp == START || lifecycleOp == RESTART ? !server
                                                    .isStarted() : server.isStarted();
                                            if (!keepPolling && finishedServers.size() == servers)
                                            {
                                                ServerGroupLifecycleCallback.this.callback.onSuccess(finishedServers);
                                                Console.MODULES.getEventBus().fireEvent(
                                                        new StaleModelEvent(StaleModelEvent.SERVER_GROUPS)
                                                );
                                            }
                                            callback.onSuccess(keepPolling);
                                        }
                                    });
                        }
                    }
                }
            }, lifecycleOp.limit());
            poll.schedule(500);
        }
    }
View Full Code Here

    @Override
    public void onSuccess(final Boolean wasSuccessful)
    {
        if (wasSuccessful)
        {
            LongRunningTask poll = new LongRunningTask(new AsyncCommand<Boolean>()
            {
                @Override
                public void execute(final AsyncCallback<Boolean> callback)
                {
                    hostInfoStore.getServerConfiguration(host, server, new SimpleCallback<Server>()
                    {
                        @Override
                        public void onSuccess(final Server server)
                        {
                            boolean keepPolling = lifecycleOp == START || lifecycleOp == RELOAD ? !server
                                    .isStarted() : server.isStarted();
                            if (!keepPolling)
                            {
                                ServerInstanceLifecycleCallback.this.callback.onSuccess(server);
                                Console.MODULES.getEventBus().fireEvent(
                                        new StaleModelEvent(StaleModelEvent.SERVER_INSTANCES)
                                );
                            }
                            callback.onSuccess(keepPolling);
                        }
                    });
                }
            }, lifecycleOp.limit());
            poll.schedule(500);
        }
    }
View Full Code Here

        });
    }

    private void pollState() {

        LongRunningTask poll = new LongRunningTask(new AsyncCommand<Boolean>() {
            @Override
            public void execute(final AsyncCallback<Boolean> callback) {
                checkReloadState(callback);
            }
        }, 10);

        // kick of the polling request
        poll.schedule(500);
    }
View Full Code Here

    @Override
    public void onSuccess(final Boolean wasSuccessful)
    {
        if (wasSuccessful)
        {
            LongRunningTask poll = new LongRunningTask(new AsyncCommand<Boolean>()
            {
                @Override
                public void execute(final AsyncCallback<Boolean> callback)
                {
                    hostInfoStore.getServerConfiguration(host, server, new SimpleCallback<Server>()
                    {
                        @Override
                        public void onSuccess(final Server server)
                        {
                            boolean keepPolling = lifecycleOp == START || lifecycleOp == RELOAD ? !server
                                    .isStarted() : server.isStarted();
                            if (!keepPolling)
                            {
                                ServerInstanceLifecycleCallback.this.callback.onSuccess(server);
                                Console.MODULES.getEventBus().fireEvent(
                                        new StaleModelEvent(StaleModelEvent.SERVER_INSTANCES)
                                );
                            }
                            callback.onSuccess(keepPolling);
                        }
                    });
                }
            }, lifecycleOp.limit());
            poll.schedule(500);
        }
    }
View Full Code Here

    @Override
    public void onSuccess(final Boolean wasSuccessful)
    {
        if (wasSuccessful)
        {
            LongRunningTask poll = new LongRunningTask(new AsyncCommand<Boolean>()
            {
                @Override
                public void execute(final AsyncCallback<Boolean> callback)
                {
                    final List<Server> finishedServers = new ArrayList<Server>();

                    for (Map.Entry<HostInfo, List<ServerInstance>> entry : serversPerHost
                            .entrySet())
                    {
                        HostInfo hostInfo = entry.getKey();
                        List<ServerInstance> serverInstances = entry.getValue();
                        for (ServerInstance serverInstance : serverInstances)
                        {
                            hostInfoStore.getServerConfiguration(hostInfo.getName(), serverInstance.getServer(),
                                    new SimpleCallback<Server>()
                                    {
                                        @Override
                                        public void onSuccess(final Server server)
                                        {
                                            finishedServers.add(server);
                                            boolean keepPolling = lifecycleOp == START || lifecycleOp == RESTART ? !server
                                                    .isStarted() : server.isStarted();
                                            if (!keepPolling && finishedServers.size() == servers)
                                            {
                                                ServerGroupLifecycleCallback.this.callback.onSuccess(finishedServers);
                                                Console.MODULES.getEventBus().fireEvent(
                                                        new StaleModelEvent(StaleModelEvent.SERVER_GROUPS)
                                                );
                                            }
                                            callback.onSuccess(keepPolling);
                                        }
                                    });
                        }
                    }
                }
            }, lifecycleOp.limit());
            poll.schedule(500);
        }
    }
View Full Code Here

        });
    }

    private void pollState() {

        LongRunningTask poll = new LongRunningTask(new AsyncCommand<Boolean>() {
            @Override
            public void execute(final AsyncCallback<Boolean> callback) {
                checkReloadState(callback);
            }
        }, 10);

        // kick of the polling request
        poll.schedule(500);
    }
View Full Code Here

TOP

Related Classes of org.jboss.as.console.client.shared.schedule.LongRunningTask

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.