Package java.util.concurrent

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


                queue.addAll(0, Arrays.asList(array));
            } else if (dependency instanceof Callable) {
                Callable callable = (Callable) dependency;
                Object callableResult;
                try {
                    callableResult = callable.call();
                } catch (Exception e) {
                    throw UncheckedException.asUncheckedException(e);
                }
                if (callableResult != null) {
                    queue.add(0, callableResult);
View Full Code Here


    private Object unwrap(Object value) {
        while (true) {
            if (value instanceof Callable) {
                Callable callable = (Callable) value;
                try {
                    value = callable.call();
                } catch (Exception e) {
                    throw UncheckedException.asUncheckedException(e);
                }
            } else if (value instanceof Closure) {
                Closure closure = (Closure) value;
View Full Code Here

                queue.addAll(0, Arrays.asList(array));
            } else if (first instanceof Callable) {
                Callable callable = (Callable) first;
                Object callableResult;
                try {
                    callableResult = callable.call();
                } catch (Exception e) {
                    throw UncheckedException.asUncheckedException(e);
                }
                if (callableResult != null) {
                    queue.add(0, callableResult);
View Full Code Here

        HTTPClientTransport client = (HTTPClientTransport)
            createClientTransport(WSDL_URL, SERVICE_NAME, PORT_NAME, ADDRESS, false);

        Callable c = client.getInputStreamMessageContextCallable(octx);
        assertNotNull(c);
        InputStreamMessageContext result = (InputStreamMessageContext)c.call();
        assertEquals(result, ictx);
    }

    public void doTestInvokeOneway(boolean decoupled) throws Exception {
View Full Code Here

    Callable o = (Callable) InterfaceProxyGenerator.getProxyInstance(testBundle,
        null, 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

            }
        };

//        callable = new ScopeActivator(callable, ApplicationScoped.class);
//        callable = new ScopeActivator(callable, RequestScoped.class);
        return callable.call();
    }

    public class ScopeActivator implements Callable {
        private final Callable callable;
        private final Class<? extends Annotation> scopeType;
View Full Code Here

            ServiceReference<ProxyManager> ref = bc.getServiceReference(ProxyManager.class);
            ProxyManager pm = ref != null ? bc.getService(ref) : null;
            if (pm != null) {
                Callable call = pm.unwrap(function);
                if (call != null) {
                    return unProxy((Function) call.call());
                }
                bc.ungetService(ref);
            }
        } catch (Throwable t) {
        }
View Full Code Here

            // execute it
            boolean isTwoWay = odeMex.getMessageExchangePattern() == MessageExchange.MessageExchangePattern.REQUEST_RESPONSE;
            if (isTwoWay) {
                // two way
                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();
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.