org.iids.aos.hostmanager.negotiationmodule.resourcehandlers
Class CPUResourceHandler

java.lang.Object
  extended by org.iids.aos.hostmanager.negotiationmodule.resourcehandlers.AbstractResourceHandler
      extended by 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.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.iids.aos.hostmanager.negotiationmodule.resourcehandlers.AbstractResourceHandler
AbstractResourceHandler.ViolationAlarm
 
Field Summary
 
Fields inherited from class org.iids.aos.hostmanager.negotiationmodule.resourcehandlers.AbstractResourceHandler
STATUS_ACTIVE, STATUS_INITIALIZED, STATUS_RESERVED, STATUS_VIOLATED
 
Constructor Summary
CPUResourceHandler(java.lang.String handlerID, AgentScapeID providerID, LifeCycleModule lm)
          Creates a new cpu resource handler.
 
Method Summary
 java.lang.Object getMonitorValue(java.lang.Integer descriptor)
           
 int getStatus(int refID)
           
 void implement(int refID, AlarmQueue violationQueue)
           
 void release(int refID)
          Releasing the CPU resource means killing the agent using the resource.
 int reserve(AgreementOffer request)
           
 void run()
           
 
Methods inherited from class org.iids.aos.hostmanager.negotiationmodule.resourcehandlers.AbstractResourceHandler
getHandlerID, getProviderID, getServiceName, isRunning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 resource
lm - access to lifecyclemodule, required to enforce resource
Method Detail

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.