Package javax.enterprise.inject.spi
Class Unmanaged<T>
java.lang.Object
javax.enterprise.inject.spi.Unmanaged<T>
- Type Parameters:
T
- type of unmanaged instances
Helper class for injecting and calling lifecycle callbacks unmanaged instances for use by framework and library integrators.
Unmanaged<Foo> unmanagedFoo = new Unmanaged<Foo>(Foo.class); UnmanagedInstance<Foo> fooInstance = unmanagedFoo.newInstance(); Foo foo = fooInstance.produce().inject().postConstruct().get(); ... // Use the foo instance fooInstance.preDestroy().dispose();
An instance of this class can be safely held for the lifetime of the application.
Unmanaged.UnmanagedInstance
s created by this class are not suitable for sharing between threads.
- Since:
- 1.1
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Represents a non-contextual instance. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionInstantiate a new UnmanagedInstance
-
Constructor Details
-
Unmanaged
Create an injector for the given class- Parameters:
manager
- theBeanManager
clazz
- class of the unmanaged instances
-
Unmanaged
Create an injector for the given class, using the current bean manager- Parameters:
clazz
- class of the unmanaged instances
-
-
Method Details
-
newInstance
Instantiate a new UnmanagedInstance- Returns:
- a new
Unmanaged.UnmanagedInstance
-