Interface Initializable


public interface Initializable

Definition of an interface to be implemented by Configuration implementations which support a special initialization method.

This interface is mainly evaluated by configuration builder implementations: If a newly created configuration instance implements this interface, the builder calls the initialize() method. This gives Configuration classes the opportunity to perform additional initializations after all properties passed to the builder have been set.

Another use case for this interface is to perform initializations directly which otherwise would have been done lazily. Lazy initializations can be problematic regarding thread-safety. If in contrast a configuration instance has been fully initialized when it is returned from the builder, it may be used with a NoOpSynchronizer if it is not modified.

Since:
2.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Initializes this object.
  • Method Details

    • initialize

      void initialize()
      Initializes this object. A concrete implementation can use this method to perform arbitrary initialization. Typically, this method is invoked by a configuration builder. In this case, the builder's lock is held, so that all member fields set by this method are safely published.