org.iids.aos.hostmanager.negotiationmodule.resourcehandlers
Class CPUResourceHandler
java.lang.Object
org.iids.aos.hostmanager.negotiationmodule.resourcehandlers.AbstractResourceHandler
org.iids.aos.hostmanager.negotiationmodule.resourcehandlers.CPUResourceHandler
- All Implemented Interfaces:
- java.lang.Runnable, BasicResourceHandler
public class CPUResourceHandler
- extends AbstractResourceHandler
This resource handler allows the host manager to manage the CPU-time resource
for agents running in the java agentserver.
This class needs access to the object implementing the cpu resource (Agent server), in
order to monitor the consumption of the resources.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CPUResourceHandler
public CPUResourceHandler(java.lang.String handlerID,
AgentScapeID providerID,
LifeCycleModule lm)
- Creates a new cpu resource handler.
- Parameters:
handlerID - The id of this handler.providerID - The id of the agentscape service providing the resourcelm - access to lifecyclemodule, required to enforce resource
getMonitorValue
public java.lang.Object getMonitorValue(java.lang.Integer descriptor)
throws MonitorException
- Specified by:
getMonitorValue in interface BasicResourceHandler- Specified by:
getMonitorValue in class AbstractResourceHandler
- Throws:
MonitorException
getStatus
public int getStatus(int refID)
throws HandlerException
- Specified by:
getStatus in interface BasicResourceHandler- Specified by:
getStatus in class AbstractResourceHandler
- Throws:
HandlerException
reserve
public int reserve(AgreementOffer request)
throws ReservationException
- Specified by:
reserve in interface BasicResourceHandler- Specified by:
reserve in class AbstractResourceHandler
- Throws:
ReservationException
implement
public void implement(int refID,
AlarmQueue violationQueue)
throws HandlerException
- Specified by:
implement in interface BasicResourceHandler- Specified by:
implement in class AbstractResourceHandler
- Throws:
HandlerException
release
public void release(int refID)
throws HandlerException
- Releasing the CPU resource means killing the agent using the resource.
- Specified by:
release in interface BasicResourceHandler- Specified by:
release in class AbstractResourceHandler
- Parameters:
refID -
- Throws:
HandlerException
run
public void run()
Copyright © 2003, 2004 IIDS Group. All Rights Reserved.