01: /****************************************************************
02: * Licensed to the Apache Software Foundation (ASF) under one *
03: * or more contributor license agreements. See the NOTICE file *
04: * distributed with this work for additional information *
05: * regarding copyright ownership. The ASF licenses this file *
06: * to you under the Apache License, Version 2.0 (the *
07: * "License"); you may not use this file except in compliance *
08: * with the License. You may obtain a copy of the License at *
09: * *
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: ****************************************************************/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: }
|