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