public interface ResourceMonitoringService
createContext(String, ResourceContext)
method.Modifier and Type | Field and Description |
---|---|
static String |
FRAMEWORK_CONTEXT_NAME
The name of the special, optional resource context, representing the
whole OSGi framework.
|
static String |
RES_TYPE_CPU
The name of the CPU resource type, used to monitor and control the CPU
time used by a resource context.
|
static String |
RES_TYPE_DISK_STORAGE
The name of the disk storage resource type, used to monitor and control
the size of the persistent storage used by a resource context.
|
static String |
RES_TYPE_MEMORY
The name of the memory resource type, used to monitor and control the
size of the java heap used by a resource context.
|
static String |
RES_TYPE_SOCKET
The name of the socket resource type, used to monitor and control the
number of existing sockets used by a resource context.
|
static String |
RES_TYPE_THREADS
The name of the threads resource type, used to monitor and control the
number of threads created by a resource context.
|
static String |
SYSTEM_CONTEXT_NAME
The name of the Resource Context associated with System bundle (bundle
0).
|
Modifier and Type | Method and Description |
---|---|
ResourceContext |
createContext(String name,
ResourceContext template)
Creates a new
ResourceContext . |
ResourceContext |
getContext(long bundleId)
Returns the
ResourceContext associated to the provided bundle id. |
ResourceContext |
getContext(String name)
Returns the context with the specified resource context name.
|
String[] |
getSupportedTypes()
Returns a list with the supported resource type names.
|
ResourceContext[] |
listContext()
Lists all available
resource contexts . |
static final String RES_TYPE_THREADS
ResourceMonitoringService
implementations must create
ThreadMonitor
instances for this resource type.static final String RES_TYPE_CPU
ResourceMonitoringService
implementations must create CPUMonitor
instances for this
resource type.static final String RES_TYPE_DISK_STORAGE
ResourceMonitoringService
implementations must create
DiskStorageMonitor
instances for this resource type.static final String RES_TYPE_MEMORY
ResourceMonitoringService
implementations must create
MemoryMonitor
instances for this resource type.static final String RES_TYPE_SOCKET
ResourceMonitoringService
implementations must create
SocketMonitor
instances for this resource type.static final String FRAMEWORK_CONTEXT_NAME
static final String SYSTEM_CONTEXT_NAME
ResourceContext[] listContext()
resource contexts
. The list
will contain the special FRAMEWORK_CONTEXT_NAME
context and the
SYSTEM_CONTEXT_NAME
context, if it is supported.ResourceContext
objects, or an empty array,
if no contexts have been created.ResourceContext createContext(String name, ResourceContext template)
ResourceContext
.
A ResourceContextEvent
with type
ResourceContextEvent.RESOURCE_CONTEXT_CREATED
will be sent.
name
- The name identifying the context. Names must be unique within
the framework instance.template
- If a template is provided, the new resource context will
inherit all resource monitoring settings (enabled monitors,
thresholds) from the template.ResourceContext
instance.IllegalArgumentException
- if a problem occurred, for example if the name
is already used.ResourceContext getContext(String name)
name
- The resource context nameResourceContext
with the specified name, or
null if such a context doesn't existResourceContext getContext(long bundleId)
ResourceContext
associated to the provided bundle id.bundleId
- bundle identifierResourceContext
associated to bundle b or null if the
bundle b does not belong to a Resource Context.String[] getSupportedTypes()
ResourceMonitoringService
implementation supports.Copyright © OSGi Alliance (2000, 2015). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0