Package org.apache.james.queue.api.MailQueue

Examples of org.apache.james.queue.api.MailQueue.MailQueueItem.done()


                        }
                       
                        // Clear the object handle to make sure it recycles
                        // this object.
                        mail = null;
                        queueItem.done(true);
                    } catch (Exception e) {
                        // Prevent unexpected exceptions from causing looping by
                        // removing message from outgoing.
                        // DO NOT CHANGE THIS to catch Error! For example, if
                        // there were an OutOfMemory condition caused because
View Full Code Here


                        // there were an OutOfMemory condition caused because
                        // something else in the server was abusing memory, we would
                        // not want to start purging the retrying spool!
                        LifecycleUtil.dispose(mail);
                        //workRepository.remove(key);
                        queueItem.done(false);
                        throw new MailQueueException("Unable to perform dequeue", e);
                    }
                   
                  
                } catch (Throwable e) {
View Full Code Here

                    logger.debug(debugBuffer.toString());
                }

                try {
                    mailProcessor.service(mail);
                    queueItem.done(true);
                } catch (Exception e) {
                    if (active.get() && logger.isErrorEnabled()) {
                        logger.error("Exception processing mail in JamesSpoolManager.run " + e.getMessage(), e);
                    }
                    queueItem.done(false);
View Full Code Here

                    queueItem.done(true);
                } catch (Exception e) {
                    if (active.get() && logger.isErrorEnabled()) {
                        logger.error("Exception processing mail in JamesSpoolManager.run " + e.getMessage(), e);
                    }
                    queueItem.done(false);

                } finally {
                    LifecycleUtil.dispose(mail);
                    mail = null;
                }
View Full Code Here

                        }

                        // Clear the object handle to make sure it recycles
                        // this object.
                        mail = null;
                        queueItem.done(true);
                    } catch (Exception e) {
                        // Prevent unexpected exceptions from causing looping by
                        // removing message from outgoing.
                        // DO NOT CHANGE THIS to catch Error! For example, if
                        // there were an OutOfMemory condition caused because
View Full Code Here

                        // would
                        // not want to start purging the retrying spool!
                        log("Exception caught in RemoteDelivery.run()", e);
                        LifecycleUtil.dispose(mail);
                        // workRepository.remove(key);
                        queueItem.done(false);
                        throw new MailQueueException("Unable to perform dequeue", e);
                    }

                } catch (Throwable e) {
                    if (!destroyed) {
View Full Code Here

        assertEquals(2, queue.getSize());

        MailQueueItem item = queue.deQueue();
        checkMail(mail, item.getMail());
        item.done(false);

        TimeUnit.MILLISECONDS.sleep(200);

        // ok we should get the same email again
        assertEquals(2, queue.getSize());
View Full Code Here

        // ok we should get the same email again
        assertEquals(2, queue.getSize());
        MailQueueItem item2 = queue.deQueue();
        checkMail(mail, item2.getMail());
        item2.done(true);

        TimeUnit.MILLISECONDS.sleep(200);

        assertEquals(1, queue.getSize());
        MailQueueItem item3 = queue.deQueue();
View Full Code Here

        TimeUnit.MILLISECONDS.sleep(200);

        assertEquals(1, queue.getSize());
        MailQueueItem item3 = queue.deQueue();
        checkMail(mail2, item3.getMail());
        item3.done(true);

        TimeUnit.MILLISECONDS.sleep(200);

        // should be empty
        assertEquals(0, queue.getSize());
View Full Code Here

        assertEquals(2, queue.getSize());

        // as we enqueued the mail with delay we should get mail2 first
        MailQueueItem item = queue.deQueue();
        checkMail(mail2, item.getMail());
        item.done(true);

        TimeUnit.MILLISECONDS.sleep(200);

        assertEquals(1, queue.getSize());
        MailQueueItem item2 = queue.deQueue();
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.