|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.lang.Thread
com.pentec.aserver.AServerPlugin
public abstract class AServerPlugin
Base clase for AServer plugin modules
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
private java.lang.String |
$InstanceIdentifier
Instance identification for the plugin - This can be null if the plugin doesn't adhear to the new instance identifier specification. |
private java.lang.String |
$Name
Name of the plugin |
private java.lang.String |
$Version
Version of the plugin |
private static java.util.Hashtable |
htPlugins
|
protected boolean |
isOkToRun
Flag determining if it's ok to continue running. |
private int |
iState
Current state of the plugin |
static java.lang.String |
SIG_INIT_FAILED
|
static java.lang.String |
SIG_INITIALIZING
|
static java.lang.String |
SIG_QUITTING
|
static java.lang.String |
SIG_RUNNING
|
static int |
STATE_INIT_FAILED
|
static int |
STATE_INITIALIZING
|
static int |
STATE_QUITTING
|
static int |
STATE_RUNNING
|
static int |
STATE_STARTING
|
static int |
STATE_WAITING_TO_START
|
protected static java.util.Vector |
vPlugins
List of all plugins |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
AServerPlugin(java.lang.String $Name,
java.lang.String $Version)
This is a legacy constructor which may be removed in the future in favor of the constructor adding $InstanceIdentifier so multiple instances of the same plugin can be differentiated in the log file. |
|
AServerPlugin(java.lang.String $Name,
java.lang.String $Version,
java.lang.String $InstanceIdentifier)
|
|
| Method Summary | |
|---|---|
static java.lang.String[] |
getFullyQualifiedPluginName(int iIndex)
Get the fully qualified name of a plugin by its index in the list |
static int |
getNumPlugins()
Get the number of plugins instantiated |
java.lang.String |
getPluginInstanceIdentifier()
Get the plugin's instance identifier |
java.lang.String |
getPluginName()
Get the plugin's name |
int |
getPluginState()
Get the state of the plugin |
static int |
getPluginStateByName(java.lang.String $FullyQualifiedPluginName)
Get the state of a plugin by its fully qualified name |
java.lang.String |
getPluginVersion()
Get the plugin's version |
abstract void |
run()
The plugin does its work here |
protected void |
setPluginInstanceIdentifier(java.lang.String $InstanceIdentifier)
Set the plugin's instance identifier. |
private void |
setState(int iState)
Set the plugin's state |
protected void |
signalInitFailed(java.lang.String $Reason)
Signal that initialization for this plugin failed |
protected void |
signalInitializing()
Signal that initialization for this plugin in progress |
protected void |
signalQuitting()
Signal that this plugin is exitting |
protected void |
signalRunning()
Signal that this plugin is up and running (init succeeded) |
private void |
signalStarting()
Signal that a new plugin is starting its run. |
void |
startPlugin()
Start the plugin |
void |
stopPlugin()
Stop the plugin |
java.lang.String |
toString()
Return the plugin's name, version, and instance identifier if available. |
static void |
writeLog(AServerPlugin callingPlugin,
java.lang.String $Message)
Allow non-AServerPlugins to write to the log file if they have a reference to an AServerPlugin. |
protected void |
writeLog(java.lang.String $Message)
Allow the plugin to write a message to the log file. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private java.lang.String $InstanceIdentifier
private final java.lang.String $Name
private final java.lang.String $Version
private static final java.util.Hashtable htPlugins
protected boolean isOkToRun
private int iState
public static final java.lang.String SIG_INIT_FAILED
public static final java.lang.String SIG_INITIALIZING
public static final java.lang.String SIG_QUITTING
public static final java.lang.String SIG_RUNNING
public static final int STATE_INIT_FAILED
public static final int STATE_INITIALIZING
public static final int STATE_QUITTING
public static final int STATE_RUNNING
public static final int STATE_STARTING
public static final int STATE_WAITING_TO_START
protected static final java.util.Vector vPlugins
| Constructor Detail |
|---|
public AServerPlugin(java.lang.String $Name,
java.lang.String $Version)
$Name - name of the plugin$Version - version of the plugin
public AServerPlugin(java.lang.String $Name,
java.lang.String $Version,
java.lang.String $InstanceIdentifier)
$Name - name of the plugin$Version - version of the plugin$InstanceIdentifier - instance identification of the plugin (may be null)| Method Detail |
|---|
public static java.lang.String[] getFullyQualifiedPluginName(int iIndex)
iIndex - list index
public static int getNumPlugins()
public final java.lang.String getPluginInstanceIdentifier()
public final java.lang.String getPluginName()
public int getPluginState()
public static int getPluginStateByName(java.lang.String $FullyQualifiedPluginName)
$FullyQualifiedPluginName - fully qualified plugin name
public final java.lang.String getPluginVersion()
public abstract void run()
run in interface java.lang.Runnablerun in class java.lang.Threadprotected final void setPluginInstanceIdentifier(java.lang.String $InstanceIdentifier)
private void setState(int iState)
iState - state of the pluginprotected final void signalInitFailed(java.lang.String $Reason)
$Reason - reason for failureprotected final void signalInitializing()
protected final void signalQuitting()
protected final void signalRunning()
private final void signalStarting()
public final void startPlugin()
public final void stopPlugin()
public final java.lang.String toString()
toString in class java.lang.Thread
public static final void writeLog(AServerPlugin callingPlugin,
java.lang.String $Message)
callingPlugin - plugin writing to the log file on the caller's behalf$Message - message to write to the log fileprotected final void writeLog(java.lang.String $Message)
$Message - message to write to the log file
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||