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 AsyncRunLevelContext
private final ServiceLocator
private final int
private final CurrentTaskFuture.UpOneLevel
private final Object
private final List
<ServiceHandle<?>> private final Object
private ServiceHandle
<?> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
QueueRunner
(ServiceLocator locator, AsyncRunLevelContext asyncContext, Object queueLock, List<ServiceHandle<?>> queue, CurrentTaskFuture.UpOneLevel parent, Object parentLock, int maxThreads) -
Method Summary
Modifier and TypeMethodDescriptionprivate 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.private void
oneJob
(ServiceHandle<?> fService, boolean block) void
run()
-
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
-