Class AtomicReferenceService<T extends AutoCloseable>

java.lang.Object
org.wildfly.clustering.server.service.AtomicReferenceService<T>
Type Parameters:
T - the operating type
All Implemented Interfaces:
Service

public class AtomicReferenceService<T extends AutoCloseable> extends Object implements Service
A simple service facade to an AutoCloseable factory.
Author:
Paul Ferraro
  • Constructor Details

    • AtomicReferenceService

      public AtomicReferenceService(Supplier<T> factory)
      Creates a simple service from the specified value factory.
      Parameters:
      factory - a value factory
    • AtomicReferenceService

      public AtomicReferenceService(Supplier<T> factory, AtomicReference<T> reference)
      Creates a simple service from the specified value factory.
      Parameters:
      factory - a value factory
      reference - a reference to the service value
  • Method Details

    • isStarted

      public boolean isStarted()
      Description copied from interface: Service
      Indicates whether or not this service is started.
      Specified by:
      isStarted in interface Service
      Returns:
      true, if this service is started, false otherwise
    • start

      public void start()
      Description copied from interface: Service
      Starts this service.
      Specified by:
      start in interface Service
    • stop

      public void stop()
      Description copied from interface: Service
      Stops this service.
      Specified by:
      stop in interface Service