KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jsmtpd > core > common > IGenericPlugin


1 /*
2  *
3  * Jsmtpd, Java SMTP daemon
4  * Copyright (C) 2005 Jean-Francois POUX, jf.poux@laposte.net
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19  *
20  */

21 package org.jsmtpd.core.common;
22
23 /**
24  * Any plugins must implement this interface
25  * plugins may be used from multiple threads,
26  * depending on your configuration.<br>
27  *
28  * <b>You have to ensure thread safety</b><br>
29  *
30  * Methods are not marked synchronized
31  * because trivial plugins may not need it.
32  * <br><br>
33  * <b>Plugin format</b>
34  * <br>
35  * Plugins are configured via the etc/plugin-config.xml file.<br>
36  * Each propertyset element is applied to the plugin<br>
37  * The plugin loader expects to find a plugin public method corresponding to the name attribute of the propertyset.
38  * The name is case sensitive, (first letter uppercase, fo java conventions).<br><br>
39  *
40  * Example :<br>
41  * <pre>
42  * &ltACLSetup name="Basic ACL" class="org.jsmtpd.plugins.acls.SimpleACL"&gt
43  * &ltpropertyset name="RelayedHosts" value="127.0.0.1,localhost,172.16.0.20,172.16.0.23"&gt&lt/propertyset&gt
44  * &ltpropertyset name="ValidUsers" value="*@localhost,*@mail.taldius.ath.cx"&gt&lt/propertyset&gt
45  * &lt/ACLSetup&gt
46  * </pre>
47  *
48  * Will load the class "org.jsmtpd.plugins.acls.SimpleACL" under the name "Basic ACL" <br>
49  * It will then invoque the method setRelayedHosts with the string parameter "127.0.0.1,localhost,172.16.0.20,172.16.0.23" <br>
50  *
51  * @see org.jsmtpd.plugins.acls.SimpleACL
52  * @see org.jsmtpd.config.PluginLoader
53  * @author Jean-Francois POUX
54  *
55  */

56 public interface IGenericPlugin {
57     /**
58      * @return this plugin's name
59      */

60     public String JavaDoc getPluginName();
61
62     /**
63      * Perform initialisation of the plugin.
64      * if an error
65      * occurs, the plugin is not functional
66      * @throws PluginInitException
67      */

68     public void initPlugin() throws PluginInitException;
69     /**
70      * Invoked on server shutdown
71      */

72     public void shutdownPlugin();
73
74 }
Popular Tags