public class AutonomicManagerDefault extends AutonomicManager
Auto
service's data history. This default
implementation does not implement any of the monitoring modules. It does however implement
a message queueing system that can be used to control the messages that are submitted to
the service (controlled element). The monitoring modules should extend the base AM_Module
class and can be either to monitor, analyze, plan or execute.
Descriptions of the monitoring process can be found in related papers. These modules
should be added using the pre-defined default keyword names of either
Const
.MONITOR
, ANALYZE
, PLAN
, or EXECUTE
to identify each one. The MAPE loop is synchronised, but any resulting action or
effector list is not.analyzer, autoEngine, CONVERSATIONEXISTS, executor, isConfigured, messageQueue, monitor, NEWCONVERSATION, planner, quarantineQueue
metrics, setStructures
shutDown
passwordHandler, service, serviceType
jarFile, uuid
Constructor and Description |
---|
AutonomicManagerDefault(Auto theService)
Creates a new instance of AutonomicManagerDefault.
|
AutonomicManagerDefault(Auto theService,
org.licas_xml.abs.Element adminXml)
Creates a new instance of AutonomicManagerDefault.
|
Modifier and Type | Method and Description |
---|---|
void |
addManagerModule(java.lang.String moduleType,
java.lang.String moduleClass,
java.util.ArrayList<java.lang.Object> params,
java.util.ArrayList<java.lang.String> theJarUris)
Add a new module to the manager - monitor, analyze, plan or execute.
|
void |
addPolicy(java.lang.String policyType,
org.licas_xml.abs.Element document)
Add a new policy to the auto manager.
|
void |
monitor(MessageInfo theMessage,
java.lang.String theAdminKey)
Monitor a conversation message and add if a new conversation.
|
protected void |
monitorMessage(MessageInfo theMessage,
java.lang.String theAdminKey)
Monitor a message using a MAPE control loop.
|
void |
run()
This is the default method to start the service thread.
|
addMessage, checkCommID, getClientURI, getMessageQueue, getNextMessage, getQuarantineMessageQueue, interrupt, isAuto, isService, removeCommID, returnLastMessage, setConfigured, storesLegacy
addCommunicationID, addMetrics, canAccess, canAccess, canAccess, canAccessTemp, copyFromService, copyToService, execute, getDescription, getFullPath, getMetrics, getObjClass, getObjService, getPassword, getPassword, getPassword, getService, getService, getServiceGrade, getWorkInfo, interrupt, invokeObj, reflectionMethods, setObjService, setParent, setServerPassword, setServiceGrade, threadAliveState
getShutDown, setShutDown, setShutDown
getPasswordHandler, getPasswordHandler, getServerPassword, getServicePassword, getServiceType, isAdminKey, setServiceDetails, setServiceType
getJarFile, getUUID, loadObject, setJarFile, setUUID
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getServiceType, getUUID, isAdminKey, setJarFile, setServiceType, setUUID
public AutonomicManagerDefault(Auto theService) throws java.lang.Exception
theService
- the service to monitor.java.lang.Exception
- any error.public AutonomicManagerDefault(Auto theService, org.licas_xml.abs.Element adminXml) throws java.lang.Exception
theService
- the service to monitor.adminXml
- the admin document describing the auto manager.java.lang.Exception
- any error.public void run()
run
in interface java.lang.Runnable
run
in class ServiceWrapper
public void monitor(MessageInfo theMessage, java.lang.String theAdminKey) throws PasswordException, LicasException, java.lang.Exception
null
then the message is ignored and not checked.monitor
in class AutonomicManager
theMessage
- the message that the service has produced / received.theAdminKey
- the admin key for the parent service.PasswordException
- if the admin key is incorrect.LicasException
- if the communication ID is not part of a current conversation.java.lang.Exception
- any error.protected void monitorMessage(MessageInfo theMessage, java.lang.String theAdminKey) throws java.lang.Exception
null
, then an
exception is thrown. If it new, then the message is added to a quarantine list and an exception
is thrown. The MAPE loop is synchronised, but any resulting action or effector list is not.monitorMessage
in class AutonomicManager
theMessage
- the message that the service has produced / received.theAdminKey
- the admin key for the parent service.java.lang.Exception
- any error.PasswordException
- if the admin key is incorrect.LicasException
- if the communication ID is not part of a current conversation.public void addManagerModule(java.lang.String moduleType, java.lang.String moduleClass, java.util.ArrayList<java.lang.Object> params, java.util.ArrayList<java.lang.String> theJarUris) throws java.lang.Exception
addManagerModule
in class AutonomicManager
moduleType
- the type of module. This is pre-defined and should be either
Const
.MONITOR
, ANALYZE
, PLAN
, or EXECUTE
to identify each particular module.moduleClass
- the class name of the module to be loaded.params
- initialisation parameters.theJarUris
- uris from which the remote object can be loaded, only if needed.java.lang.Exception
- any error.public void addPolicy(java.lang.String policyType, org.licas_xml.abs.Element document) throws java.lang.Exception
addPolicy
in class AutonomicManager
policyType
- the type of policy.
To add to a monitoring module, use one of the pre-defined keywords -
Const
.MONITOR
, ANALYZE
, PLAN
, or EXECUTE
.document
- the policy document.java.lang.Exception
- any error.