|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.memphis.ccrg.lida.framework.FrameworkModuleImpl
public abstract class FrameworkModuleImpl
Abstract implementation of FrameworkModule
Implementations should add themselves to the agent.xml configuration file
Field Summary | |
---|---|
protected TaskSpawner |
taskSpawner
TaskSpawner used by this module |
Constructor Summary | |
---|---|
FrameworkModuleImpl()
Default constructor |
Method Summary | |
---|---|
void |
addListener(ModuleListener listener)
Override this method to add a listener to the module |
void |
addSubModule(FrameworkModule lm)
Adds submodule as a component of this FrameworkModule. |
boolean |
containsSubmodule(ModuleName name)
Returns whether this FrameworkModule contains a submodule with
specified ModuleName . |
boolean |
containsSubmodule(java.lang.String name)
Returns whether this FrameworkModule contains a submodule with
specified name. |
TaskSpawner |
getAssistingTaskSpawner()
Returns the TaskSpawner which this FrameworkModule uses to spawn tasks. |
java.lang.Object |
getModuleContent(java.lang.Object... params)
Intended to be called from the GUI. |
ModuleName |
getModuleName()
Gets moduleName. |
java.lang.Object |
getParam(java.lang.String name,
java.lang.Object defaultValue)
A convenience method to read parameters from the Map of properties set with the init() method. |
FrameworkModule |
getSubmodule(ModuleName name)
Gets specified submodule subModule. |
FrameworkModule |
getSubmodule(java.lang.String name)
Gets specified submodule. |
java.util.Map<ModuleName,FrameworkModule> |
getSubmodules()
Convenience method to get submodules |
void |
init()
Implementations should only perform initialization of variables or objects that depend on parameters in the parameter map specified in init(Map) . |
void |
init(java.util.Map<java.lang.String,?> params)
This method initializes the module with parameters specified in agent.xml |
void |
setAssistingTaskSpawner(TaskSpawner ts)
Specify the TaskSpawner which this FrameworkModule will use to spawn tasks. |
void |
setAssociatedModule(FrameworkModule module,
java.lang.String moduleUsage)
Sets an associated FrameworkModule. |
void |
setModuleName(ModuleName moduleName)
Sets ModuleName. |
void |
taskManagerDecayModule(long ticks)
Framework users should not call this method. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface edu.memphis.ccrg.lida.framework.FrameworkModule |
---|
decayModule |
Field Detail |
---|
protected TaskSpawner taskSpawner
TaskSpawner
used by this module
Constructor Detail |
---|
public FrameworkModuleImpl()
Method Detail |
---|
public void setAssistingTaskSpawner(TaskSpawner ts)
FrameworkModule
setAssistingTaskSpawner
in interface FrameworkModule
ts
- - the TaskSpawnerpublic TaskSpawner getAssistingTaskSpawner()
FrameworkModule
getAssistingTaskSpawner
in interface FrameworkModule
public void init(java.util.Map<java.lang.String,?> params)
Initializable
init
in interface Initializable
params
- Map of parameters indexed by String namespublic void init()
init(Map)
.
Furthermore they should not try to access modules added via setAssociatedModule(FrameworkModule, String)
as this method will not have run yet at the time this method is called.
init
in interface Initializable
public java.lang.Object getParam(java.lang.String name, java.lang.Object defaultValue)
Initializable
getParam
in interface Initializable
name
- the parameter namedefaultValue
- the default value to be returned if the parameter doesn't exist.
public boolean containsSubmodule(ModuleName name)
FrameworkModule
FrameworkModule
contains a submodule with
specified ModuleName
.
containsSubmodule
in interface FrameworkModule
name
- ModuleName
of submodule
FrameworkModule
with specified ModuleName
in this FrameworkModule
public boolean containsSubmodule(java.lang.String name)
FrameworkModule
FrameworkModule
contains a submodule with
specified name.
containsSubmodule
in interface FrameworkModule
name
- ModuleName
of submodule
FrameworkModule
with specified name
in this FrameworkModule
public FrameworkModule getSubmodule(ModuleName name)
FrameworkModule
getSubmodule
in interface FrameworkModule
name
- name of the desired submodule.
public FrameworkModule getSubmodule(java.lang.String name)
FrameworkModule
getSubmodule
in interface FrameworkModule
name
- name of the desired submodule.
public void addSubModule(FrameworkModule lm)
FrameworkModule
addSubModule
in interface FrameworkModule
lm
- submodule to addpublic java.util.Map<ModuleName,FrameworkModule> getSubmodules()
FrameworkModule
getSubmodules
in interface FrameworkModule
ModuleName
public void taskManagerDecayModule(long ticks)
taskManagerDecayModule
in interface FrameworkModule
ticks
- number of ticks to decay.public void setModuleName(ModuleName moduleName)
FrameworkModule
setModuleName
in interface FrameworkModule
moduleName
- ModuleName
of this FrameworkModulepublic ModuleName getModuleName()
FrameworkModule
getModuleName
in interface FrameworkModule
ModuleName
of this FrameworkModulepublic java.lang.String toString()
toString
in class java.lang.Object
public void setAssociatedModule(FrameworkModule module, java.lang.String moduleUsage)
FullyInitializable
setAssociatedModule
in interface FullyInitializable
module
- the module to be associated.moduleUsage
- how module will be used @see ModuleUsagepublic void addListener(ModuleListener listener)
addListener
in interface FrameworkModule
listener
- - listener of this FrameworkModulepublic java.lang.Object getModuleContent(java.lang.Object... params)
getModuleContent
in interface FrameworkModule
params
- - specifies what content will be returned.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |