WorkerService.WorkRequest (Apache ZooKeeper - Server 3.7.0 API)
Date: 2021-03-17

org.apache.zookeeper.server

## Class WorkerService.WorkRequest

- java.lang.Object
- - org.apache.zookeeper.server.WorkerService.WorkRequest

- Enclosing class:
    WorkerService

      public abstract static class WorkerService.WorkRequest
      extends Object

  Callers should implement a class extending WorkRequest in order to schedule work with the service.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `WorkRequest()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cleanup()` (Optional) If implemented, is called if the service is stopped or unable to schedule the request.
    `abstract void` | `doWork()` Must be implemented.

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

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

- - ### Constructor Detail

    - #### WorkRequest

          public WorkRequest()

  - ### Method Detail

    - #### doWork

          public abstract void doWork()
                               throws Exception

      Must be implemented. Is called when the work request is run.
      Throws:
        `Exception`

    - #### cleanup

          public void cleanup()

      (Optional) If implemented, is called if the service is stopped or unable to schedule the request.

Copyright © 2008–2021 The Apache Software Foundation. All rights reserved.