Top Description Fields Constructors Methods
org.postgresql.jdbc

pack-priv Class StatementCancelTimerTask

extends TimerTask
Class Inheritance
Imports
org.checkerframework.checker.nullness.qual.Nullable, java.util.TimerTask

Timer task that sends statement.cancel() signal to support java.sql.Statement#setQueryTimeout(int). We explicitly nullify the reference to statement to help GC since java.util.TimerThread might keep reference to the latest executed task in its local variable.

Field Summary

Modifier and TypeField and Description
private @Nullable PgStatement

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
cancel()

Overrides java.util.TimerTask.cancel.

Cancels this timer task.

public void
run()

Implements abstract java.util.TimerTask.run.

Implements java.lang.Runnable.run.

The action to be performed by this timer task.

Inherited from java.util.TimerTask:
scheduledExecutionTime

Field Detail

statementback to summary
private @Nullable PgStatement statement

Constructor Detail

StatementCancelTimerTaskback to summary
pack-priv StatementCancelTimerTask(PgStatement statement)

Method Detail

cancelback to summary
public boolean cancel()

Overrides java.util.TimerTask.cancel.

Doc from java.util.TimerTask.cancel.

Cancels this timer task. If the task has been scheduled for one-time execution and has not yet run, or has not yet been scheduled, it will never run. If the task has been scheduled for repeated execution, it will never run again. (If the task is running when this call occurs, the task will run to completion, but will never run again.)

Note that calling this method from within the run method of a repeating timer task absolutely guarantees that the timer task will not run again.

This method may be called repeatedly; the second and subsequent calls have no effect.

Returns:boolean

true if this task is scheduled for one-time execution and has not yet run, or this task is scheduled for repeated execution. Returns false if the task was scheduled for one-time execution and has already run, or if the task was never scheduled, or if the task was already cancelled. (Loosely speaking, this method returns true if it prevents one or more scheduled executions from taking place.)

Annotations
@Override
runback to summary
public void run()

Implements abstract java.util.TimerTask.run.

Implements java.lang.Runnable.run.

Doc from java.util.TimerTask.run.

The action to be performed by this timer task.

Annotations
@Override