org.apache.ignite.spi.communication.tcp.internal.shmem

## Class ShmemWorker

- java.lang.Object
- - org.apache.ignite.internal.util.worker.GridWorker
  - - org.apache.ignite.spi.communication.tcp.internal.shmem.ShmemWorker

All Implemented Interfaces:
  Runnable, WorkProgressDispatcher

    public class ShmemWorker
    extends GridWorker

Shmem grid worker.

### Field Summary

### Fields inherited from class org.apache.ignite.internal.util.worker.GridWorker

`isCancelled`

### Constructor Summary

Constructors
Constructor and Description
`ShmemWorker(String igniteInstanceName, IgniteLogger log, Tracing tracing, IpcEndpoint endpoint, GridNioServerListener<Message> srvLsnr, TcpCommunicationMetricsListener metricsLsnr, GridNioMessageReaderFactory readerFactory, GridNioMessageWriterFactory writerFactory, MessageFactory msgFactory)`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected void` `body()` The implementation should provide the execution body for this runnable.
`void` `cancel()` Cancels this runnable interrupting actual runner.
`protected void` `cleanup()` Optional method that will be called after runnable is finished.
`void` `onFinish(Runnable lsnr)`
`String` `toString()`

### Methods inherited from class org.apache.ignite.internal.util.worker.GridWorker

`blockingSectionBegin, blockingSectionEnd, heartbeatTs, igniteInstanceName, isCancelled, isDone, join, name, onIdle, run, runner, updateHeartbeat`

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

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

### Constructor Detail

#### ShmemWorker

    public ShmemWorker(String igniteInstanceName,
                       IgniteLogger log,
                       Tracing tracing,
                       IpcEndpoint endpoint,
                       GridNioServerListener<Message> srvLsnr,
                       TcpCommunicationMetricsListener metricsLsnr,
                       GridNioMessageReaderFactory readerFactory,
                       GridNioMessageWriterFactory writerFactory,
                       MessageFactory msgFactory)

Parameters:
  `igniteInstanceName` - Ignite instance name.
  `log` - Logger.
  `tracing` - Tracing.
  `endpoint` - Endpoint.
  `srvLsnr` - Server listener.
  `metricsLsnr` - Metrics listener.
  `readerFactory` - Reader factory.
  `writerFactory` - Writer factory.
  `msgFactory` - Message factory.

### Method Detail

#### body

    protected void body()
                 throws InterruptedException

The implementation should provide the execution body for this runnable.

Specified by:
  `body` in class `GridWorker`
Throws:
  `InterruptedException` - Thrown in case of interruption.

#### onFinish

    public void onFinish(Runnable lsnr)

Parameters:
  `lsnr` - Listener to onFinish event.

#### cancel

    public void cancel()

Cancels this runnable interrupting actual runner.

Overrides:
  `cancel` in class `GridWorker`

#### cleanup

    protected void cleanup()

Optional method that will be called after runnable is finished. Default implementation is no-op.

Overrides:
  `cleanup` in class `GridWorker`

#### toString

    public String toString()

Overrides:
  `toString` in class `GridWorker`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.11.1
Release Date | : December 20 2021