Package java.lang

Examples of java.lang.Thread$WeakClassKey


      Complex bM = new Complex(tX + ((bX - tX) / 2), bY);
      Complex tM = new Complex(tX + ((bX - tX) / 2), tY);
      Complex bR = new Complex(bX, bY);
     
      BufferedImage leftSection = output.getSubimage(0, 0, output.getWidth() / 2, output.getHeight());
      new Thread(new RenderingThread(this, leftSection, tL, bM)).start();
     
      BufferedImage rightSection = output.getSubimage(output.getWidth() / 2, 0, output.getWidth()/2, output.getHeight());
      new Thread(new RenderingThread(this, rightSection, tM , bR)).start();
     
    }
    this.repaint();
  }
View Full Code Here


class Producer implements Runnable {
  Q q;
  Producer(Q q) {
    this.q = q;
    new Thread(this, "Producer").start();
  }
View Full Code Here

class Consumer implements Runnable {
  Q q;
  Consumer(Q q) {
    this.q = q;
    new Thread(this, "Consumer").start();
  }
View Full Code Here

        final CountDownLatch connections = new CountDownLatch(
                serverArray.length);

        // use a new thread to connect to each server
        for (final String server : serverArray) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    connectToOneServerWithRetry(server);
                    connections.countDown();
                }
View Full Code Here

          String[] ijarg = new String[3];
            ijarg[0] = "-p";
            ijarg[1] = propString;
            ijarg[2] = scriptPath;
      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);
        }
        else if (testType.equals("java"))
        {
            sysProp.put("user.dir", outDir.getCanonicalPath());
            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);
            // 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(JavaTest, testMain, argObj);
      Thread testThread = new Thread(testObject);
      try
      {
        testThread.start();
        if (timeout < 0)
        {
          testThread.join();
        }
        else
        {
          testThread.join(timeout * 1000);
        }
      }
      catch(Exception e)
      {
        System.out.println("Exception upon invoking test..." + e);
View Full Code Here

    private void startThreadGroup() {
        final ThreadGroup group = new ThreadGroup("nanomsg-scheduler");
        group.setDaemon(false);

        for (int i=0; i<concurrency; ++i) {
            final Thread t = new Thread(group, this);
            t.setDaemon(false);
            t.start();
        }
    }
View Full Code Here

    public void run() {
        _stop = false;
        _stopped = false;
        Socket sock;
        ConnectionHandler ch;
        Thread thread;
        if (_serversocket == null || _serversocket.isClosed()) {
            try {
                listen();
            } catch (IOException ioe) {
                _logger.severe("Can't listen at " + _spec + ": " + ioe);
                _stopped = true;
                return;
            }
        }
        if (W32WinInet.isAvailable() && _spec.isPrimaryProxy())
            W32WinInet.interceptProxy("localhost", _spec.getPort());
        while (! _stop) {
            try {
                sock = _serversocket.accept();
                ch = new ConnectionHandler(_proxy, sock, _spec.getBase());
                thread = new Thread(ch, Thread.currentThread().getName()+"-"+Integer.toString(_count++));
                thread.setDaemon(true);
                thread.start();
            } catch (IOException e) {
                if (!e.getMessage().equals("Accept timed out")) {
                    System.err.println("I/O error while waiting for a connection : " + e.getMessage());
                }
            }
View Full Code Here

     }

    public final static void notify(java.lang.Object callingObject) {
        logger.debug("Entering");
         Controller controller = AgentJVirtualMachine.getCurrentNS2NodeController();
         Thread waitThread = Thread.currentThread();
         String threadName = waitThread.getClass().getName();

         ObjectCounter objctr = getObject(callingObject);
         if (objctr!=null) {
             logger.debug("Notify: check ok, object waiting");
             if (objctr.decrementandCheckZero()) objectsWaiting.remove(objctr);
View Full Code Here

    }

    public static final void notifyAll(java.lang.Object callingObject) {
        logger.debug("Entering");
        Controller controller = AgentJVirtualMachine.getCurrentNS2NodeController();
        Thread waitThread = Thread.currentThread();
        String threadName = waitThread.getClass().getName();
        ObjectCounter objctr = getObject(callingObject);
        if ((objctr!=null) && (objctr.getObjectsWaiting()!=0)) {
            logger.debug("NotifyAll: check ok, object waiting");
            do {
                logger.debug("NotifyAll: notifying object!!!");
View Full Code Here

              + " is already running");
          return;
        }
        assertState(StandbyIngestState.NOT_INGESTING);
        ingest = new Ingest(this, fsnamesys, confg, currentSegmentTxId);
        ingestThread = new Thread(ingest);
        ingestThread.setName("Ingest_for_" + currentSegmentTxId);
        ingestThread.start();
        currentIngestState = StandbyIngestState.INGESTING_EDITS;
      }
      LOG.info("Standby: Instatiated ingest for txid: " + currentSegmentTxId);
View Full Code Here

TOP

Related Classes of java.lang.Thread$WeakClassKey

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.