Package java.util.concurrent

Examples of java.util.concurrent.Executor


                if(loopback) {
                    if(log.isTraceEnabled()) log.trace(new StringBuilder("looping back message ").append(msg));
                    if(msg.getSrc() == null)
                        msg.setSrc(local_addr);

                    Executor pool=msg.isFlagSet(Message.OOB)? oob_pool : default_pool;
                    pool.execute(new Runnable() {
                        public void run() {
                            up_prot.up(evt);
                        }
                    });
                }
View Full Code Here


    FakeDataManager fdm = new FakeDataManager();
      TestProcessor.sampleData1(fdm);
      BufferManager bm = BufferManagerFactory.getStandaloneBufferManager();
      SessionAwareCache<CachedResults> cache = new SessionAwareCache<CachedResults>();
      cache.setBufferManager(bm);
      Executor executor = new Executor() {
      @Override
      public void execute(Runnable command) {
        command.run();
      }
      };
View Full Code Here

    hdm.addData("SELECT mattable.info.e2, mattable.info.e1 FROM mattable.info", new List[] {Arrays.asList(1, "a"), Arrays.asList(2, "a")});
   
      BufferManager bm = BufferManagerFactory.getStandaloneBufferManager();
      SessionAwareCache<CachedResults> cache = new SessionAwareCache<CachedResults>();
      cache.setBufferManager(bm);
      Executor executor = new Executor() {
      @Override
      public void execute(Runnable command) {
        command.run();
      }
      };
View Full Code Here

          context.setGlobalTableStore(new TempTableStore("SYSTEM"));
        }
        if (!(dataManager instanceof TempTableDataManager)) {
          SessionAwareCache<CachedResults> cache = new SessionAwareCache<CachedResults>();
          cache.setBufferManager(bufferMgr);
          Executor executor = new Executor() {
          @Override
          public void execute(Runnable command) {
            command.run();
          }
          };         
View Full Code Here

                                "Null message received from message consumer.",
                                " Exiting ListenerThread::run().");
                        return;
                    }
                    while (message != null) {
                        Executor executor = theTransport.callback.getExecutor();
                        if (executor == null) {
                            executor = theTransport.bus
                                .getWorkQueueManager().getAutomaticWorkQueue();
                        }
                        if (executor != null) {
                            try {
                                executor.execute(new JMSExecutor(theTransport, message));
                                message = null;
                            } catch (RejectedExecutionException ree) {
                                //FIXME - no room left on workqueue, what to do
                                //for now, loop until it WILL fit on the queue,
                                //although we could just dispatch on this thread.
View Full Code Here

        doTestInvokeAsync(useAutomaticWorkQueue, false);
    }

    public void doTestInvokeAsync(final boolean useAutomaticWorkQueue, boolean decoupled) throws Exception {

        Executor executor =  null;
        if (useAutomaticWorkQueue) {
            queueManager = new WorkQueueManagerImpl(bus);
            executor = queueManager.getAutomaticWorkQueue();
        } else {
            executorService = Executors.newFixedThreadPool(1);
View Full Code Here

        ServerBinding sb = ei.getServerBinding();
        EndpointReferenceType ref = ei.getEndpointReferenceType();
        EndpointReferenceUtils.setAddress(ref, "test://localhost:7777/test");
        sb.activate();
        TestServerBinding tsb = (TestServerBinding)sb;
        ei.setExecutor(new Executor() {
            public void execute(Runnable command) {
                command.run();           
            }
        });
View Full Code Here

        outputContext.getOutputStream().flush();
        outputContext.getOutputStream().close();
   

    private void executeAsync(Runnable command) {
        Executor executor =
            sbeCallback.getExecutor() != null
            ? sbeCallback.getExecutor()
            : getBus().getWorkQueueManager().getAutomaticWorkQueue();
        try {
            executor.execute(command);
        } catch (RejectedExecutionException ree) {
            LOG.log(Level.WARNING, "ONEWAY_FALLBACK_TO_DIRECT_MSG", ree);
            command.run();
        }
    }   
View Full Code Here

   * @param state {@link Service.State#STARTING} or
   *     {@link Service.State#STOPPING}, used by the default implementation for
   *     naming the thread
   */
  protected Executor executor(final State state) {
    return new Executor() {
      @Override
      public void execute(Runnable command) {
        new Thread(command, getServiceName() + " " + state).start();
      }
    };
View Full Code Here

   * priority. The returned executor's {@link Executor#execute(Runnable)
   * execute()} method is called when this service is started, and should return
   * promptly.
   */
  protected Executor executor() {
    return new Executor() {
      @Override
      public void execute(Runnable command) {
        new Thread(command, getServiceName()).start();
      }
    };
View Full Code Here

TOP

Related Classes of java.util.concurrent.Executor

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.