Package org.int4.dirk.spi.scope
Interface CreationalContext.Reference<T>
-
- Type Parameters:
T- the type of instance this reference holds
- Enclosing interface:
- CreationalContext<T>
public static interface CreationalContext.Reference<T>A reference to an instance created by theCreationalContextwith which the created instance can be released.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tget()Gets the instance held by this reference.voidrelease()Releases this reference.
-
-
-
Method Detail
-
get
T get()
Gets the instance held by this reference. If the reference has already been released this will throwIllegalStateException.- Returns:
- the instance held by this reference, can be
null - Throws:
java.lang.IllegalStateException- when the reference was released
-
release
void release()
Releases this reference. Any dependent objects associated with it will be destroyed. This method is idempotent.
-
-