Class WorkerProvider

java.lang.Object
io.github.qsy7.queue.impl.worker.WorkerProvider
All Implemented Interfaces:
jakarta.inject.Provider<io.github.qsy7.queue.api.model.Worker>

@Singleton public class WorkerProvider extends Object implements jakarta.inject.Provider<io.github.qsy7.queue.api.model.Worker>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final jakarta.inject.Provider<Repository>
     
    protected final io.github.qsy7.queue.api.model.Worker
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    WorkerProvider(io.github.qsy7.shell.api.model.Node node, jakarta.inject.Provider<Repository> repositoryProvider)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    io.github.qsy7.queue.api.model.Worker
    get()
     
    protected io.github.qsy7.queue.api.model.Worker
    getWorker(io.github.qsy7.queue.api.model.Worker worker)
    A worker is unique to the application identifier, each time we start the application, that will change the application identifier so we can trace it to a running instance of the application.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • repositoryProvider

      protected final jakarta.inject.Provider<Repository> repositoryProvider
    • worker

      protected final io.github.qsy7.queue.api.model.Worker worker
  • Constructor Details

    • WorkerProvider

      @Inject public WorkerProvider(io.github.qsy7.shell.api.model.Node node, jakarta.inject.Provider<Repository> repositoryProvider)
  • Method Details

    • getWorker

      protected io.github.qsy7.queue.api.model.Worker getWorker(io.github.qsy7.queue.api.model.Worker worker)
      A worker is unique to the application identifier, each time we start the application, that will change the application identifier so we can trace it to a running instance of the application.
      Parameters:
      worker - the persisted worker
      Returns:
      the worker persisted to the datastore
    • get

      public io.github.qsy7.queue.api.model.Worker get()
      Specified by:
      get in interface jakarta.inject.Provider<io.github.qsy7.queue.api.model.Worker>