org.apache.ignite.internal.processors.timeout

## Class GridTimeoutProcessor

- java.lang.Object
- - org.apache.ignite.internal.processors.GridProcessorAdapter
  - - org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor

All Implemented Interfaces:
  GridComponent, GridProcessor

    public class GridTimeoutProcessor
    extends GridProcessorAdapter

Detects timeout events and processes them.

### Nested Class Summary

Nested Classes
`class` `GridTimeoutProcessor.CancelableTask`

### Nested classes/interfaces inherited from interface org.apache.ignite.internal.GridComponent

`GridComponent.DiscoveryDataExchangeType`

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter

`ctx, diagnosticLog, log`

### Constructor Summary

Constructors
Constructor and Description
`GridTimeoutProcessor(GridKernalContext ctx)`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `addTimeoutObject(GridTimeoutObject timeoutObj)`
`void` `printMemoryStats()` Prints memory statistics (sizes of internal structures, etc.).
`boolean` `removeTimeoutObject(GridTimeoutObject timeoutObj)`
`GridTimeoutProcessor.CancelableTask` `schedule(Runnable task, long delay, long period)` Schedule the specified timer task for execution at the specified time with the specified period, in milliseconds.
`void` `start()` Starts grid component.
`void` `stop(boolean cancel)` Stops grid component.
`void` `waitAsync(IgniteInternalFuture<?> fut, long timeout, IgniteBiInClosure<IgniteCheckedException,Boolean> clo)` Wait for a future (listen with timeout).

### Methods inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter

`assertParameter, collectGridNodeData, collectJoiningNodeData, discoveryDataType, onDisconnected, onGridDataReceived, onJoiningNodeDataReceived, onKernalStart, onKernalStop, onReconnected, toString, validateNode, validateNode`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### GridTimeoutProcessor

    public GridTimeoutProcessor(GridKernalContext ctx)

Parameters:
  `ctx` - Kernal context.

### Method Detail

#### start

    public void start()

Starts grid component.

Specified by:
  `start` in interface `GridComponent`
Overrides:
  `start` in class `GridProcessorAdapter`

#### stop

    public void stop(boolean cancel)
              throws IgniteCheckedException

Stops grid component.

Specified by:
  `stop` in interface `GridComponent`
Overrides:
  `stop` in class `GridProcessorAdapter`
Parameters:
  `cancel` - If `true`, then all ongoing tasks or jobs for relevant components need to be cancelled.
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

#### addTimeoutObject

    public boolean addTimeoutObject(GridTimeoutObject timeoutObj)

Parameters:
  `timeoutObj` - Timeout object.
Returns:
  `True` if object was added.

#### schedule

    public GridTimeoutProcessor.CancelableTask schedule(Runnable task,
                                                        long delay,
                                                        long period)

Schedule the specified timer task for execution at the specified time with the specified period, in milliseconds.

Parameters:
  `task` - Task to execute.
  `delay` - Delay to first execution in milliseconds.
  `period` - Period for execution in milliseconds or -1.
Returns:
  Cancelable to cancel task.

#### removeTimeoutObject

    public boolean removeTimeoutObject(GridTimeoutObject timeoutObj)

Parameters:
  `timeoutObj` - Timeout object.
Returns:
  `True` if timeout object was removed.

#### waitAsync

    public void waitAsync(IgniteInternalFuture<?> fut,
                          long timeout,
                          IgniteBiInClosure<IgniteCheckedException,Boolean> clo)

Wait for a future (listen with timeout).

Parameters:
  `fut` - Future.
  `timeout` - Timeout millis. -1 means expired timeout, 0 means waiting without timeout.
  `clo` - Finish closure. First argument contains error on future or null if no errors, second is `true` if wait timed out or passed timeout argument means expired timeout.

#### printMemoryStats

    public void printMemoryStats()

Prints memory statistics (sizes of internal structures, etc.). NOTE: this method is for testing and profiling purposes only.

Specified by:
  `printMemoryStats` in interface `GridComponent`
Overrides:
  `printMemoryStats` in class `GridProcessorAdapter`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.16.0
Release Date | : December 15 2023