Package de.dfki.owlsmx.gui.util.tasks

Examples of de.dfki.owlsmx.gui.util.tasks.RunQueriesTask


            System.exit(0);
        }
       
        // Create task for adding services to the matchmaker and run queries
        AddServicesToMatchmakerTask addServicesTask = new AddServicesToMatchmakerTask();
        RunQueriesTask runQueriesTask = new RunQueriesTask();
        System.out.println(runQueriesTask.getLengthOfTask() + " queries and " + addServicesTask.getLengthOfTask() + " services loaded");
       
        // Start the first task that runs in a SwingThread
        System.out.print("The AddServicesToMatchmakerTask is starting ..");
        addServicesTask.go();
        System.out.println(addServicesTask.getMessage());
        // Wait till the task is done
        boolean wait = true;
        while(wait){
            try{
                Thread.sleep(500);
            } catch(InterruptedException e){
                System.err.println(e.getMessage());
                e.printStackTrace();
            }
            System.out.println(addServicesTask.getMessage());
            if(addServicesTask.isDone()){
                // Stop the thread
                addServicesTask.stop();
                System.out.println(". done :)");
                wait = false;
            }
        }
        // Now the queries can be started
        System.out.print("The RunQueriesTask is starting ..");
        runQueriesTask.go();
        System.out.println(runQueriesTask.getMessage());
        // Wait till the task is done
        wait=true;
        while(wait){
            try{
                Thread.sleep(500);
            } catch(InterruptedException e){
                System.err.println(e.getMessage());
                e.printStackTrace();
            }
            System.out.println(runQueriesTask.getMessage());
            if(runQueriesTask.isDone()){
                // Stop the thread
                runQueriesTask.stop();
                System.out.println(". done :)");
                wait = false;
            }
        }
    }
View Full Code Here

TOP

Related Classes of de.dfki.owlsmx.gui.util.tasks.RunQueriesTask

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.