com.scooterframework.admin
Class Plugin

java.lang.Object
  extended by com.scooterframework.admin.Plugin
Direct Known Subclasses:
AbstractCacheProvider

public abstract class Plugin
extends java.lang.Object

Plugin class has methods to manage a plug-in. Scooter framework will call these methods. Plug-in implementation classes should implement these methods if they want framework to manage their life cycles.


Field Summary
static java.lang.String KEY_PLUGIN_CLASS_NAME
          Key to represent plugin class name property.
static java.lang.String KEY_PLUGIN_NAME
          Key to represent plugin name property.
protected  LogUtil log
           
 
Constructor Summary
protected Plugin(java.util.Properties p)
           
 
Method Summary
 java.lang.String getName()
          Returns the plugin name
 java.lang.String getPluginClassName()
          Returns the plugin class name
 java.util.Properties getProperties()
          Returns the properties of the plugin.
 java.lang.String getProperty(java.lang.String name)
          Returns property value.
 java.lang.String getProperty(java.lang.String name, java.lang.String defaultValue)
          Returns property value.
 java.lang.String getVersion()
          Returns the plugin version
 boolean isAlive()
          Returns status of the plugin.
 void onStart()
          Do something when the plugin is started.
 void onStop()
          Do something when the plugin is stopped.
 java.lang.String toString()
          Returns a string representation of the plugin.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected LogUtil log

KEY_PLUGIN_NAME

public static final java.lang.String KEY_PLUGIN_NAME
Key to represent plugin name property.

See Also:
Constant Field Values

KEY_PLUGIN_CLASS_NAME

public static final java.lang.String KEY_PLUGIN_CLASS_NAME
Key to represent plugin class name property.

See Also:
Constant Field Values
Constructor Detail

Plugin

protected Plugin(java.util.Properties p)
Method Detail

onStart

public void onStart()
Do something when the plugin is started. Subclass may provide more implementation here.


onStop

public void onStop()
Do something when the plugin is stopped. Subclass may provide more implementation here.


isAlive

public boolean isAlive()
Returns status of the plugin.


getName

public java.lang.String getName()
Returns the plugin name


getVersion

public java.lang.String getVersion()
Returns the plugin version


getPluginClassName

public java.lang.String getPluginClassName()
Returns the plugin class name


getProperties

public java.util.Properties getProperties()
Returns the properties of the plugin.


getProperty

public java.lang.String getProperty(java.lang.String name)
Returns property value.

Parameters:
name - property name
Returns:
value of the property

getProperty

public java.lang.String getProperty(java.lang.String name,
                                    java.lang.String defaultValue)
Returns property value.

Parameters:
name - property name
defaultValue - default value related to the property name
Returns:
value of the property

toString

public java.lang.String toString()
Returns a string representation of the plugin.

Overrides:
toString in class java.lang.Object