KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > extensions > types > DefaultPlugin


1 /*
2  * SSL-Explorer
3  *
4  * Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
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 of
9  * the License, or (at your option) any later version.
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */

19             
20 package com.sslexplorer.extensions.types;
21
22 import org.apache.commons.logging.Log;
23 import org.apache.commons.logging.LogFactory;
24 import org.jdom.Element;
25
26 import com.sslexplorer.extensions.ExtensionDescriptor;
27 import com.sslexplorer.extensions.ExtensionException;
28
29 /**
30  * Default implementation of a {@link Plugin} that does nothing.
31  *
32  * @author Brett Smith <a HREF="mailto: brett@3sp.com">&lt;brett@3sp.com&gt;</a>
33  */

34 public class DefaultPlugin extends AbstractPlugin {
35
36     final static Log log = LogFactory.getLog(DefaultPlugin.class);
37
38     private PluginDefinition definition;
39
40     /**
41      * Constructor.
42      *
43      * @param tilesConfigFile tiles configuration file
44      * @param canStop can stop plugin
45      */

46     public DefaultPlugin(String JavaDoc tilesConfigFile, boolean canStop) {
47         super(tilesConfigFile, canStop);
48     }
49
50     /* (non-Javadoc)
51      * @see com.sslexplorer.extensions.types.Plugin#startPlugin(com.sslexplorer.extensions.types.PluginDefinition, com.sslexplorer.extensions.ExtensionDescriptor, org.jdom.Element)
52      */

53     public void startPlugin(PluginDefinition definition, ExtensionDescriptor descriptor, Element element) throws ExtensionException {
54         this.definition = definition;
55         if (log.isInfoEnabled())
56             log.info("Starting plugin '" + definition.getName() + "'");
57     }
58
59     /* (non-Javadoc)
60      * @see com.sslexplorer.extensions.types.Plugin#activatePlugin()
61      */

62     public void activatePlugin() throws ExtensionException {
63         if (log.isInfoEnabled())
64             log.info("Activating plugin '" + definition.getName() + "'");
65     }
66
67     /* (non-Javadoc)
68      * @see com.sslexplorer.extensions.types.Plugin#stopPlugin()
69      */

70     public void stopPlugin() throws ExtensionException {
71         if (log.isInfoEnabled())
72             log.info("Stopping plugin '" + definition.getName() + "'");
73     }
74
75     /**
76      * Get the plugin definition for this plugin implementation. This will only
77      * be available after the plugin has been initialised with
78      * {@link #startPlugin}.
79      *
80      * @return plugin definition
81      */

82     public PluginDefinition getPluginDefinition() {
83         return definition;
84     }
85
86 }
87
Popular Tags