public class LoadService.LoadServiceImpl extends java.lang.Object implements LoadServiceHelper
LoadServiceHelper.SERVICE_NAME| Constructor and Description |
|---|
LoadServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
RemoteContainerConfig |
getAutoRemoteContainerConfig()
Provides the default remote container configuration.
|
ClientAvailableMachinesReply |
getAvailableMachines()
Gets the available machines.
|
double |
getAvgCycleTime()
Provides the average cycle time for a simulation.
|
LoadInformation.NodeDescription |
getContainerDescription(java.lang.String containerName)
Gets the NodeDescription of a specified container.
|
java.util.Hashtable<java.lang.String,LoadInformation.NodeDescription> |
getContainerDescriptions()
Gets the NodeDescription of all involved nodes.
|
PlatformLoad |
getContainerLoad(java.lang.String containerName)
Returns the load of a specified container.
|
java.util.Hashtable<java.lang.String,PlatformLoad> |
getContainerLoadHash()
Returns the load of all connected container.
|
jade.core.Location |
getContainerLocation(java.lang.String containerName)
Gets the container location of a specified container.
|
java.util.Hashtable<java.lang.String,jade.core.Location> |
getContainerLocations()
Provides the container locations of all connected container.
|
java.util.Vector<java.lang.String> |
getContainerNames()
Returns the list of all available container.
|
LoadAgentMap |
getLoadAgentMap()
Returns the current LoadAgentMap.
|
ClientRemoteContainerReply |
getLocalCRCReply()
Returns the locally saved ClientRemoteContainerReply.
|
void |
init(jade.core.Agent ag) |
void |
putAvailableMachines(ClientAvailableMachinesReply availableMachines)
Puts the available machines to the load information.
|
void |
putContainerDescription(ClientRemoteContainerReply crcReply)
Broadcasts a container description to all involved node, if the ClientRemoteContainerReply is valid.
|
void |
requestAvailableMachines()
Requests at the main container for the available machines.
|
void |
requestThreadMeasurements(LoadMeasureAgent loadMeasurementAgent)
Requests all involved JVMs to do the thread measurements.
|
void |
setAgentMigration(java.util.Vector<LoadAgentMap.AID_Container> transferAgents)
Sets the agent migration.
|
void |
setAndSaveCRCReplyLocal(ClientRemoteContainerReply crcReply)
Sets and save the local ClientRemoteContainerReply.
|
void |
setDefaults4RemoteContainerConfig(RemoteContainerConfig remoteContainerConfig)
Sets the default remote container configuration.
|
void |
setSimulationCycleStartTimeStamp()
Sets System.currentTimeMillis() as an indicator for the start of an new simulations cycle.
|
void |
setThresholdLevels(LoadThresholdLevels thresholdLevels)
Sets the threshold levels for all involved container.
|
boolean |
startAgent(java.lang.String nickName,
java.lang.String agentClassName,
java.lang.Object[] args,
java.lang.String containerName)
Start an agent on a specified location.
|
java.lang.String |
startNewRemoteContainer()
Will start a new remote container.
|
java.lang.String |
startNewRemoteContainer(RemoteContainerConfig remoteConfig)
Will start a new remote container.
|
LoadInformation.Container2Wait4 |
startNewRemoteContainerStaus(java.lang.String containerName)
Returns the current status of the requested new container.
|
public void init(jade.core.Agent ag)
init in interface jade.core.ServiceHelperpublic boolean startAgent(java.lang.String nickName,
java.lang.String agentClassName,
java.lang.Object[] args,
java.lang.String containerName)
throws jade.core.ServiceException
LoadServiceHelperstartAgent in interface LoadServiceHelpernickName - the local name for the agentagentClassName - the class of the agentargs - the serializable Object array for the start argumentscontainerName - the name of the container, where the agent should startjade.core.ServiceException - the service exceptionpublic RemoteContainerConfig getAutoRemoteContainerConfig() throws jade.core.ServiceException
LoadServiceHelpergetAutoRemoteContainerConfig in interface LoadServiceHelperjade.core.ServiceException - the service exceptionpublic void setDefaults4RemoteContainerConfig(RemoteContainerConfig remoteContainerConfig) throws jade.core.ServiceException
LoadServiceHelpersetDefaults4RemoteContainerConfig in interface LoadServiceHelperremoteContainerConfig - the new default remote container configurationjade.core.ServiceException - the service exceptionpublic java.lang.String startNewRemoteContainer()
throws jade.core.ServiceException
LoadServiceHelperstartNewRemoteContainer in interface LoadServiceHelperjade.core.ServiceException - the service exceptionpublic java.lang.String startNewRemoteContainer(RemoteContainerConfig remoteConfig) throws jade.core.ServiceException
LoadServiceHelperstartNewRemoteContainer in interface LoadServiceHelperremoteConfig - the remote container configurationjade.core.ServiceException - the service exceptionpublic LoadInformation.Container2Wait4 startNewRemoteContainerStaus(java.lang.String containerName) throws jade.core.ServiceException
LoadServiceHelperstartNewRemoteContainerStaus in interface LoadServiceHelpercontainerName - the new containers namejade.core.ServiceException - the service exceptionLoadInformation.Container2Wait4public ClientRemoteContainerReply getLocalCRCReply() throws jade.core.ServiceException
LoadServiceHelpergetLocalCRCReply in interface LoadServiceHelperjade.core.ServiceException - the service exceptionpublic void setAndSaveCRCReplyLocal(ClientRemoteContainerReply crcReply) throws jade.core.ServiceException
LoadServiceHelpersetAndSaveCRCReplyLocal in interface LoadServiceHelpercrcReply - the ClientRemoteContainerReply to savejade.core.ServiceException - the service exceptionpublic void putContainerDescription(ClientRemoteContainerReply crcReply) throws jade.core.ServiceException
LoadServiceHelperputContainerDescription in interface LoadServiceHelpercrcReply - the crc replyjade.core.ServiceException - the service exceptionpublic java.util.Hashtable<java.lang.String,LoadInformation.NodeDescription> getContainerDescriptions() throws jade.core.ServiceException
LoadServiceHelpergetContainerDescriptions in interface LoadServiceHelperjade.core.ServiceException - the service exceptionLoadInformation.NodeDescriptionpublic LoadInformation.NodeDescription getContainerDescription(java.lang.String containerName) throws jade.core.ServiceException
LoadServiceHelpergetContainerDescription in interface LoadServiceHelpercontainerName - the container namejade.core.ServiceException - the service exceptionLoadInformation.NodeDescriptionpublic java.util.Hashtable<java.lang.String,jade.core.Location> getContainerLocations()
throws jade.core.ServiceException
LoadServiceHelpergetContainerLocations in interface LoadServiceHelperjade.core.ServiceException - the service exceptionpublic jade.core.Location getContainerLocation(java.lang.String containerName)
throws jade.core.ServiceException
LoadServiceHelpergetContainerLocation in interface LoadServiceHelpercontainerName - the container namejade.core.ServiceException - the service exceptionpublic void setThresholdLevels(LoadThresholdLevels thresholdLevels) throws jade.core.ServiceException
LoadServiceHelpersetThresholdLevels in interface LoadServiceHelperthresholdLevels - the new threshold levelsjade.core.ServiceException - the service exceptionpublic java.util.Hashtable<java.lang.String,PlatformLoad> getContainerLoadHash() throws jade.core.ServiceException
LoadServiceHelpergetContainerLoadHash in interface LoadServiceHelperjade.core.ServiceException - the service exceptionpublic PlatformLoad getContainerLoad(java.lang.String containerName) throws jade.core.ServiceException
LoadServiceHelpergetContainerLoad in interface LoadServiceHelpercontainerName - the container namejade.core.ServiceException - the service exceptionpublic java.util.Vector<java.lang.String> getContainerNames()
throws jade.core.ServiceException
LoadServiceHelpergetContainerNames in interface LoadServiceHelperjade.core.ServiceException - the service exceptionpublic void setSimulationCycleStartTimeStamp()
throws jade.core.ServiceException
LoadServiceHelpersetSimulationCycleStartTimeStamp in interface LoadServiceHelperjade.core.ServiceException - the service exceptionLoadServiceHelper.getAvgCycleTime()public double getAvgCycleTime()
throws jade.core.ServiceException
LoadServiceHelpergetAvgCycleTime in interface LoadServiceHelperjade.core.ServiceException - the service exceptionLoadServiceHelper.setSimulationCycleStartTimeStamp()public LoadAgentMap getLoadAgentMap() throws jade.core.ServiceException
LoadServiceHelpergetLoadAgentMap in interface LoadServiceHelperjade.core.ServiceException - the service exceptionLoadAgentMappublic void setAgentMigration(java.util.Vector<LoadAgentMap.AID_Container> transferAgents) throws jade.core.ServiceException
LoadServiceHelpersetAgentMigration in interface LoadServiceHelpertransferAgents - the agents, which has to be migratedjade.core.ServiceException - the service exceptionpublic void requestThreadMeasurements(LoadMeasureAgent loadMeasurementAgent) throws jade.core.ServiceException
LoadServiceHelperrequestThreadMeasurements in interface LoadServiceHelperloadMeasurementAgent - the load measure agentjade.core.ServiceException - the service exceptionpublic void requestAvailableMachines()
throws jade.core.ServiceException
LoadServiceHelperrequestAvailableMachines in interface LoadServiceHelperjade.core.ServiceException - the service exceptionpublic void putAvailableMachines(ClientAvailableMachinesReply availableMachines) throws jade.core.ServiceException
LoadServiceHelperputAvailableMachines in interface LoadServiceHelperavailableMachines - the available machinesjade.core.ServiceException - the service exceptionpublic ClientAvailableMachinesReply getAvailableMachines() throws jade.core.ServiceException
LoadServiceHelpergetAvailableMachines in interface LoadServiceHelperjade.core.ServiceException - the service exception