Package edu.emory.mathcs.backport.java.util.concurrent

Examples of edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue$SerializableLock


    private final Executor executor;

    public ServicePool(ServerService next, final String name, final int threads, final long keepAliveTime) {
        this.next = next;

        ThreadPoolExecutor p = new ThreadPoolExecutor(threads, threads, keepAliveTime, TimeUnit.MILLISECONDS, new LinkedBlockingQueue());
        p.setThreadFactory(new ThreadFactory() {
            private volatile int id = 0;

            public Thread newThread(Runnable arg0) {
                Thread thread = new Thread(arg0, name + " " + getNextID());
View Full Code Here


    public void start() throws AxisFault {
        // create thread pool of workers
        ExecutorService workerPool = new ThreadPoolExecutor(
                1,
                WORKERS_MAX_THREADS, WORKER_KEEP_ALIVE, TIME_UNIT,
                new LinkedBlockingQueue(),
                new org.apache.axis2.util.threadpool.DefaultThreadFactory(
                        new ThreadGroup("JMS Worker thread group"),
                        "JMSWorker"));

        Iterator iter = connectionFactories.values().iterator();
View Full Code Here

    /**
     * Create the executor used to launch the single requestConnectionListener
     */
    public ExecutorService newListenerExecutor(int port) {
        return new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS,
                                      new LinkedBlockingQueue(),
                                      new DefaultThreadFactory(
                                              new ThreadGroup("Listener thread group"),
                                              "HttpListener-" + this.port));
    }
View Full Code Here

    /**
     * Create the queue used to hold incoming requests when requestCoreThreadPoolSize threads are busy.
     * Default is an unbounded queue.
     */
    public BlockingQueue newRequestBlockingQueue() {
        return new LinkedBlockingQueue();
    }
View Full Code Here

     * Start this listener
     */
    public void start() throws AxisFault {
        workerPool = new ThreadPoolExecutor(1,
                                            WORKERS_MAX_THREADS, WORKER_KEEP_ALIVE, TIME_UNIT,
                                            new LinkedBlockingQueue(),
                                            new DefaultThreadFactory(
                                                    new ThreadGroup("Mail Worker thread group"),
                                                    "MailWorker"));

        messageQueue = new LinkedBlockingQueue();

        this.configurationContext.getThreadPool().execute(this);

        MailWorkerManager mailWorkerManager = new MailWorkerManager(configurationContext,
                                                                    messageQueue, workerPool,
View Full Code Here

    public void sendReceive(final MessageContext msgContext, final String msgId) throws AxisFault {
        /**
         * This will be bloked invocation
         */
        SimpleMailListener listener = new SimpleMailListener(new LinkedBlockingQueue()) {
            public void start() throws AxisFault {
                long timeStatus;
                LinkedBlockingQueue queue = getLinkedBlockingQueue();
                while (true) {
                    long startTime = System.currentTimeMillis();
                    try {
                        MessageContext msgCtx = (MessageContext) queue.take();
                        MailBasedOutTransportInfo transportInfo = (MailBasedOutTransportInfo) msgCtx
                                .getProperty(org.apache.axis2.Constants.OUT_TRANSPORT_INFO);
                        if (transportInfo.getInReplyTo() == null) {
                            String error = EMailSender.class.getName() +" Coudn't simulate request/response without In-Reply-To Mail header";
                            log.error(error);
View Full Code Here

TOP

Related Classes of edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue$SerializableLock

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.