Examples of Future


Examples of java.util.concurrent.Future

        String expected2 = "Hello TestSOAPInputMessage2";
        checkSAXSource(expected2, saxSourceResp2);
       
       
        TestSAXSourceHandler tssh = new TestSAXSourceHandler();
        Future fd = disp.invokeAsync(saxSourceReq3, tssh);
        assertNotNull(fd);
        while (!fd.isDone()) {
            //wait
        }
        String expected3 = "Hello TestSOAPInputMessage3";
        SAXSource saxSourceResp3 = tssh.getSAXSource();
        assertNotNull(saxSourceResp3);
View Full Code Here

Examples of java.util.concurrent.Future

        String expected2 = "Hello TestSOAPInputMessage2";
        checkSAXSource(expected2, saxSourceResp2);
       
       
        TestSAXSourceHandler tssh = new TestSAXSourceHandler();
        Future fd = disp.invokeAsync(saxSourceReq3, tssh);
        assertNotNull(fd);
        while (!fd.isDone()) {
            //wait
        }
        String expected3 = "Hello TestSOAPInputMessage3";
        SAXSource saxSourceResp3 = tssh.getSAXSource();
        assertNotNull(saxSourceResp3);
View Full Code Here

Examples of java.util.concurrent.Future

        String expected2 = "Hello TestSOAPInputMessage2";
        checkStreamSource(expected2, streamSourceResp2);
       
       
        TestStreamSourceHandler tssh = new TestStreamSourceHandler();
        Future fd = disp.invokeAsync(streamSourceReq3, tssh);
        assertNotNull(fd);
        while (!fd.isDone()) {
            //wait
        }
        String expected3 = "Hello TestSOAPInputMessage3";
        StreamSource streamSourceResp3 = tssh.getStreamSource();
        assertNotNull(streamSourceResp3);
View Full Code Here

Examples of java.util.concurrent.Future

        String expected2 = "Hello TestSOAPInputMessage2";
        checkStreamSource(expected2, streamSourceResp2);
       
       
        TestStreamSourceHandler tssh = new TestStreamSourceHandler();
        Future fd = disp.invokeAsync(streamSourceReq3, tssh);
        assertNotNull(fd);
        while (!fd.isDone()) {
            //wait
        }
        String expected3 = "Hello TestSOAPInputMessage3";
        StreamSource streamSourceResp3 = tssh.getStreamSource();
        assertNotNull(streamSourceResp3);
View Full Code Here

Examples of java.util.concurrent.Future

        assertTrue("Expected string, " + expected , expected.equals(responseValue2));

       
       
        TestJAXBHandler tjbh = new TestJAXBHandler();
        Future fd = disp.invokeAsync(greetMe, tjbh);
        assertNotNull(fd);
        while (!fd.isDone()) {
            //wait
        }
        String responseValue3 = ((GreetMeResponse)tjbh.getResponse()).getResponseType();
        assertTrue("Expected string, " + expected , expected.equals(responseValue3));
View Full Code Here

Examples of java.util.concurrent.Future

    // start the application
    // in a separate thread and then check that the wrapper is up after a
    // max timeout
    // but return as soon as possible to the windows service controller
    final long maxStartTime = w.getMaxStartTime();
    final Future future = pool.submit(new Runnable()
    {
      public void run()
      {
        try
        {
          Thread.yield();
          wList.startAll();
        }
        catch (Throwable ex)
        {
          ex.printStackTrace();
          w.getWrapperLogger().info("Win Service: error starting wrapper " + ex.getMessage());
          Runtime.getRuntime().halt(999);
        }
      }
    });
    pool.execute(new Runnable()
    {
      public void run()
      {
        try
        {
          future.get(maxStartTime, TimeUnit.MILLISECONDS);
        }
        catch (Exception ex)
        {
          ex.printStackTrace();
          w.getWrapperLogger().info("Win Service: wrapper did not start within " + maxStartTime + " ms " + ex.getMessage());
View Full Code Here

Examples of java.util.concurrent.Future

   */
  public abstract Object execute(String line);

  public Object executeWithTimeout(final String line)
  {
    final Future future = pool.submit(new Callable<Object>()
    {
      public Object call()
      {
        return execute(line);
      }
    });

    try
    {
      return future.get(_timeout, TimeUnit.MILLISECONDS);
    }
    catch (Exception e)
    {
      System.out.println("script did not terminate within " + _timeout + " ms");
      future.cancel(true);
      return null;
    }
  }
View Full Code Here

Examples of java.util.concurrent.Future

    _isShutdown = true;
    _loader = null;
    _threadPool = null;

    while (true) {
      Future future = null;

      synchronized (_futureSet) {
        Iterator<Future> iter = _futureSet.iterator();

        if (iter.hasNext()) {
          future = iter.next();

          _futureSet.remove(future);
        }
        else
          break;
      }

      if (future != null)
        future.cancel(true);
    }
   
    _futureSet.clear();
  }
View Full Code Here

Examples of java.util.concurrent.Future

        public long initTransaction() throws RemoteException {
            return initTransaction(JodbNetConstants.DEFAULT_TRANSACTION_LOCK_WAIT_TIMEOUT);
        }

        public long initTransaction(int transactioLockTimeout) throws RemoteException {
            Future future = _localTransactionExecutor.submit(_lockTransuctionRunnable);
            try {
                future.get(transactioLockTimeout, TimeUnit.MILLISECONDS);
            } catch (Exception e) {
                throw new RemoteException("",e);
            }
            if(!_lockTransuctionRunnable._gotLock){
                throw new RemoteException("Unable to obtain transaction lock");
View Full Code Here

Examples of java.util.concurrent.Future

        public void disposeRemoteContainer() throws IOException {
            _newDataBuffer.close();
            _replacementsBuffer.close();
            _rollbackBuffer.close();
            Future unlockProcess = _localTransactionExecutor.submit(_unlockTransactionRunnable);
            try {
                unlockProcess.get(JodbNetConstants.FILE_TRANSFER_MAX_WAIT, TimeUnit.MILLISECONDS);
            } catch (Exception e) {
                throw new JodbIOException(e);//TODO should be critical error?
            }
            if(JODBConfig.DEBUG){
                Utils.getLogger(getClass().getName()).log(Level.INFO, "Executor shutdown "+_localTransactionExecutor.toString());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.