Examples of MailProcessor


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

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

    }

    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

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

     * @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

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

        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

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

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

     * {@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

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

    @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

Examples of org.apache.mahout.utils.email.MailProcessor

  private static final Logger log = LoggerFactory.getLogger(SequenceFilesFromMailArchives.class);

  public void createSequenceFiles(MailOptions options) throws IOException {
    ChunkedWriter writer = new ChunkedWriter(new Configuration(), options.getChunkSize(), new Path(options.getOutputDir()));
    MailProcessor processor = new MailProcessor(options, options.getPrefix(), writer);
    try {
      if (options.getInput().isDirectory()) {
        PrefixAdditionFilter filter = new PrefixAdditionFilter(processor, writer);
        options.getInput().listFiles(filter);
        log.info("Parsed {} messages from {}", filter.getMessageCount(), options.getInput().getAbsolutePath());
      } else {
        long start = System.currentTimeMillis();
        long cnt = processor.parseMboxLineByLine(options.getInput());
        long finish = System.currentTimeMillis();
        log.info("Parsed {} messages from {} in time: {}",
                 new Object[] { cnt, options.getInput().getAbsolutePath(), (finish - start) });
      }
    } finally {
View Full Code Here

Examples of org.apache.mahout.utils.email.MailProcessor

    @Override
    public boolean accept(File current) {
      if (current.isDirectory()) {
        log.info("At {}", current.getAbsolutePath());
        PrefixAdditionFilter nested = new PrefixAdditionFilter(new MailProcessor(
            processor.getOptions(), processor.getPrefix() + File.separator + current.getName(), writer), writer);
        current.listFiles(nested);
        long dirCount = nested.getMessageCount();
        log.info("Parsed {} messages from directory {}", dirCount, current.getAbsolutePath());
        messageCount += dirCount;
View Full Code Here

Examples of org.apache.mahout.utils.email.MailProcessor

  private static final int MAX_JOB_SPLIT_LOCATIONS = 1000000;

  public void createSequenceFiles(MailOptions options) throws IOException {
    ChunkedWriter writer = new ChunkedWriter(getConf(), options.getChunkSize(), new Path(options.getOutputDir()));
    MailProcessor processor = new MailProcessor(options, options.getPrefix(), writer);
    try {
      if (options.getInput().isDirectory()) {
        PrefixAdditionFilter filter = new PrefixAdditionFilter(processor, writer);
        options.getInput().listFiles(filter);
        log.info("Parsed {} messages from {}", filter.getMessageCount(), options.getInput().getAbsolutePath());
      } else {
        long start = System.currentTimeMillis();
        long cnt = processor.parseMboxLineByLine(options.getInput());
        long finish = System.currentTimeMillis();
        log.info("Parsed {} messages from {} in time: {}", cnt, options.getInput().getAbsolutePath(), finish - start);
      }
    } finally {
      Closeables.close(writer, false);
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.