|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ocap.resource.ResourceContentionManager
public class ResourceContentionManager
This class manages a means of resolving a resource contention.
An application which has a MonitorAppPermission ("handler.resource") may have a subclass of the AppsDatabaseFilter class or a class implementing the ResourceContentionHandler interface, and may set an instance of them in the ResourceContentionManager. The concrete class of the AppsDatabaseFilter class identifies an application that is not allowed absolutely to reserve the resource. The class implementing the ResourceContentionHandler interface resolves a resource contention after a resource negotiation.
See the section 19 Resource Management in this specification for details.
Constructor Summary | |
---|---|
protected |
ResourceContentionManager()
A constructor of this class. |
Method Summary | |
---|---|
static ResourceContentionManager |
getInstance()
This method returns an instance of the ResourceContentionManager class. |
int |
getWarningPeriod()
Gets the warning period set by the setWarningPeriod method. |
void |
setResourceContentionHandler(ResourceContentionHandler handler)
This method sets the specified ResourceContentionHandler that decides which application shall be denied reserving a scarce resource. |
void |
setResourceFilter(AppsDatabaseFilter filter,
java.lang.String resourceProxy)
This method sets an instance of a concrete class that extends AppsDatabaseFilter. |
void |
setWarningPeriod(int warningPeriod)
Sets the warning period used by the implementation to determine when to call the resourceContentionWarning method in a registered ResourceContentionHandler . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ResourceContentionManager()
getInstance()
method to create an instance.
Method Detail |
---|
public static ResourceContentionManager getInstance()
public void setResourceFilter(AppsDatabaseFilter filter, java.lang.String resourceProxy)
filter
- the AppsDatabaseFilter to deny the application reserving
the specified resource. If null is set, the AppsDatabaseFilter
for the specified resource will be removed.resourceProxy
- A full path class name of a concrete class
of the org.davic.resources.ResourceProxy interface. It
specifies a resource type that the specified AppsDatabaseFilter
filters.
For example, "org.davic.net.tuning.NetworkInterfaceController".
java.lang.SecurityException
- if the caller does not have
MonitorAppPermission("handler.resource").public void setResourceContentionHandler(ResourceContentionHandler handler)
ResourceContentionHandler.resolveResourceContention(org.ocap.resource.ResourceUsage, org.ocap.resource.ResourceUsage[])
method is
not called.
handler
- the ResourceContentionHandler to be set.
If null is set, the ResourceContentionHandler instance will be removed
and the ResourceContentionHandler.resolveResourceContention(org.ocap.resource.ResourceUsage, org.ocap.resource.ResourceUsage[])
method will not be called.
java.lang.SecurityException
- if the caller does not have
MonitorAppPermission("handler.resource").public int getWarningPeriod()
public void setWarningPeriod(int warningPeriod)
ResourceContentionHandler
. If the parameter is zero
the implementation SHALL NOT call the resourceContentionWarning method.
If the parameter is non-zero the implementation SHALL call the
resourceContentionWarning method if it has enough information to do so.
Setting the warningPeriod to non-zero MAY NOT cause the
resourceContentionWarning method to be called for two reasons, 1) the
implementation cannot determine when contention is going to happen,
and 2) the warning period is longer than the duration to the contention.
warningPeriod
- New warning period in milli-seconds. If the value
is smaller than the minimum clock resolution supported by the
implementation, the implementation MAY round it up to the minimum.
java.lang.IllegalArgumentException
- if the parameter is negative.
java.lang.SecurityException
- if the caller does not have
MonitorAppPermission("handler.resource").
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |