org.ocap.resource.SharedResourceUsage Maven / Gradle / Ivy
package org.ocap.resource;
import org.ocap.resource.ResourceUsage;
import org.davic.resources.ResourceProxy;
/**
* This interface represents a group of resources where one or more
* resources are shared between multiple resource usages.
* If there is a contention over a resource that is considered shared between
* multiple uses, the shared usage SHALL be represented by an instance of
* SharedResourceUsage
and the {@link #getResourceUsages getResourceUsages()}
* method would return the individual ResourceUsage
instances that share
* the resource.
*
* Because a SharedResourceUsage
can contain multiple
* ResourceUsage
instances where different applications reserved
* the resources, the value returned by the SharedResourceUsage.getAppID
* method is meaningless and SHALL be null. To determine AppID instances an
* application can peruse the ResourceUsage
instances returned by the
* getResourceUsages
method.
*
*/
public interface SharedResourceUsage extends ResourceUsage {
/**
* Gets the list of ResourceUsage
instances that share the resources
* represented by this resource usage
*
* @return An array of ResourceUsage
instances that share one
* or more resources.
*/
public ResourceUsage[] getResourceUsages();
/**
* Gets the list of ResourceUsage
instances that share a particular
* resource.
*
* @param resource The shared resource for which ResourceUsage
* instances should be returned.
* @return An array of ResourceUsage
instances that share the
* specified resource.
*/
public ResourceUsage[] getResourceUsages(ResourceProxy resource);
}