Package java.lang

Examples of java.lang.Thread$UncaughtExceptionHandler


     * A new method that interrupts the worker thread.  Call this method
     * to force the worker to stop what it's doing.
     */
    public void interrupt()
    {
        Thread t = threadVar.get();
        if (t != null)
        {
            t.interrupt();
        }
        threadVar.clear();
    }
View Full Code Here


                SwingUtilities.invokeLater(doFinished);
            }
        };

        Thread t = new Thread(doConstruct);

        t.setUncaughtExceptionHandler(new SwingUncaughtExceptionHandler());
        threadVar = new ThreadVar(t);
    }
View Full Code Here

    /**
     * Start the worker thread.
     */
    public void start()
    {
        Thread t = threadVar.get();
        if (t != null)
        {
            t.start();
        }
    }
View Full Code Here

     */
    public Object get()
    {
        while (true)
        {
            Thread t = threadVar.get();
            if (t == null)
            {
                return getValue();
            }
            try
            {
                t.join();
            }
            catch (InterruptedException e)
            {
                Thread.currentThread().interrupt(); // propagate
                return null;
View Full Code Here

                SwingUtilities.invokeLater(doFinished);
            }
        };

        Thread t = new Thread(doConstruct);

        t.setUncaughtExceptionHandler(new SwingUncaughtExceptionHandler());
        threadVar = new ThreadVar(t);
    }
View Full Code Here

    /**
     * Start the worker thread.
     */
    public void start()
    {
        Thread t = threadVar.get();
        if (t != null)
        {
            t.start();
        }
    }
View Full Code Here

            PrintStream stdout = System.out;
            PrintStream stderr = System.err;
            System.setOut(ps);
            System.setErr(ps);
      RunIJ ij = new RunIJ(ijarg);
      Thread ijThread = new Thread(ij);
      try
      {
        ijThread.start();
        if (timeout < 0)
        {
          ijThread.join();
        }
        else
        {
            ijThread.join(timeout * 60 * 1000);
        }
      }
      catch (Exception e)
      {
        System.out.println("Aiiie! Got some kind of exception " + e);
      }

      // Now make sure a shutdown is complete if necessary
      if (shutdownurl != null)
      {
          String[] sdargs = new String[2];
          sdargs[0] = systemHome;
          sdargs[1] = shutdownurl;
          shutdown.main(sdargs);
      }
      // Reset ij.defaultResourcePackage
      ptmp = System.getProperties();
                        ptmp.put("ij.defaultResourcePackage", "/org/apache/derbyTesting/");
      ptmp.put("usesystem", "");
      System.setProperties(ptmp);
      // Reset System.out and System.err
      System.setOut(stdout);
      System.setErr(stderr);
        }
        else if (testType.equals("java"))
        {
      if (javaPath == null)
              javaPath = "org.apache.derbyTesting.functionTests.tests." + testDirName;
     
            String[] args = new String[2];
            args[0] = "-p";
            args[1] = propString;
            Class[] classArray = new Class[1];
            classArray[0] = args.getClass();
            String testName = javaPath + "." + testBase;
            Class JavaTest = Class.forName(testName);
            PrintStream stdout = System.out;
            PrintStream stderr = System.err;
            System.setOut(ps);
            System.setErr(ps);
            // Get the tests's main method and invoke it
            Method testMain = JavaTest.getMethod("main", classArray);
            Object[] argObj = new Object[1];
            argObj[0] = args;
      RunClass testObject = new RunClass(testMain, argObj);
      Thread testThread = new Thread(testObject);
      try
      {
        testThread.start();
        if (timeout < 0)
        {
          testThread.join();
        }
        else
        {
          testThread.join(timeout * 60 * 1000);
        }
      }
      catch(Exception e)
      {
        System.out.println("Exception upon invoking test..." + e);
View Full Code Here

              .falseCondition(InjectionEvent.STANDBY_EDITS_NOT_EXISTS, type)) {
        return;
      }
      setCurrentIngestFile(edits);
      ingest = new Ingest(this, fsnamesys, confg, edits);
      ingestThread = new Thread(ingest);
      ingestThread.start();
      currentIngestState = type == IngestFile.EDITS
          ? StandbyIngestState.INGESTING_EDITS
          : StandbyIngestState.INGESTING_EDITS_NEW;
    }
View Full Code Here

   * current changes.
   */

  public static void pushAction (BasicAction a, boolean register)
  {
    Thread t = Thread.currentThread();
    Stack txs = (Stack) _threadList.get();

    if (txs == null)
    {
      txs = new Stack();
View Full Code Here

      Document oldDoc = getEditor().getDocument();
      if(oldDoc != null)
    oldDoc.removeUndoableEditListener(undoHandler);
      getEditor().setDocument(createDocument());
      getFrame().setTitle(fileName);
      Thread loader = new FileLoader(f, (Document)editor.getDocument());
      loader.start();
  }
    }
View Full Code Here

TOP

Related Classes of java.lang.Thread$UncaughtExceptionHandler

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.