|
JBoss Modular Service Kernel API 1.0.0.Beta4-SNAPSHOT | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.msc.value.InjectedValue<T>
T - the value typepublic final class InjectedValue<T>
A value which is injected from another source. The value may only be read if the injector has populated it.
| Constructor Summary | |
|---|---|
InjectedValue()
Construct a new instance. |
|
| Method Summary | |
|---|---|
T |
getOptionalValue()
Get the value if it was injected, or return null if it was not. |
T |
getValue()
Get the actual value. |
void |
inject(T value)
Inject the given value. |
void |
uninject()
Uninject the given value (in other words, cancel or undo a previous injection). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InjectedValue()
| Method Detail |
|---|
public T getValue()
throws IllegalStateException
getValue in interface Value<T>IllegalStateException - if the value is time-sensitive and the current state does not allow retrieval.
public void inject(T value)
throws InjectionException
inject in interface Injector<T>value - the value
InjectionException - if the injection failedpublic void uninject()
inject()
has been called.
uninject in interface Injector<T>public T getOptionalValue()
null if it was not.
null if it was not injected
|
JBoss Modular Service Kernel API 1.0.0.Beta4-SNAPSHOT | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||