1

UI をブロックせずに、Eclipse RAP アプリケーションでバックグラウンドでクエリを実行したいと考えています。私はこのガイドに従いました: http://eclipse.org/rap/developers-guide/devguide.php?topic=threads.html&version=2.2

しかし、成功せずに:/

クエリは実行されますが、呼び出されると常に UI がブロックされます。私が使用しているコードは次のとおりです。

                final ServerPushSession pushSession = new ServerPushSession();

                Runnable bgRunnable = new Runnable() {

                   public void run() {

                     // schedule the UI update
                     display.syncExec( new Runnable() {

                         public void run() {

                                try {

                                    //CODE

                                    try {
                                        Thread.sleep(5000);
                                    }
                                    catch (InterruptedException e) {
                                        // TODO Auto-generated catch block
                                        e.printStackTrace();
                                    }
                                }
                                catch (PartInitException e) {

                                    e.printStackTrace();
                                    System.exit(0);
                                }

                                setText( "updated" );
                       }
                     } );

                     // close push session when finished
                     pushSession.stop();
                   }
                 };

                 pushSession.start();
                 Thread bgThread = new Thread( bgRunnable );
                 bgThread.setDaemon( true );
                 bgThread.start();

誰が何が起こっているのかについて考えを持っていますか?

4

1 に答える 1