public class Unmanaged<T> extends Object
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.
Modifier and Type | Class and Description |
---|---|
static class |
Unmanaged.UnmanagedInstance<T>
Represents a non-contextual instance.
|
public Unmanaged(BeanManager manager, Class<T> clazz)
public Unmanaged.UnmanagedInstance<T> newInstance()
Copyright © 1996-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.