Top Description Inners Fields Constructors Methods
org.eclipse.jetty.util.thread.strategy

public Class ProduceConsume

extends Object
implements ExecutionStrategy, Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable, org.eclipse.jetty.util.thread.ExecutionStrategy
Imports
java.util.concurrent.Executor, org.eclipse.jetty.util.thread.AutoLock, .ExecutionStrategy, org.slf4j.Logger, .LoggerFactory

A strategy where the caller thread iterates over task production, submitting each task to an Executor for execution.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum

Field Summary

Modifier and TypeField and Description
private final Executor
private final AutoLock
private final ExecutionStrategy.Producer
private ProduceConsume.State
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
dispatch()

Implements org.eclipse.jetty.util.thread.ExecutionStrategy.dispatch.

Initiates (or resumes) the task production and consumption.

public void
produce()

Implements org.eclipse.jetty.util.thread.ExecutionStrategy.produce.

Initiates (or resumes) the task production and consumption.

public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_executorback to summary
private final Executor _executor
_lockback to summary
private final AutoLock _lock
_producerback to summary
private final ExecutionStrategy.Producer _producer
_stateback to summary
private ProduceConsume.State _state
LOGback to summary
private static final Logger LOG

Constructor Detail

ProduceConsumeback to summary
public ProduceConsume(ExecutionStrategy.Producer producer, Executor executor)

Method Detail

dispatchback to summary
public void dispatch()

Implements org.eclipse.jetty.util.thread.ExecutionStrategy.dispatch.

Doc from org.eclipse.jetty.util.thread.ExecutionStrategy.dispatch.

Initiates (or resumes) the task production and consumption.

This method guarantees that the task is never run by the thread that called this method.

TODO review the need for this (only used by HTTP2 push)
Annotations
@Override
produceback to summary
public void produce()

Implements org.eclipse.jetty.util.thread.ExecutionStrategy.produce.

Doc from org.eclipse.jetty.util.thread.ExecutionStrategy.produce.

Initiates (or resumes) the task production and consumption.

The produced task may be run by the same thread that called this method.

Annotations
@Override
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
org.eclipse.jetty.util.thread.strategy back to summary

private final Enum ProduceConsume.State

extends Enum<ProduceConsume.State>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final ProduceConsume.State
public static final ProduceConsume.State
public static final ProduceConsume.State

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ProduceConsume.State
public static ProduceConsume.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

EXECUTEback to summary
public static final ProduceConsume.State EXECUTE
IDLEback to summary
public static final ProduceConsume.State IDLE
PRODUCEback to summary
public static final ProduceConsume.State PRODUCE

Constructor Detail

Stateback to summary
private State()

Method Detail

valueOfback to summary
public static ProduceConsume.State valueOf(String name)
valuesback to summary
public static ProduceConsume.State[] values()