Examples of Executor


Examples of java.util.concurrent.Executor

    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

Examples of java.util.concurrent.Executor

    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

Examples of java.util.concurrent.Executor

          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

Examples of java.util.concurrent.Executor

                                "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

Examples of java.util.concurrent.Executor

        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

Examples of java.util.concurrent.Executor

        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

Examples of java.util.concurrent.Executor

        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

Examples of java.util.concurrent.Executor

   * @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

Examples of java.util.concurrent.Executor

   * 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

Examples of java.util.concurrent.Executor

    * @throws java.util.concurrent.RejectedExecutionException if there is no mainExecutor or bootstrapExecutor
    * @see Executor#execute(Runnable)
    */
   public void execute(Runnable command)
   {
      Executor exec = mainExecutor;
      if (exec != null)
      {
         exec.execute(command);
         return;
      }

      exec = bootstrapExecutor;
      if (exec != null)
      {
         exec.execute(command);
         return;
      }
     
      throw new RejectedExecutionException("No executor available in " + this.getClass().getName());
   }
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.