Package org.apache.wicket.cdi
Class NonContextual<T>
- java.lang.Object
-
- org.apache.wicket.cdi.NonContextual<T>
-
- Type Parameters:
T
-
public class NonContextual<T> extends Object
Manages lifecycle of non-contextual (non-CDI-managed) objects- Author:
- igor
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
inject(T instance)
Injects the instancestatic <T> NonContextual<T>
of(Class<? extends T> clazz)
Factory method for creating non-contextual instancesstatic <T> NonContextual<T>
of(T t)
Convenience factory method for an instance, seeof(Class)
.void
postConstruct(T instance)
Injects the instance and calls anyPostConstruct
methodsvoid
preDestroy(T instance)
Calls anyPreDestroy
methods and destroys any injected dependencies that need to be destroyed.static void
undeploy()
Undeploys the looked up bean manager from cache
-
-
-
Method Detail
-
undeploy
public static void undeploy()
Undeploys the looked up bean manager from cache
-
of
public static <T> NonContextual<T> of(T t)
Convenience factory method for an instance, seeof(Class)
.- Type Parameters:
T
-- Parameters:
t
-- Returns:
- The NonContextual for the instance's class
-
of
public static <T> NonContextual<T> of(Class<? extends T> clazz)
Factory method for creating non-contextual instances- Type Parameters:
T
-- Parameters:
clazz
-- Returns:
- The NonContextual for the given class
-
postConstruct
public void postConstruct(T instance)
Injects the instance and calls anyPostConstruct
methods- Parameters:
instance
-
-
preDestroy
public void preDestroy(T instance)
Calls anyPreDestroy
methods and destroys any injected dependencies that need to be destroyed.- Parameters:
instance
-
-
-