org.wildfly.swarm.config.singleton

## Class SingletonPolicy<T extends SingletonPolicy<T>>

- java.lang.Object
- - org.wildfly.swarm.config.singleton.SingletonPolicy<T>

-     public class SingletonPolicy<T extends SingletonPolicy<T>>
      extends Object

  A singleton policy

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `SingletonPolicy.SingletonPolicyResources` Child mutators for SingletonPolicy

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SingletonPolicy(String key)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addPropertyChangeListener(PropertyChangeListener listener)` Adds a property change listener
    `String` | `cache()` The cache backing the singleton policy's singleton service.
    `T` | `cache(String value)` The cache backing the singleton policy's singleton service.
    `String` | `cacheContainer()` The cache container backing the singleton policy's singleton service
    `T` | `cacheContainer(String value)` The cache container backing the singleton policy's singleton service
    `String` | `getKey()`
    `Integer` | `quorum()` The minimum number of nodes required before this singleton service will start
    `T` | `quorum(Integer value)` The minimum number of nodes required before this singleton service will start
    `T` | `randomElectionPolicy()` A random election policy
    `T` | `randomElectionPolicy(RandomElectionPolicy value)` A random election policy
    `T` | `randomElectionPolicy(RandomElectionPolicyConsumer consumer)` A random election policy
    `T` | `randomElectionPolicy(RandomElectionPolicySupplier supplier)` A random election policy
    `void` | `removePropertyChangeListener(PropertyChangeListener listener)` Removes a property change listener
    `T` | `simpleElectionPolicy()` A simple election policy
    `T` | `simpleElectionPolicy(SimpleElectionPolicy value)` A simple election policy
    `T` | `simpleElectionPolicy(SimpleElectionPolicyConsumer consumer)` A simple election policy
    `T` | `simpleElectionPolicy(SimpleElectionPolicySupplier supplier)` A simple election policy
    `SingletonPolicy.SingletonPolicyResources` | `subresources()`

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

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

- - ### Constructor Detail

    - #### SingletonPolicy

          public SingletonPolicy(String key)

  - ### Method Detail

    - #### getKey

          public String getKey()

    - #### addPropertyChangeListener

          public void addPropertyChangeListener(PropertyChangeListener listener)

      Adds a property change listener

    - #### removePropertyChangeListener

          public void removePropertyChangeListener(PropertyChangeListener listener)

      Removes a property change listener

    - #### subresources

          public SingletonPolicy.SingletonPolicyResources subresources()

    - #### randomElectionPolicy

          public T randomElectionPolicy(RandomElectionPolicy value)

      A random election policy

    - #### randomElectionPolicy

          public T randomElectionPolicy(RandomElectionPolicyConsumer consumer)

      A random election policy

    - #### randomElectionPolicy

          public T randomElectionPolicy()

      A random election policy

    - #### randomElectionPolicy

          public T randomElectionPolicy(RandomElectionPolicySupplier supplier)

      A random election policy

    - #### simpleElectionPolicy

          public T simpleElectionPolicy(SimpleElectionPolicy value)

      A simple election policy

    - #### simpleElectionPolicy

          public T simpleElectionPolicy(SimpleElectionPolicyConsumer consumer)

      A simple election policy

    - #### simpleElectionPolicy

          public T simpleElectionPolicy()

      A simple election policy

    - #### simpleElectionPolicy

          public T simpleElectionPolicy(SimpleElectionPolicySupplier supplier)

      A simple election policy

    - #### cache

          public String cache()

      The cache backing the singleton policy's singleton service. If undefined, the default cache of the specified cache-container is used.

    - #### cache

          public T cache(String value)

      The cache backing the singleton policy's singleton service. If undefined, the default cache of the specified cache-container is used.

    - #### cacheContainer

          public String cacheContainer()

      The cache container backing the singleton policy's singleton service

    - #### cacheContainer

          public T cacheContainer(String value)

      The cache container backing the singleton policy's singleton service

    - #### quorum

          public Integer quorum()

      The minimum number of nodes required before this singleton service will start

    - #### quorum

          public T quorum(Integer value)

      The minimum number of nodes required before this singleton service will start

Copyright © 2017 JBoss by Red Hat. All rights reserved.