CacheSerializableRunnable (Apache Geode 1.8.0)
Date: 2018-11-29

org.apache.geode.cache30

## Class CacheSerializableRunnable

- java.lang.Object
- - org.apache.geode.test.dunit.SerializableRunnable
  - - org.apache.geode.cache30.CacheSerializableRunnable

- All Implemented Interfaces:
    java.io.Serializable, org.apache.geode.test.dunit.SerializableRunnableIF

      public abstract class CacheSerializableRunnable
      extends org.apache.geode.test.dunit.SerializableRunnable

  A helper class that provides the `SerializableRunnable` class, but uses a `run2()` method instead that throws `CacheException`. This way, we don't need to have a lot of try/catch code in the tests.
  Since:
    GemFire 3.0
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `CacheSerializableRunnable.CacheSerializableRunnableException` An exception that wraps a `CacheException`

  - ### Field Summary

    - ### Fields inherited from class org.apache.geode.test.dunit.SerializableRunnable

      `args`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CacheSerializableRunnable(java.lang.String name)` Creates a new `CacheSerializableRunnable` with the given name
    `CacheSerializableRunnable(java.lang.String name, java.lang.Object[] args)` Creates a new `CacheSerializableRunnable` with the given name

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `run()` Invokes the `run2()` method and will wrap any `CacheException` thrown by `run2` in a `CacheSerializableRunnable.CacheSerializableRunnableException`.
    `abstract void` | `run2()` A `run` method that may throw a `CacheException`.
    `void` | `run3()`

    - ### Methods inherited from class org.apache.geode.test.dunit.SerializableRunnable

      `getName, setName, toString`

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

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

- - ### Constructor Detail

    - #### CacheSerializableRunnable

          public CacheSerializableRunnable(java.lang.String name)

      Creates a new `CacheSerializableRunnable` with the given name

    - #### CacheSerializableRunnable

          public CacheSerializableRunnable(java.lang.String name,
                                           java.lang.Object[] args)

      Creates a new `CacheSerializableRunnable` with the given name

  - ### Method Detail

    - #### run

          public void run()

      Invokes the `run2()` method and will wrap any `CacheException` thrown by `run2` in a `CacheSerializableRunnable.CacheSerializableRunnableException`.

    - #### run2

          public abstract void run2()
                             throws CacheException

      A `run` method that may throw a `CacheException`.
      Throws:
        `CacheException`

    - #### run3

          public void run3()
                    throws CacheException

      Throws:
        `CacheException`