Package org.apache.james.mailetcontainer.api

Examples of org.apache.james.mailetcontainer.api.MailProcessor


    /*
     * (non-Javadoc)
     * @see org.apache.james.transport.MailProcessor#service(org.apache.mailet.Mail)
     */
    public void service(Mail mail) throws MessagingException {
        MailProcessor processor = getProcessor(mail.getState());
        if (processor != null) {
            processor.service(mail);
        } else {
            throw new MessagingException("No processor found for mail " + mail.getName() + " with state " + mail.getState());
        }
    }
View Full Code Here


    }

    private void createProcessorMBean(String baseObjectName, String processorName, MBeanServer mBeanServer) throws NotCompliantMBeanException {
        String processorMBeanName = baseObjectName + "processor=" + processorName;
       
        MailProcessor processor = mailProcessor.getProcessor(processorName);
        ProcessorDetail processorDetail;
       
        // check if the processor is an instance of ProcessorDetail. If not create a wrapper around it. This will give us not all
        // statistics but at least a few of them
        if (processor instanceof ProcessorDetail) {
View Full Code Here

     * @throws NotCompliantMBeanException
     */
    private void registerProcessorMBean(String baseObjectName, String processorName) throws NotCompliantMBeanException {
        String processorMBeanName = baseObjectName + "processor=" + processorName;
       
        MailProcessor processor = mailProcessor.getProcessor(processorName);
        ProcessorDetail processorDetail;
       
        // check if the processor is an instance of ProcessorDetail. If not create a wrapper around it. This will give us not all
        // statistics but at least a few of them
        if (processor instanceof ProcessorDetail) {
View Full Code Here

        if (mailetContainer == null) return new ArrayList<Matcher>();
        return mailetContainer.getMatchers();
    }

    private MailetContainer getMailetContainerByName(String processorName) {       
        MailProcessor processor = mailProcessor.getProcessor(processorName);
        if (!(processor instanceof MailetContainer)) return null;
        // TODO: decide, if we have to visit all sub-processors for being ProcessorLists
        // on their very own and collecting the processor names deeply.
        return (MailetContainer)processor;
    }
View Full Code Here

    /*
     * (non-Javadoc)
     * @see org.apache.james.transport.MailProcessor#service(org.apache.mailet.Mail)
     */
    public void service(Mail mail) throws MessagingException {
        MailProcessor processor = getProcessor(mail.getState());
        if (processor != null) {
            processor.service(mail);
        } else {
            throw new MessagingException("No processor found for mail " + mail.getName() + " with state " + mail.getState());
        }
    }
View Full Code Here

     * {@link Mail#getState()}
     */
    public void service(Mail mail) throws MessagingException {
        long start = System.currentTimeMillis();
        MessagingException ex = null;
        MailProcessor processor = getProcessor(mail.getState());

        if (processor != null) {
            logger.debug("Call MailProcessor " + mail.getState());
            try {
                processor.service(mail);

                if (Mail.GHOST.equals(mail.getState())) {
                    LifecycleUtil.dispose(mail);
                }
                /*
 
View Full Code Here

    @PreDestroy
    public void dispose() {
        String names[] = getProcessorStates();
        for (String name : names) {
            MailProcessor processor = getProcessor(name);
            if (processor instanceof AbstractStateMailetProcessor) {
                ((AbstractStateMailetProcessor) processor).destroy();
            }

        }
View Full Code Here

TOP

Related Classes of org.apache.james.mailetcontainer.api.MailProcessor

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.