Package org.jboss.msc.value
Class InjectedValue<T>
java.lang.Object
org.jboss.msc.value.InjectedValue<T>
- Type Parameters:
T- the value type
Deprecated.
A value which is injected from another source. The value may only be read if the injector has populated it.
- Author:
- David M. Lloyd
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Get the value if it was injected, or returnnullif it was not.Get the value object stored in this injector.getValue()Deprecated.Get the actual dependency value.voidInject the given value.setStoredValue(Value<T> value) Set the value object stored in this injector (must not benull).voidDeprecated.Set the value to be injected to aValueinstance.voiduninject()Uninject the given value (in other words, cancel or undo a previous injection).
-
Constructor Details
-
InjectedValue
public InjectedValue()Deprecated.Construct a new instance.
-
-
Method Details
-
getValue
Deprecated.Get the actual dependency value.- Specified by:
getValuein interfaceValue<T>- Returns:
- the actual dependency value
- Throws:
IllegalStateException- if the value is time-sensitive and the current state does not allow retrieval.
-
setValue
Deprecated.Set the value to be injected to aValueinstance.- Parameters:
value- the value to set, cannot benull
-
getOptionalValue
Deprecated.Get the value if it was injected, or returnnullif it was not.- Returns:
- the value or
nullif it was not injected
-
inject
Inject the given value.- Specified by:
injectin interfaceInjector<T>- Parameters:
value- the value- Throws:
InjectionException- if the injection failed
-
uninject
public void uninject()Uninject the given value (in other words, cancel or undo a previous injection). Only called afterinject()has been called. -
getStoredValue
Get the value object stored in this injector.- Returns:
- the value object
-
setStoredValue
Set the value object stored in this injector (must not benull).- Parameters:
value- the value object (must not benull)- Returns:
- the old value object, or
nullif none was stored
-
ServiceBuilder.requires(org.jboss.msc.service.ServiceName)method instead. This class will be removed in a future release.