Package java.util.concurrent

Examples of java.util.concurrent.Executor.execute()


                    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


                            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

        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

   public void execute(Runnable command)
   {
      Executor exec = mainExecutor;
      if (exec != null)
      {
         exec.execute(command);
         return;
      }

      exec = bootstrapExecutor;
      if (exec != null)
View Full Code Here

      }

      exec = bootstrapExecutor;
      if (exec != null)
      {
         exec.execute(command);
         return;
      }
     
      throw new RejectedExecutionException("No executor available in " + this.getClass().getName());
   }
View Full Code Here

    btThread.setServerListener(this);

    btAddress = btThread.getLocalBtAddress();

    Executor executor = Executors.newSingleThreadExecutor();
    executor.execute(btThread);
  }

  public void serverStarted(String url) {
    getServerURLTextField().setText(url);
    getStatusLabel().setText("Running");
View Full Code Here

      e.printStackTrace();
    }
    InputStreamReader isr = new InputStreamReader(reader);
    final BufferedReader br = new BufferedReader(isr);
    Executor executor = Executors.newCachedThreadPool(new DaemonThreadFactory("test"));
    executor.execute(new Runnable()
    {

      public void run()
      {
        String line = null;
View Full Code Here

                        final Runnable origRunnable = runnable;
                        runnable = new Runnable() {
                            public void run() {
                                outMessage.getExchange().put(Executor.class.getName()
                                                             + ".USING_SPECIFIED", Boolean.TRUE);
                                ex2.execute(origRunnable);
                            }
                        };
                    }
                    if (ex == null || forceWQ) {
                        WorkQueueManager mgr = outMessage.getExchange().get(Bus.class)
View Full Code Here

            SocketProcessor sc = processorCache.pop();
            if ( sc == null ) sc = new SocketProcessor(socket,status);
            else sc.reset(socket,status);
            Executor executor = getExecutor();
            if (dispatch && executor != null) {
                executor.execute(sc);
            } else {
                sc.run();
            }
        } catch (RejectedExecutionException ree) {
            log.warn(sm.getString("endpoint.executor.fail", socket), ree);
View Full Code Here

            } else {
                SocketWrapper<Long> wrapper =
                        connections.get(Long.valueOf(socket));
                // Make sure connection hasn't been closed
                if (wrapper != null) {
                    executor.execute(new SocketProcessor(wrapper, status));
                }
            }
        } catch (RejectedExecutionException x) {
            log.warn("Socket processing request was rejected for:"+socket,x);
            return false;
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.