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

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


            public void onSuccess(final Boolean wasSuccessful) {

                if(wasSuccessful)
                {
                    int limit = startIt ? 15:5;
                    LongRunningTask poll = new LongRunningTask(new AsyncCommand<Boolean>() {
                        @Override
                        public void execute(final AsyncCallback<Boolean> callback) {


                            hostInfoStore.getServerConfiguration(hostName, serverName, new SimpleCallback<Server>() {
                                @Override
                                public void onSuccess(final Server server) {

                                    boolean keepPolling = false;

                                    if(startIt)
                                        keepPolling = !server.isStarted();
                                    else
                                        keepPolling = server.isStarted();


                                    if(!keepPolling) {

                                        getView().mergeUpdatedInstance(server.getName(), server.isStarted());

                                        Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
                                            @Override
                                            public void execute() {

                                                // force reload of server selector (LHS nav)
                                                //getEventBus().fireEvent(new StaleModelEvent(StaleModelEvent.SERVER_INSTANCES));
                                                onReset();
                                            }
                                        });

                                    }

                                    // notify scheduler
                                    callback.onSuccess(keepPolling);
                                }
                            });

                        }
                    }, limit);

                    // kick of the polling request
                    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

            public void onSuccess(final Boolean wasSuccessful) {

                if(wasSuccessful)
                {
                    int limit = startIt ? 15:5;
                    LongRunningTask poll = new LongRunningTask(new AsyncCommand<Boolean>() {
                        @Override
                        public void execute(final AsyncCallback<Boolean> callback) {


                            hostInfoStore.getServerConfiguration(hostName, serverName, new SimpleCallback<Server>() {
                                @Override
                                public void onSuccess(final Server server) {

                                    boolean keepPolling = false;

                                    if(startIt)
                                        keepPolling = !server.isStarted();
                                    else
                                        keepPolling = server.isStarted();


                                    if(!keepPolling) {

                                        getView().mergeUpdatedInstance(server.getName(), server.isStarted());

                                        Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
                                            @Override
                                            public void execute() {

                                                // force reload of server selector (LHS nav)
                                                getEventBus().fireEvent(new StaleModelEvent(StaleModelEvent.SERVER_INSTANCES));
                                            }
                                        });

                                    }

                                    // notify scheduler
                                    callback.onSuccess(keepPolling);
                                }
                            });

                        }
                    }, limit);

                    // kick of the polling request
                    poll.schedule(500);

                }
            }
        });
    }
View Full Code Here

            public void onSuccess(final Boolean wasSuccessful) {

                if(wasSuccessful)
                {
                    int limit = startIt ? 15:5;
                    LongRunningTask poll = new LongRunningTask(new AsyncCommand<Boolean>() {
                        @Override
                        public void execute(final AsyncCallback<Boolean> callback) {
                            hostInfoStore.getServerInstances(hostName, new SimpleCallback<List<ServerInstance>>() {
                                @Override
                                public void onSuccess(List<ServerInstance> result) {
                                    serverInstances = result;

                                    boolean keepPolling = false;

                                    for(ServerInstance instance : result) {
                                        if(instance.getServer().equals(serverName)) {

                                            if(startIt)
                                                keepPolling = !instance.isRunning();
                                            else
                                                keepPolling = instance.isRunning();

                                            break;
                                        }
                                    }

                                    // notify scheduler
                                    callback.onSuccess(keepPolling);

                                    if(!keepPolling) {

                                        getView().updateInstances(hostName, result);

                                        // force reload of server selector (LHS nav)
                                        getEventBus().fireEvent(new StaleModelEvent(StaleModelEvent.SERVER_INSTANCES));

                                    }
                                }
                            });
                        }
                    }, limit);

                    // kick of the polling request
                    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

        });
    }

    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.