Interface Instance

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
SimpleInstance, SimpleWorkerInstance

public interface Instance extends AutoCloseable
Represents a running Instance of the application. Though not strictly required, there ought only be one Instance per machine or process space. The rationale is that the Instance is dedicated to making full use of the machine's horsepower to perform operations.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Used with Named to name an instance of ExecutorService which is a general purpose pool of threads used for performing various tasks within the system.
    static final String
    Used with Named to name an instance of ScheduledExecutorService which is a general purpose pool of threads used for performing various tasks within the system that require scheduling.
    static final String
    The worker thread group.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Attempts to stop the instance.
    Gets this instances InstanceId
    void
    Forces a refresh of the underlying connections as necessary.
    void
    Attempts to start, throwing an instance of MultiException any failures happen during the startup process.
  • Field Details

    • THREAD_GROUP

      static final String THREAD_GROUP
      The worker thread group.
      See Also:
    • EXECUTOR_SERVICE

      static final String EXECUTOR_SERVICE
      Used with Named to name an instance of ExecutorService which is a general purpose pool of threads used for performing various tasks within the system.
      See Also:
    • SCHEDULED_EXECUTOR_SERVICE

      static final String SCHEDULED_EXECUTOR_SERVICE
      Used with Named to name an instance of ScheduledExecutorService which is a general purpose pool of threads used for performing various tasks within the system that require scheduling.
      See Also:
  • Method Details

    • getInstanceId

      InstanceId getInstanceId()
      Gets this instances InstanceId
      Returns:
      the InstanceId
    • start

      void start()
      Attempts to start, throwing an instance of MultiException any failures happen during the startup process. A subsequent call to close() should follow to ensure resources are cleaned up.
    • close

      void close()
      Attempts to stop the instance.
      Specified by:
      close in interface AutoCloseable
    • refreshConnections

      void refreshConnections()
      Forces a refresh of the underlying connections as necessary.