Resource Monitoring Clients can use the
ResourceMonitoringService#createContext(String, ResourceContext)
method to create ResourceContext instances.
Resource Monitoring Clients can use the getMonitor(String) method to
get ResourceMonitor instances for the supported resource types. These
instances can then be used to monitor the usage of the resources, or the set
usage limits.
ResourceContexts are retrieved through the ResourceMonitoringService
OSGi service.
| Modifier and Type | Method and Description |
|---|---|
| public void | addBundle(long
The bundle to add to this resource context bundleId)Adds a bundle to the resource context. |
| public void | addResourceMonitor(ResourceMonitor<?>
resourceMonitor instance to be added resourceMonitor)Adds a new ResourceMonitor instance monitoring resource for this resource context. |
| public boolean | |
| public long[] | Returns: An array ofBundle objects, or an empty array if no
bundles are currently members of this contextReturns the bundle identifiers belonging to this Resource Context. |
| public ResourceMonitor | Returns: A ResourceMonitor instance, or null, if this resource type is not supportedThe resource type, for which a resource monitor is
requested resourceType)Returns a ResourceMonitor instance for the specified resource type. |
| public ResourceMonitor | Returns: an array of ResourceMonitor. May be empty if no ResourceMonitorRetrieves all the existing ResourceMonitor belonging to this context. |
| public String | |
| public int | |
| public void | removeBundle(long
bundle identifier bundleId)Removes the bundle identified by bundleId from the Resource Context. |
| public void | removeBundle(long
the identifier of the bundle to be removed from the
Resource Context bundleId, ResourceContext A resource context in which to add the bundle, after
removing it from this context. If no destination is provided (that
is null), the bundle is not associated to a new Resource Context. destination)Removes the bundle from this resource context. |
| public void | removeContext(ResourceContext
The destination)ResourceContext where the resources
currently allocated by this resource context will be moved.Removes a resource context. |
| public void | removeResourceMonitor(ResourceMonitor<?>
resource monitor instance to be removed resourceMonitor)Removes a ResourceMonitor instance from the context. |
| addBundle | back to summary |
|---|---|
| public void addBundle(long bundleId) throws ResourceContextException Adds a bundle to the resource context. The bundle will be a member of the
context until it is uninstalled, or explicitly removed from the context
with Resources previously allocated by this bundle (in another resource context) will not be moved to this resource context. The change applies only for future allocations.
A
| |
| addResourceMonitor | back to summary |
|---|---|
| public void addResourceMonitor(ResourceMonitor<?> resourceMonitor) throws ResourceContextException Adds a new ResourceMonitor instance monitoring resource for this resource context. This method should be called only by ResourceMonitorFactory instance.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object resourceContext) A ResourceContext rc1 is equals to ResourceContext rc2 if rc1.getName() is equals to rc2.getName(). | |
| getBundleIds | back to summary |
|---|---|
| public long[] getBundleIds() Returns the bundle identifiers belonging to this Resource Context.
| |
| getMonitor | back to summary |
|---|---|
| public ResourceMonitor Returns a ResourceMonitor instance for the specified resource type. If
the
| |
| getMonitors | back to summary |
|---|---|
| public ResourceMonitor Retrieves all the existing ResourceMonitor belonging to this context.
| |
| getName | back to summary |
|---|---|
| public String getName() Returns the name of the resource context. Resource context names are unique within a framework instance.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Retrieves the hashCode value of a ResourceContext. The hashCode value of a ResourceContext is only based on the hashcode value of the name of the context.
| |
| removeBundle | back to summary |
|---|---|
| public void removeBundle(long bundleId) throws ResourceContextException Removes the bundle identified by bundleId from the Resource Context. The bundle is no longer to this Resource Context.
| |
| removeBundle | back to summary |
|---|---|
| public void removeBundle(long bundleId, ResourceContext destination) throws ResourceContextException Removes the bundle from this resource context. If a
Resources previously allocated by this bundle will not be removed from the resource context. The change applies only for future allocations.
A
| |
| removeContext | back to summary |
|---|---|
| public void removeContext(ResourceContext destination) throws ResourceContextException Removes a resource context. All resources allocated in this resource
context will be moved to the
A
| |
| removeResourceMonitor | back to summary |
|---|---|
| public void removeResourceMonitor(ResourceMonitor<?> resourceMonitor) throws ResourceContextException Removes a ResourceMonitor instance from the context.
| |