Class ConcurrentInitialize<T>

java.lang.Object
aQute.lib.concurrentinit.ConcurrentInitialize<T>
Type Parameters:
T -
Direct Known Subclasses:
ConnectionSettings.MasterPassphrase

public abstract class ConcurrentInitialize<T> extends Object
Helper class to handle concurrent system where you need to initialize a value. The first one should create the value but the others should block until the value has been created.
  • Field Details

  • Constructor Details

    • ConcurrentInitialize

      public ConcurrentInitialize()
  • Method Details

    • get

      public T get() throws Exception
      Get the value or wait until it is created.
      Throws:
      Exception
    • create

      public abstract T create() throws Exception
      Override to create the actual object
      Returns:
      the actual object, could be null
      Throws:
      Exception - if the creation failed this is the exception that was thrown