Interface Creation<I>
- Type Parameters:
I- the type of instance being created
- All Superinterfaces:
ReferencesSelector
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 TypeMethodDescriptiondefault voidSignals that the suppliedinstanceis in the process of being created, typically by an invocation of aFactory'screate(Creation)method, and is about to be made available for use.id()Methods inherited from interface org.microbean.bean.ReferencesSelector
destroy, reference, references
-
Method Details
-
id
-
creating
Signals that the suppliedinstanceis in the process of being created, typically by an invocation of aFactory'screate(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
IllegalArgumentExceptionor by simply ignoring redundant invocations.- Parameters:
instance- the instance that is in the process of being returned from an invocation of aFactory.create(Creation)method; may benull- Throws:
IllegalArgumentException- ifinstancewas found to be unsuitable for any reason
-