Top Fields Constructors Methods
org.eclipse.jetty.io.internal

public Class ContentCopier

extends IteratingNestedCallback
Class Inheritance
Imports
org.eclipse.jetty.io.Content, org.eclipse.jetty.util.Callback, .IteratingNestedCallback, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private final Content.Chunk.Processor
private Content.Chunk
private static final Logger
private final Content.Sink
private final Content.Source
private boolean

Constructor Summary

AccessConstructor and Description
public
ContentCopier(Content.Source source, Content.Sink sink, Content.Chunk.Processor chunkProcessor, Callback callback)

Method Summary

Modifier and TypeMethod and Description
public void
failed(Throwable
the reason for the operation failure
x
)

Overrides org.eclipse.jetty.util.IteratingCallback.failed.

Overrides default org.eclipse.jetty.util.Callback.failed.

Method to invoke when the asynchronous sub-task fails, or to fail the overall asynchronous task and therefore terminate the iteration.

public Invocable.InvocationType
protected IteratingCallback.Action
process()

Implements abstract org.eclipse.jetty.util.IteratingCallback.process.

Method called by iterate() to process the asynchronous sub-task.

public void
succeeded()

Overrides org.eclipse.jetty.util.IteratingCallback.succeeded.

Overrides default org.eclipse.jetty.util.Callback.succeeded.

Method to invoke when the asynchronous sub-task succeeds.

Inherited from org.eclipse.jetty.util.IteratingNestedCallback:
onCompleteFailureonCompleteSuccesstoString

Field Detail

chunkProcessorback to summary
private final Content.Chunk.Processor chunkProcessor
currentback to summary
private Content.Chunk current
LOGback to summary
private static final Logger LOG
sinkback to summary
private final Content.Sink sink
sourceback to summary
private final Content.Source source
terminatedback to summary
private boolean terminated

Constructor Detail

ContentCopierback to summary
public ContentCopier(Content.Source source, Content.Sink sink, Content.Chunk.Processor chunkProcessor, Callback callback)

Method Detail

failedback to summary
public void failed(Throwable x)

Overrides org.eclipse.jetty.util.IteratingCallback.failed.

Overrides default org.eclipse.jetty.util.Callback.failed.

Doc from org.eclipse.jetty.util.IteratingCallback.failed.

Method to invoke when the asynchronous sub-task fails, or to fail the overall asynchronous task and therefore terminate the iteration.

Subclasses that override this method must always remember to call super.failed(Throwable).

Eventually, onCompleteFailure(Throwable) is called, either by the caller thread or by the processing thread.

Parameters
x:Throwable

Doc from org.eclipse.jetty.util.Callback.failed.

the reason for the operation failure

Annotations
@Override
getInvocationTypeback to summary
public Invocable.InvocationType getInvocationType()

Overrides org.eclipse.jetty.util.IteratingNestedCallback.getInvocationType.

Overrides default org.eclipse.jetty.util.thread.Invocable.getInvocationType.

Returns:Invocable.InvocationType

Doc from org.eclipse.jetty.util.thread.Invocable.getInvocationType.

The InvocationType of this object

Annotations
@Override
processback to summary
protected IteratingCallback.Action process() throws Throwable

Implements abstract org.eclipse.jetty.util.IteratingCallback.process.

Doc from org.eclipse.jetty.util.IteratingCallback.process.

Method called by iterate() to process the asynchronous sub-task.

Implementations must initiate the asynchronous execution of the sub-task (if any) and return an appropriate action:

  • Action#IDLE when no sub tasks are available for execution but the overall job is not completed yet
  • Action#SCHEDULED when the sub task asynchronous execution has been started
  • Action#SUCCEEDED when the overall job is completed
Returns:IteratingCallback.Action

the appropriate Action

Annotations
@Override
Exceptions
Throwable:
if the sub-task processing throws
succeededback to summary
public void succeeded()

Overrides org.eclipse.jetty.util.IteratingCallback.succeeded.

Overrides default org.eclipse.jetty.util.Callback.succeeded.

Doc from org.eclipse.jetty.util.IteratingCallback.succeeded.

Method to invoke when the asynchronous sub-task succeeds.

Subclasses that override this method must always remember to call super.succeeded().

Annotations
@Override