Package org.jvnet.hk2.internal
Class InstanceLifecycleEventImpl
- java.lang.Object
-
- org.jvnet.hk2.internal.InstanceLifecycleEventImpl
-
- All Implemented Interfaces:
InstanceLifecycleEvent
public class InstanceLifecycleEventImpl extends java.lang.Object implements InstanceLifecycleEvent
-
-
Field Summary
Fields Modifier and Type Field Description private ActiveDescriptor<?>
descriptor
private InstanceLifecycleEventType
eventType
private java.util.Map<Injectee,java.lang.Object>
knownInjectees
private java.lang.Object
lifecycleObject
-
Constructor Summary
Constructors Constructor Description InstanceLifecycleEventImpl(InstanceLifecycleEventType eventType, java.lang.Object lifecycleObject, java.util.Map<Injectee,java.lang.Object> knownInjectees, ActiveDescriptor<?> descriptor)
InstanceLifecycleEventImpl(InstanceLifecycleEventType eventType, java.lang.Object lifecycleObject, ActiveDescriptor<?> descriptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ActiveDescriptor<?>
getActiveDescriptor()
The active descriptor that is being used for the operation.InstanceLifecycleEventType
getEventType()
Gets the type of event this describes.java.util.Map<Injectee,java.lang.Object>
getKnownInjectees()
A map from the Injectee to the object actually used in the production, if known.java.lang.Object
getLifecycleObject()
The object that is being described by this event.java.lang.String
toString()
-
-
-
Field Detail
-
eventType
private final InstanceLifecycleEventType eventType
-
descriptor
private final ActiveDescriptor<?> descriptor
-
lifecycleObject
private final java.lang.Object lifecycleObject
-
knownInjectees
private final java.util.Map<Injectee,java.lang.Object> knownInjectees
-
-
Constructor Detail
-
InstanceLifecycleEventImpl
InstanceLifecycleEventImpl(InstanceLifecycleEventType eventType, java.lang.Object lifecycleObject, java.util.Map<Injectee,java.lang.Object> knownInjectees, ActiveDescriptor<?> descriptor)
-
InstanceLifecycleEventImpl
InstanceLifecycleEventImpl(InstanceLifecycleEventType eventType, java.lang.Object lifecycleObject, ActiveDescriptor<?> descriptor)
-
-
Method Detail
-
getEventType
public InstanceLifecycleEventType getEventType()
Description copied from interface:InstanceLifecycleEvent
Gets the type of event this describes. The values may be:- PRE_PRODUCTION
- POST_PRODUCTION
- PRE_DESTRUCTION
- Specified by:
getEventType
in interfaceInstanceLifecycleEvent
- Returns:
- The type of event being described
-
getActiveDescriptor
public ActiveDescriptor<?> getActiveDescriptor()
Description copied from interface:InstanceLifecycleEvent
The active descriptor that is being used for the operation. For PRE_PRODUCTION and POST_PRODUCTION this is the descriptor that will create or that created the object. For PRE_DESTRUCTION this is the descriptor that will be used to destroy the object- Specified by:
getActiveDescriptor
in interfaceInstanceLifecycleEvent
- Returns:
- The descriptor associated with this event
-
getLifecycleObject
public java.lang.Object getLifecycleObject()
Description copied from interface:InstanceLifecycleEvent
The object that is being described by this event. In the POST_PRODUCTION case this is the object that was just produced. In the PRE_DESTRUCTION case this is the object that will be destroyed. Will be null in the PRE_PRODUCTION case- Specified by:
getLifecycleObject
in interfaceInstanceLifecycleEvent
- Returns:
- The object that was produced or will be destroyed. Will be null in the PRE_PRODUCTION case
-
getKnownInjectees
public java.util.Map<Injectee,java.lang.Object> getKnownInjectees()
Description copied from interface:InstanceLifecycleEvent
A map from the Injectee to the object actually used in the production, if known. This will return null in the PRE_DESTRUCTION case. In the PRE_PRODUCTION and POST_PRODUCTION cases this will return non-null if the system knows the objects that will be or were injected into the produced object. If this method returns null in the PRE_PRODUCTION or POST_PRODUCTION case then the system does not know what objects were injected into the produced object, which happens in the case of objects created by aFactory
or objects created by third-party (pre-reified) ActiveDescriptors. If this method returns an empty map then the system knows that nothing will be or was injected into to produced object.- Specified by:
getKnownInjectees
in interfaceInstanceLifecycleEvent
- Returns:
- The known map of injection point to injected object, if that information is known. Will be null in the PRE_DESTRUCTION case and in the case where the system does not know the values.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-