Package org.apache.cxf.workqueue

Examples of org.apache.cxf.workqueue.AutomaticWorkQueue


                        }
                    }
                };
                WorkQueueManager mgr = outMessage.getExchange().get(Bus.class)
                    .getExtension(WorkQueueManager.class);
                AutomaticWorkQueue queue = mgr.getNamedWorkQueue("http-conduit");
                if (queue == null) {
                    queue = mgr.getAutomaticWorkQueue();
                }
                queue.execute(runnable);
            }
        }
View Full Code Here


                        }
                    }
                };
                WorkQueueManager mgr = outMessage.getExchange().get(Bus.class)
                    .getExtension(WorkQueueManager.class);
                AutomaticWorkQueue queue = mgr.getNamedWorkQueue("http-conduit");
                if (queue == null) {
                    queue = mgr.getAutomaticWorkQueue();
                }
                queue.execute(runnable);
            }
        }
View Full Code Here

                    };
                }
                if (ex == null || forceWQ) {
                    WorkQueueManager mgr = outMessage.getExchange().get(Bus.class)
                        .getExtension(WorkQueueManager.class);
                    AutomaticWorkQueue qu = mgr.getNamedWorkQueue("http-conduit");
                    if (qu == null) {
                        qu = mgr.getAutomaticWorkQueue();
                    }
                    long timeout = 1000;
                    if (policy != null && policy.isSetAsyncExecuteTimeout()) {
                        timeout = policy.getAsyncExecuteTimeout();
                    }
                    if (timeout > 0) {
                        qu.execute(runnable, timeout);
                    } else {
                        qu.execute(runnable);
                    }
                } else {
                    outMessage.getExchange().put(Executor.class.getName()
                                             + ".USING_SPECIFIED", Boolean.TRUE);
                    ex.execute(runnable);
View Full Code Here

                    };
                }
                if (ex == null || forceWQ) {
                    WorkQueueManager mgr = outMessage.getExchange().get(Bus.class)
                        .getExtension(WorkQueueManager.class);
                    AutomaticWorkQueue qu = mgr.getNamedWorkQueue("http-conduit");
                    if (qu == null) {
                        qu = mgr.getAutomaticWorkQueue();
                    }
                    long timeout = 1000;
                    if (policy != null && policy.isSetAsyncExecuteTimeout()) {
                        timeout = policy.getAsyncExecuteTimeout();
                    }
                    if (timeout > 0) {
                        qu.execute(runnable, timeout);
                    } else {
                        qu.execute(runnable);
                    }
                } else {
                    outMessage.getExchange().put(Executor.class.getName()
                                             + ".USING_SPECIFIED", Boolean.TRUE);
                    ex.execute(runnable);
View Full Code Here

        WorkQueueManager wqm = control.createMock(WorkQueueManager.class);

        EasyMock.expect(dest.getBus()).andReturn(bus);
        EasyMock.expect(bus.getExtension(WorkQueueManager.class)).andReturn(wqm);
        EasyMock.expect(wqm.getAutomaticWorkQueue()).andReturn(
            new AutomaticWorkQueue() {
                @Override
                public void execute(Runnable work, long timeout) {
                }

                @Override
View Full Code Here

     * @return
     */
    public static Executor createExecutor(Bus bus, String name) {
        WorkQueueManager manager = bus.getExtension(WorkQueueManager.class);
        if (manager != null) {
            AutomaticWorkQueue workQueue1 = manager.getNamedWorkQueue(name);
            final WorkQueue workQueue = (workQueue1 == null) ? manager.getAutomaticWorkQueue() : workQueue1;
            return new Executor() {
               
                @Override
                public void execute(Runnable command) {
View Full Code Here

                        };
                    }
                    if (ex == null || forceWQ) {
                        WorkQueueManager mgr = outMessage.getExchange().get(Bus.class)
                            .getExtension(WorkQueueManager.class);
                        AutomaticWorkQueue qu = mgr.getNamedWorkQueue("http-conduit");
                        if (qu == null) {
                            qu = mgr.getAutomaticWorkQueue();
                        }
                        long timeout = 1000;
                        if (policy != null && policy.isSetAsyncExecuteTimeout()) {
                            timeout = policy.getAsyncExecuteTimeout();
                        }
                        if (timeout > 0) {
                            qu.execute(runnable, timeout);
                        } else {
                            qu.execute(runnable);
                        }
                    } else {
                        outMessage.getExchange().put(Executor.class.getName()
                                                 + ".USING_SPECIFIED", Boolean.TRUE);
                        ex.execute(runnable);
View Full Code Here

                try {
                    Executor ex = outMessage.getExchange().get(Executor.class);
                    if (ex == null) {
                        WorkQueueManager mgr = outMessage.getExchange().get(Bus.class)
                            .getExtension(WorkQueueManager.class);
                        AutomaticWorkQueue qu = mgr.getNamedWorkQueue("http-conduit");
                        if (qu == null) {
                            qu = mgr.getAutomaticWorkQueue();
                        }
                        long timeout = 5000;
                        if (policy != null && policy.isSetAsyncExecuteTimeout()) {
                            timeout = policy.getAsyncExecuteTimeout();
                        }
                        if (timeout > 0) {
                            qu.execute(runnable, timeout);
                        } else {
                            qu.execute(runnable);
                        }
                    } else {
                        outMessage.getExchange().put(Executor.class.getName()
                                                 + ".USING_SPECIFIED", Boolean.TRUE);
                        ex.execute(runnable);
View Full Code Here

TOP

Related Classes of org.apache.cxf.workqueue.AutomaticWorkQueue

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.