Package org.apache.activemq.thread

Examples of org.apache.activemq.thread.Task


        }
    }

    public FanoutTransport() throws InterruptedIOException {
        // Setup a task that is used to reconnect the a connection async.
        reconnectTask = DefaultThreadPools.getDefaultTaskRunnerFactory().createTaskRunner(new Task() {
            public boolean iterate() {
                return doConnect();
            }
        }, "ActiveMQ Fanout Worker: " + System.identityHashCode(this));
    }
View Full Code Here


    public synchronized void start() throws Exception {
        if (!started.compareAndSet(false, true)) {
            return;
        }

        checkpointTask = taskRunnerFactory.createTaskRunner(new Task() {
            public boolean iterate() {
                return doCheckpoint();
            }
        }, "ActiveMQ Journal Checkpoint Worker");
View Full Code Here

        this.lock = referenceStore.getStoreLock();
        this.transactionStore = adapter.getTransactionStore();
        this.referenceStore = referenceStore;
        this.transactionTemplate = new TransactionTemplate(adapter, new ConnectionContext(
                new NonCachedMessageEvaluationContext()));
        asyncWriteTask = adapter.getTaskRunnerFactory().createTaskRunner(new Task() {
            public boolean iterate() {
                asyncWrite();
                return false;
            }
        }, "Checkpoint: " + destination);
View Full Code Here

        final AtomicInteger queue = new AtomicInteger(0);
        final CountDownLatch doneCountDownLatch = new CountDownLatch(1);
        final int ENQUEUE_COUNT = 100000;
       
        TaskRunnerFactory factory = new TaskRunnerFactory();       
        final TaskRunner runner = factory.createTaskRunner(new Task() {           
            public boolean iterate() {
                if( queue.get()==0 ) {
                    return false;
                } else {
                    while(queue.get()>0) {
View Full Code Here

    public FailoverTransport() throws InterruptedIOException {

      stateTracker.setTrackTransactions(true);
     
        // Setup a task that is used to reconnect the a connection async.
        reconnectTask = DefaultThreadPools.getDefaultTaskRunnerFactory().createTaskRunner(new Task() {

            public boolean iterate() {

                Exception failure=null;
                synchronized (reconnectMutex) {
View Full Code Here

    public JournalPersistenceAdapter(Journal journal, PersistenceAdapter longTermPersistence, TaskRunnerFactory taskRunnerFactory) throws IOException {

        this.journal = journal;
        journal.setJournalEventListener(this);
       
        checkpointTask = taskRunnerFactory.createTaskRunner(new Task(){
            public boolean iterate() {
                return doCheckpoint();
            }
        }, "ActiveMQ Journal Checkpoint Worker");
View Full Code Here

        File dir = ((JournalImpl)journal).getLogDirectory();
        String name=dir.getAbsolutePath()+File.separator+"kaha.db";
        store=StoreFactory.open(name,"rw");
       
        checkpointTask = taskRunnerFactory.createTaskRunner(new Task(){
            public boolean iterate() {
                return doCheckpoint();
            }
        }, "ActiveMQ Checkpoint Worker");
View Full Code Here

    public QuickJournalPersistenceAdapter(Journal journal, PersistenceAdapter longTermPersistence, TaskRunnerFactory taskRunnerFactory) throws IOException {

        this.journal = journal;
        journal.setJournalEventListener(this);
       
        checkpointTask = taskRunnerFactory.createTaskRunner(new Task(){
            public boolean iterate() {
                return doCheckpoint();
            }
        }, "ActiveMQ Checkpoint Worker");
View Full Code Here

        }       
    }

    public FanoutTransport() throws InterruptedIOException {
        // Setup a task that is used to reconnect the a connection async.
        reconnectTask = DefaultThreadPools.getDefaultTaskRunnerFactory().createTaskRunner(new Task() {
            public boolean iterate() {
                return doConnect();
            }
        }, "ActiveMQ Fanout Worker: "+System.identityHashCode(this));
    }
View Full Code Here

   
    public CacheEvictionUsageListener(UsageManager usageManager, int usageHighMark, int usageLowMark, TaskRunnerFactory taskRunnerFactory) {
        this.usageManager = usageManager;
        this.usageHighMark = usageHighMark;
        this.usageLowMark = usageLowMark;
        evictionTask = taskRunnerFactory.createTaskRunner(new Task(){
            public boolean iterate() {
                return evictMessages();
            }
        }, "Cache Evictor: "+System.identityHashCode(this));
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.thread.Task

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.