Package java.util.concurrent

Examples of java.util.concurrent.FutureTask$Sync


            public Message createMessage(Session session) throws JMSException {
                Message message = endpoint.getBinding().makeJmsMessage(exchange, in, session, null);
                message.setJMSReplyTo(replyTo);
                requestor.setReplyToSelectorHeader(in, message);

                FutureTask future;
                future = (!msgIdAsCorrId)
                        ? requestor.getReceiveFuture(message.getJMSCorrelationID(), endpoint.getConfiguration().getRequestTimeout())
                        : requestor.getReceiveFuture(callback);

                futureHolder.set(future);
View Full Code Here


  private static long multiThreaded(final Context context, int numThreads)
  {
    List<Future<Long>> futures = Lists.newArrayList();
    List<Thread> threads = Lists.newArrayList();
    for (int i = 0; i < numThreads; ++i) {
      RunnableFuture<Long> future = new FutureTask(new Callable<Long>() {
        @Override public Long call() throws Exception {
          return readSplits(context);
        }
      });
View Full Code Here

     */

    @SuppressWarnings("unchecked")
    public CallbackFuture(InvocationContext ic, AsyncHandler handler) {
        cft = new CallbackFutureTask(ic.getAsyncResponseListener(), handler);
        task = new FutureTask(cft);
        executor = ic.getExecutor();
       
        /*
         * TODO review.  We need to save the invocation context so we can set it on the
         * response (or fault) context so the FutureCallback has access to the handler list.
View Full Code Here

            public Message createMessage(Session session) throws JMSException {
                Message message = endpoint.getBinding().makeJmsMessage(exchange, in, session, null);
                message.setJMSReplyTo(replyTo);
                requestor.setReplyToSelectorHeader(in, message);

                FutureTask future;
                future = (!msgIdAsCorrId)
                        ? requestor.getReceiveFuture(message.getJMSCorrelationID(), endpoint.getConfiguration().getRequestTimeout())
                        : requestor.getReceiveFuture(callback);

                futureHolder.set(future);
View Full Code Here

            public Message createMessage(Session session) throws JMSException {
                Message message = endpoint.getBinding().makeJmsMessage(exchange, in, session, null);
                message.setJMSReplyTo(replyTo);
                requestor.setReplyToSelectorHeader(in, message);

                FutureTask future;
                future = (!msgIdAsCorrId)
                        ? requestor.getReceiveFuture(message.getJMSCorrelationID(), endpoint.getConfiguration().getRequestTimeout())
                        : requestor.getReceiveFuture(callback);

                futureHolder.set(future);
View Full Code Here

       
        EndpointInvocationContext eic = (EndpointInvocationContext) request.getInvocationContext();
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
       
        AsyncInvocationWorker worker = new AsyncInvocationWorker(m, params, cl, eic);
        FutureTask task = new FutureTask<AsyncInvocationWorker>(worker);
        executor.execute(task);
       
        return;
    }
View Full Code Here

       
        EndpointInvocationContext eic = (EndpointInvocationContext) request.getInvocationContext();
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
       
        AsyncInvocationWorker worker = new AsyncInvocationWorker(m, params, cl, eic);
        FutureTask task = new FutureTask<AsyncInvocationWorker>(worker);
        executor.execute(task);
       
        return;
    }
View Full Code Here

        ClassLoader cl = Thread.currentThread().getContextClassLoader();
       
        AsyncInvocationWorker worker = new AsyncInvocationWorker(target,
                                                                 methodInputParams,
                                                                 cl, eic);
        FutureTask task = new FutureTask<AsyncInvocationWorker>(worker);
       
        ExecutorFactory ef = (ExecutorFactory) FactoryRegistry.getFactory(ExecutorFactory.class);
        Executor executor = ef.getExecutorInstance(ExecutorFactory.SERVER_EXECUTOR);
       
        // If the property has been set to disable thread switching, then we can
View Full Code Here

       
        EndpointInvocationContext eic = (EndpointInvocationContext) request.getInvocationContext();
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
       
        AsyncInvocationWorker worker = new AsyncInvocationWorker(target, methodInputParams, cl, eic);
        FutureTask task = new FutureTask<AsyncInvocationWorker>(worker);
       
        ExecutorFactory ef = (ExecutorFactory) FactoryRegistry.getFactory(ExecutorFactory.class);
        Executor executor = ef.getExecutorInstance(ExecutorFactory.SERVER_EXECUTOR);
        // If the property has been set to disable thread switching, then we can
        // do so by using a SingleThreadedExecutor instance to continue processing
View Full Code Here

     */

    @SuppressWarnings("unchecked")
    public CallbackFuture(InvocationContext ic, AsyncHandler handler) {
        cft = new CallbackFutureTask(ic.getAsyncResponseListener(), handler);
        task = new FutureTask(cft);
        executor = ic.getExecutor();
       
        /*
         * TODO review.  We need to save the invocation context so we can set it on the
         * response (or fault) context so the FutureCallback has access to the handler list.
View Full Code Here

TOP

Related Classes of java.util.concurrent.FutureTask$Sync

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.