Package javax.enterprise.inject.spi
Class Unmanaged.UnmanagedInstance<T>
- java.lang.Object
-
- javax.enterprise.inject.spi.Unmanaged.UnmanagedInstance<T>
-
-
Field Summary
Fields Modifier and Type Field Description private CreationalContext<T>
ctx
private boolean
disposed
private InjectionTarget<T>
injectionTarget
private T
instance
-
Constructor Summary
Constructors Modifier Constructor Description private
UnmanagedInstance(BeanManager beanManager, InjectionTarget<T> injectionTarget)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Unmanaged.UnmanagedInstance<T>
dispose()
Dispose of the instance, doing any necessary cleanupT
get()
Get the instanceUnmanaged.UnmanagedInstance<T>
inject()
Inject the instanceUnmanaged.UnmanagedInstance<T>
postConstruct()
Call the @PostConstruct callbackUnmanaged.UnmanagedInstance<T>
preDestroy()
Call the @PreDestroy callbackUnmanaged.UnmanagedInstance<T>
produce()
Create the instance
-
-
-
Field Detail
-
ctx
private final CreationalContext<T> ctx
-
injectionTarget
private final InjectionTarget<T> injectionTarget
-
instance
private T instance
-
disposed
private boolean disposed
-
-
Constructor Detail
-
UnmanagedInstance
private UnmanagedInstance(BeanManager beanManager, InjectionTarget<T> injectionTarget)
-
-
Method Detail
-
get
public T get()
Get the instance
-
produce
public Unmanaged.UnmanagedInstance<T> produce()
Create the instance- Throws:
java.lang.IllegalStateException
- if produce() is called on an already produced instancejava.lang.IllegalStateException
- if produce() is called on an instance that has already been disposed
-
inject
public Unmanaged.UnmanagedInstance<T> inject()
Inject the instance- Throws:
java.lang.IllegalStateException
- if inject() is called before produce() is calledjava.lang.IllegalStateException
- if inject() is called on an instance that has already been disposed
-
postConstruct
public Unmanaged.UnmanagedInstance<T> postConstruct()
Call the @PostConstruct callback- Throws:
java.lang.IllegalStateException
- if postConstruct() is called before produce() is calledjava.lang.IllegalStateException
- if postConstruct() is called on an instance that has already been disposed
-
preDestroy
public Unmanaged.UnmanagedInstance<T> preDestroy()
Call the @PreDestroy callback- Throws:
java.lang.IllegalStateException
- if preDestroy() is called before produce() is calledjava.lang.IllegalStateException
- if preDestroy() is called on an instance that has already been disposed
-
dispose
public Unmanaged.UnmanagedInstance<T> dispose()
Dispose of the instance, doing any necessary cleanup- Throws:
java.lang.IllegalStateException
- if dispose() is called before produce() is calledjava.lang.IllegalStateException
- if dispose() is called on an instance that has already been disposed
-
-