Class CurrentTaskFuture.QueueRunner
java.lang.Object
org.glassfish.hk2.runlevel.internal.CurrentTaskFuture.QueueRunner
- All Implemented Interfaces:
Runnable
- Enclosing class:
CurrentTaskFuture
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final HashSet<ActiveDescriptor<?>> private final AsyncRunLevelContextprivate final ServiceLocatorprivate final intprivate final CurrentTaskFuture.UpOneLevelprivate final Objectprivate final List<ServiceHandle<?>> private final Objectprivate ServiceHandle<?> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateQueueRunner(ServiceLocator locator, AsyncRunLevelContext asyncContext, Object queueLock, List<ServiceHandle<?>> queue, CurrentTaskFuture.UpOneLevel parent, Object parentLock, int maxThreads) -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanisWouldBlockRightNow(HashSet<ActiveDescriptor<?>> cycleChecker, ActiveDescriptor<?> checkMe) This method does a preliminary check of whether or not the descriptor (or any children) would cause the thread to block.private voidoneJob(ServiceHandle<?> fService, boolean block) voidrun()
-
Field Details
-
locator
-
asyncContext
-
queueLock
-
queue
-
parent
-
parentLock
-
maxThreads
private final int maxThreads -
wouldHaveBlocked
-
alreadyTried
-
-
Constructor Details
-
QueueRunner
private QueueRunner(ServiceLocator locator, AsyncRunLevelContext asyncContext, Object queueLock, List<ServiceHandle<?>> queue, CurrentTaskFuture.UpOneLevel parent, Object parentLock, int maxThreads)
-
-
Method Details
-
run
public void run() -
isWouldBlockRightNow
private boolean isWouldBlockRightNow(HashSet<ActiveDescriptor<?>> cycleChecker, ActiveDescriptor<?> checkMe) This method does a preliminary check of whether or not the descriptor (or any children) would cause the thread to block. If this method returns true then we do not try this service, which can save on going down the getService stack and on the throwing and creation of WouldBlockException- Parameters:
cycleChecker- To ensure we are not caught in a cyclecheckMe- The descriptor to check- Returns:
- false if as far as we know this descriptor would NOT block, true if we think if we tried this descriptor right now that it would block
-
oneJob
-