Package java.util.concurrent

Examples of java.util.concurrent.Callable.call()


                executionCallable = new HttpExternalService.TwoWayCallable(client, method, odeMex);
                executionCallable.call();
            } else {
                // one way, just execute and forget
                executionCallable = new HttpExternalService.OneWayCallable(client, method, odeMex);
                executionCallable.call();
                odeMex.replyOneWayOk();
            }
        } catch (UnsupportedEncodingException e) {
            String errmsg = "The returned HTTP encoding isn't supported " + odeMex;
            log.error("[Service: " + serviceName + ", Port: " + portName + ", Operation: " + odeMex.getOperationName() + "] " + errmsg, e);
View Full Code Here


        public void run() {
            while (!isShutdown) {
                Callable task = getTask();

                try {
                    task.call();
                } catch (Throwable t) {
                    if (_log.isLoggable(Level.SEVERE)) {
                        _log.log(Level.SEVERE, "sip.stack.network.error_executing_task", t);
                    }
                }
View Full Code Here

    @Test
    public void testViewInJavaPackage() throws Exception {
        final Context ctx = new InitialContext();
        final Callable t = (Callable) ctx.lookup("java:module/" + CallableEjb.class.getSimpleName());
        Assert.assertEquals(CallableEjb.MESSAGE, t.call());
    }

}
View Full Code Here

                    for( String id : idrefs ) {
                        Callable callable = context.getObjectFromId(id,itemType);
                        Object t;

                        try {
                            t = (callable!=null) ? callable.call() : null;
                        } catch (SAXException e) {
                            throw e;
                        } catch (Exception e) {
                            throw new SAXException2(e);
                        }
View Full Code Here

        for (int i = 0; i < CONSUMER_COUNT; i++) {
            new Thread("Consumer:" + i) {
                public void run() {
                    try {
                        consumer.call();
                    } catch (Throwable e) {
                        e.printStackTrace();
                        workerError[0] = e;
                    }
                }
View Full Code Here

    public void service(final Request request, final Response response) throws Exception {
        try {
            request.addAfterServiceListener(afterServiceListener);
           
            final Callable handler = lookupHandler(request, response);
            handler.call();
        } catch (Exception ex) {
            try {
                response.setStatus(500);
                if (LOGGER.isLoggable(Level.WARNING)) {
                    LogHelper.log(LOGGER, Level.WARNING, KernelLoggerInfo.exceptionMapper, ex,
View Full Code Here

    Callable o = (Callable) InterfaceProxyGenerator.getProxyInstance(testBundle,
        classes, tc, tl);
   
    assertCalled(tl, false, false, false);
   
    assertNull(null, o.call());
   
    assertCalled(tl, true, true, false);
   
    assertEquals(Callable.class.getMethod("call"),
        tl.getLastMethod());
View Full Code Here

      public Object call() throws Exception {
        throw new RuntimeException();
      }
    });
    try {
      o.call();
      fail("Should throw an exception");
    } catch (RuntimeException re) {
      assertCalled(tl, true, false, true);
      assertSame(re, tl.getLastThrowable());
    }
View Full Code Here

      }
    });
   
   
    try {
      assertNotNull(o.call());
    } finally {
      assertCalled(tl, true, true, false);
    }
  }
 
View Full Code Here

                    for( String id : idrefs ) {
                        Callable callable = context.getObjectFromId(id,itemType);
                        Object t;

                        try {
                            t = (callable!=null) ? callable.call() : null;
                        } catch (SAXException e) {
                            throw e;
                        } catch (Exception e) {
                            throw new SAXException2(e);
                        }
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.