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.ServiceHelper
public boolean startAgent(java.lang.String nickName, java.lang.String agentClassName, java.lang.Object[] args, java.lang.String containerName) throws jade.core.ServiceException
LoadServiceHelper
startAgent
in interface LoadServiceHelper
nickName
- 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
LoadServiceHelper
getAutoRemoteContainerConfig
in interface LoadServiceHelper
jade.core.ServiceException
- the service exceptionpublic void setDefaults4RemoteContainerConfig(RemoteContainerConfig remoteContainerConfig) throws jade.core.ServiceException
LoadServiceHelper
setDefaults4RemoteContainerConfig
in interface LoadServiceHelper
remoteContainerConfig
- the new default remote container configurationjade.core.ServiceException
- the service exceptionpublic java.lang.String startNewRemoteContainer() throws jade.core.ServiceException
LoadServiceHelper
startNewRemoteContainer
in interface LoadServiceHelper
jade.core.ServiceException
- the service exceptionpublic java.lang.String startNewRemoteContainer(RemoteContainerConfig remoteConfig) throws jade.core.ServiceException
LoadServiceHelper
startNewRemoteContainer
in interface LoadServiceHelper
remoteConfig
- the remote container configurationjade.core.ServiceException
- the service exceptionpublic LoadInformation.Container2Wait4 startNewRemoteContainerStaus(java.lang.String containerName) throws jade.core.ServiceException
LoadServiceHelper
startNewRemoteContainerStaus
in interface LoadServiceHelper
containerName
- the new containers namejade.core.ServiceException
- the service exceptionLoadInformation.Container2Wait4
public ClientRemoteContainerReply getLocalCRCReply() throws jade.core.ServiceException
LoadServiceHelper
getLocalCRCReply
in interface LoadServiceHelper
jade.core.ServiceException
- the service exceptionpublic void setAndSaveCRCReplyLocal(ClientRemoteContainerReply crcReply) throws jade.core.ServiceException
LoadServiceHelper
setAndSaveCRCReplyLocal
in interface LoadServiceHelper
crcReply
- the ClientRemoteContainerReply to savejade.core.ServiceException
- the service exceptionpublic void putContainerDescription(ClientRemoteContainerReply crcReply) throws jade.core.ServiceException
LoadServiceHelper
putContainerDescription
in interface LoadServiceHelper
crcReply
- the crc replyjade.core.ServiceException
- the service exceptionpublic java.util.Hashtable<java.lang.String,LoadInformation.NodeDescription> getContainerDescriptions() throws jade.core.ServiceException
LoadServiceHelper
getContainerDescriptions
in interface LoadServiceHelper
jade.core.ServiceException
- the service exceptionLoadInformation.NodeDescription
public LoadInformation.NodeDescription getContainerDescription(java.lang.String containerName) throws jade.core.ServiceException
LoadServiceHelper
getContainerDescription
in interface LoadServiceHelper
containerName
- the container namejade.core.ServiceException
- the service exceptionLoadInformation.NodeDescription
public java.util.Hashtable<java.lang.String,jade.core.Location> getContainerLocations() throws jade.core.ServiceException
LoadServiceHelper
getContainerLocations
in interface LoadServiceHelper
jade.core.ServiceException
- the service exceptionpublic jade.core.Location getContainerLocation(java.lang.String containerName) throws jade.core.ServiceException
LoadServiceHelper
getContainerLocation
in interface LoadServiceHelper
containerName
- the container namejade.core.ServiceException
- the service exceptionpublic void setThresholdLevels(LoadThresholdLevels thresholdLevels) throws jade.core.ServiceException
LoadServiceHelper
setThresholdLevels
in interface LoadServiceHelper
thresholdLevels
- the new threshold levelsjade.core.ServiceException
- the service exceptionpublic java.util.Hashtable<java.lang.String,PlatformLoad> getContainerLoadHash() throws jade.core.ServiceException
LoadServiceHelper
getContainerLoadHash
in interface LoadServiceHelper
jade.core.ServiceException
- the service exceptionpublic PlatformLoad getContainerLoad(java.lang.String containerName) throws jade.core.ServiceException
LoadServiceHelper
getContainerLoad
in interface LoadServiceHelper
containerName
- the container namejade.core.ServiceException
- the service exceptionpublic java.util.Vector<java.lang.String> getContainerNames() throws jade.core.ServiceException
LoadServiceHelper
getContainerNames
in interface LoadServiceHelper
jade.core.ServiceException
- the service exceptionpublic void setSimulationCycleStartTimeStamp() throws jade.core.ServiceException
LoadServiceHelper
setSimulationCycleStartTimeStamp
in interface LoadServiceHelper
jade.core.ServiceException
- the service exceptionLoadServiceHelper.getAvgCycleTime()
public double getAvgCycleTime() throws jade.core.ServiceException
LoadServiceHelper
getAvgCycleTime
in interface LoadServiceHelper
jade.core.ServiceException
- the service exceptionLoadServiceHelper.setSimulationCycleStartTimeStamp()
public LoadAgentMap getLoadAgentMap() throws jade.core.ServiceException
LoadServiceHelper
getLoadAgentMap
in interface LoadServiceHelper
jade.core.ServiceException
- the service exceptionLoadAgentMap
public void setAgentMigration(java.util.Vector<LoadAgentMap.AID_Container> transferAgents) throws jade.core.ServiceException
LoadServiceHelper
setAgentMigration
in interface LoadServiceHelper
transferAgents
- the agents, which has to be migratedjade.core.ServiceException
- the service exceptionpublic void requestThreadMeasurements(LoadMeasureAgent loadMeasurementAgent) throws jade.core.ServiceException
LoadServiceHelper
requestThreadMeasurements
in interface LoadServiceHelper
loadMeasurementAgent
- the load measure agentjade.core.ServiceException
- the service exceptionpublic void requestAvailableMachines() throws jade.core.ServiceException
LoadServiceHelper
requestAvailableMachines
in interface LoadServiceHelper
jade.core.ServiceException
- the service exceptionpublic void putAvailableMachines(ClientAvailableMachinesReply availableMachines) throws jade.core.ServiceException
LoadServiceHelper
putAvailableMachines
in interface LoadServiceHelper
availableMachines
- the available machinesjade.core.ServiceException
- the service exceptionpublic ClientAvailableMachinesReply getAvailableMachines() throws jade.core.ServiceException
LoadServiceHelper
getAvailableMachines
in interface LoadServiceHelper
jade.core.ServiceException
- the service exception