Top Description Methods
org.osgi.service.resourcemonitoring.monitor

public Interface ThreadMonitor

extends ResourceMonitor<Integer>
Imports
org.osgi.service.resourcemonitoring.ResourceContext, .ResourceMonitor, .ResourceMonitoringService

A ResourceMonitor for the ResourceMonitoringService#RES_TYPE_THREADS resource type. A ThreadMonitor instance monitors and limits the thread created by a ResourceContext instance.
Author
$Id: b5d1a7049fd928b82a428aa1d23de201b243a506 $
Version
1.0

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the number of alive threads created by this resource context
getAliveThreads
()

Returns the number of alive threads created by the bundles in this resource context.

Inherited from org.osgi.service.resourcemonitoring.ResourceMonitor:
deletedisableenableequalsgetContextgetMonitoredPeriodgetResourceTypegetSamplingPeriodgetUsagehashCodeisDeletedisEnabled

Method Detail

getAliveThreadsback to summary
public int getAliveThreads()

Returns the number of alive threads created by the bundles in this resource context. A Thread is considered to be alive when its java state is one of the following:

  • RUNNABLE
  • BLOCKED
  • WAITING
  • TIMED_WAITING

The getUsage() method returns the same value, wrapped in a int.

Returns:int

the number of alive threads created by this resource context