View Javadoc

1   /*****************************************************************
2    * Licensed to the Apache Software Foundation (ASF) under one   *
3    * or more contributor license agreements.  See the NOTICE file *
4    * distributed with this work for additional information        *
5    * regarding copyright ownership.  The ASF licenses this file   *
6    * to you under the Apache License, Version 2.0 (the            *
7    * "License"); you may not use this file except in compliance   *
8    * with the License.  You may obtain a copy of the License at   *
9    *                                                              *
10   *   http://www.apache.org/licenses/LICENSE-2.0                 *
11   *                                                              *
12   * Unless required by applicable law or agreed to in writing,   *
13   * software distributed under the License is distributed on an  *
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
15   * KIND, either express or implied.  See the License for the    *
16   * specific language governing permissions and limitations      *
17   * under the License.                                           *
18   ****************************************************************/
19  
20  package org.apache.mailet;
21  
22  import java.util.Iterator;
23  
24  /***
25   * A mailet configuration object used by a mailet container to pass information
26   * to a mailet during initialization.
27   * <p>
28   * The configuration information contains initialization parameters, which are a set
29   * of name/value pairs, and a MailetContext object, which gives the mailet information
30   * about the server.
31   *
32   * @version 1.0.0, 24/04/1999
33   */
34  public interface MailetConfig {
35  
36      /***
37       * Returns a String containing the value of the named initialization
38       * parameter, or null if the parameter does not exist.
39       *
40       * @param name - a String specifying the name of the initialization parameter
41       * @return a String containing the value of the initialization parameter
42       */
43      String getInitParameter(String name);
44  
45      /***
46       * Returns the names of the mailet's initialization parameters as an
47       * Iterator of String objects, or an empty Iterator if the mailet has
48       * no initialization parameters.
49       *
50       * @return an Iterator of String objects containing the names of the mailet's
51       *      initialization parameters
52       */
53      Iterator getInitParameterNames();
54  
55      /***
56       * Returns a reference to the MailetContext in which the mailet is
57       * executing.
58       *
59       * @return a MailetContext object, used by the mailet to interact with its
60       *      mailet container
61       */
62      MailetContext getMailetContext();
63  
64      /***
65       * Returns the name of this mailet instance. The name may be provided via
66       * server administration, assigned in the application deployment descriptor,
67       * or for an unregistered (and thus unnamed) mailet instance it will be the
68       * mailet's class name.
69       *
70       * @return the name of the mailet instance
71       */
72      String getMailetName();
73  }