Interface Creation<I>

Type Parameters:
I - the type of instance being created
All Superinterfaces:
ReferencesSelector

public interface Creation<I> extends ReferencesSelector
A representation of a Factory's creation activity.

Any Creation implementation must also be a Destruction implementation, or undefined behavior and errors may occur.

Many Creation implementations are also AutoCloseableRegistry implementations. This is not a requirement of the Creation or Destruction contracts.

Author:
Laird Nelson
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    creating(I instance)
    Signals that the supplied instance is in the process of being created, typically by an invocation of a Factory's create(Creation) method, and is about to be made available for use.

    Methods inherited from interface org.microbean.bean.ReferencesSelector

    references
  • Method Details

    • creating

      default void creating(I instance)
      Signals that the supplied instance is in the process of being created, typically by an invocation of a Factory's create(Creation) method, and is about to be made available for use.

      This method is typically invoked from within a Factory.create(Creation) implementation immediately prior to its returning a value.

      It is permissible and very common for an implementation of this method to do nothing. The default implementation of this method does nothing.

      Implementations of this method must ensure that if two or more invocations of this method are supplied with the same object reference, only one invocation will have any effect, whether by throwing an IllegalArgumentException or by simply ignoring redundant invocations.

      Parameters:
      instance - the instance that is in the process of being returned from an invocation of a Factory.create(Creation) method; may be null
      Throws:
      IllegalArgumentException - if instance was found to be unsuitable for any reason