serge       01/10/25 21:51:14

  Added:       src/java/org/apache/james/transport/mailets/debug
                        Counter.java
  Log:
  Simple mailet that counts in memory and logs the counter.  Useful for testing how 
many messages gets through.
  
  Revision  Changes    Path
  1.1                  
jakarta-james/src/java/org/apache/james/transport/mailets/debug/Counter.java
  
  Index: Counter.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.james.transport.mailets.debug;
  
  import org.apache.mailet.*;
  
  /**
   * A simple in memory counter.  Designed to count messages sent to this recipient
   * for debugging purposes.
   *
   * @author  Serge Knystautas <[EMAIL PROTECTED]>
   */
  public class Counter extends GenericMailet {
      int counter = 0;
  
      public void service(Mail mail) {
          //Do nothing
          counter++;
          log(counter + "");
          mail.setState(Mail.GHOST);
      }
  
      public String getMailetInfo() {
          return "Counter Mailet";
      }
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to