org.appdapter.module.basic
Class BasicModule<PM extends Modulator>

java.lang.Object
  extended by org.appdapter.core.log.BasicDebugger
      extended by org.appdapter.module.basic.BasicModule<PM>
All Implemented Interfaces:
Module<PM>
Direct Known Subclasses:
NullModule, TimedModule

public abstract class BasicModule<PM extends Modulator>
extends BasicDebugger
implements Module<PM>

Author:
Stu B.

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.appdapter.api.module.Module
Module.State
 
Field Summary
 
Fields inherited from class org.appdapter.core.log.BasicDebugger
IMPO_HI, IMPO_HIHI, IMPO_LO, IMPO_LOLO, IMPO_MAX, IMPO_MIN, IMPO_NORM
 
Constructor Summary
BasicModule()
           
 
Method Summary
protected  void enterBasicInitModule(boolean verifyPreInitState)
           
protected  void enterBasicReleaseModule()
           
protected  void enterBasicRunOnce()
           
protected  void enterBasicStart()
           
protected  void enterBasicStop()
           
protected  void exitBasicInitModule(boolean verifyInInitState)
           
protected  void exitBasicReleaseModule()
           
protected  void exitBasicRunOnce()
           
protected  void exitBasicStart()
           
protected  void exitBasicStop()
           
 void failDuringInitOrStartup()
           
 String getDescription()
           
 PM getParentModulator()
          The Module must have a valid parentModulator whenever it is inside a module action callback.
 Module.State getState()
           
 boolean isStopRequested()
           
 void markStopRequested()
           
protected  void notifyStateViolation(String detectingMethod, String expectedStateDesc, boolean throExcept)
           
 void setParentModulator(PM m)
           
 String toString()
           
protected  void verifyStoredState(String checkingMethod, boolean throExcept, Module.State... allowedStates)
          Ensure we are in an allowed state, will notifyStateViolation if not.
 
Methods inherited from class org.appdapter.core.log.BasicDebugger
checkDebugImportance, getLogger, isLoggerUsable, logError, logInfo, logInfo, logInfoEvent, setDebugImportanceThreshold, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.appdapter.api.module.Module
initModule, releaseModule, runOnce, start, stop
 

Constructor Detail

BasicModule

public BasicModule()
Method Detail

getState

public Module.State getState()
Specified by:
getState in interface Module<PM extends Modulator>
Returns:
Current state, subject to synchronization behavior of this module.

markStopRequested

public void markStopRequested()
Specified by:
markStopRequested in interface Module<PM extends Modulator>

isStopRequested

public boolean isStopRequested()
Specified by:
isStopRequested in interface Module<PM extends Modulator>

getParentModulator

public PM getParentModulator()
Description copied from interface: Module
The Module must have a valid parentModulator whenever it is inside a module action callback.

Specified by:
getParentModulator in interface Module<PM extends Modulator>
Returns:
Current Modulator, subject to synchronization behavior of this module.

setParentModulator

public void setParentModulator(PM m)
Specified by:
setParentModulator in interface Module<PM extends Modulator>

notifyStateViolation

protected void notifyStateViolation(String detectingMethod,
                                    String expectedStateDesc,
                                    boolean throExcept)

verifyStoredState

protected void verifyStoredState(String checkingMethod,
                                 boolean throExcept,
                                 Module.State... allowedStates)
Ensure we are in an allowed state, will notifyStateViolation if not.


failDuringInitOrStartup

public void failDuringInitOrStartup()
Specified by:
failDuringInitOrStartup in interface Module<PM extends Modulator>

enterBasicInitModule

protected void enterBasicInitModule(boolean verifyPreInitState)

exitBasicInitModule

protected void exitBasicInitModule(boolean verifyInInitState)

enterBasicStart

protected void enterBasicStart()

exitBasicStart

protected void exitBasicStart()

enterBasicRunOnce

protected void enterBasicRunOnce()

exitBasicRunOnce

protected void exitBasicRunOnce()

enterBasicStop

protected void enterBasicStop()

exitBasicStop

protected void exitBasicStop()

enterBasicReleaseModule

protected void enterBasicReleaseModule()

exitBasicReleaseModule

protected void exitBasicReleaseModule()

getDescription

public String getDescription()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010-2012. All Rights Reserved.