org.rhq.core.pc.availability
Class AvailabilityCollectorThreadPool

java.lang.Object
  extended by org.rhq.core.pc.availability.AvailabilityCollectorThreadPool
All Implemented Interfaces:
Executor

public class AvailabilityCollectorThreadPool
extends Object
implements Executor

A utility class that can be used by plugins whose components may not be able to collect availability statuses fast enough. This thread pool object can be used to submit AvailabilityCollectorRunnable instances, each of which will be used to collect availability statuses for a managed resource. This class is used in conjunction with instances of AvailabilityCollectorRunnable - read its javadoc for more.

Author:
John Mazzitelli

Constructor Summary
AvailabilityCollectorThreadPool()
           
 
Method Summary
 void execute(Runnable runnable)
          Given a AvailabilityCollectorRunnable instance, this will run that instance in a thread, thus allowing the availability status for a managed resource to be periodically checked asynchronously.
 void initialize()
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AvailabilityCollectorThreadPool

public AvailabilityCollectorThreadPool()
Method Detail

initialize

public void initialize()

shutdown

public void shutdown()

execute

public void execute(Runnable runnable)
Given a AvailabilityCollectorRunnable instance, this will run that instance in a thread, thus allowing the availability status for a managed resource to be periodically checked asynchronously. The given runnable will store its last known availability status so it can be retrieved very fast. The given runnable must be of type AvailabilityCollectorRunnable, otherwise a runtime exception will occur.

Specified by:
execute in interface Executor
Parameters:
runnable - the availability collector runnable that will be invoked in a thread to being collecting availability status of a managed resource.


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.