Package org.jboss.msc.value
Class InjectedValue<T>
- java.lang.Object
-
- org.jboss.msc.value.InjectedValue<T>
-
- Type Parameters:
T- the value type
@Deprecated public final class InjectedValue<T> extends Object implements Injector<T>, Value<T>
Deprecated.UseServiceBuilder.requires(org.jboss.msc.service.ServiceName)method instead. This class will be removed in a future release.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 Constructor Description InjectedValue()Deprecated.Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description TgetOptionalValue()Deprecated.Get the value if it was injected, or returnnullif it was not.protected Value<T>getStoredValue()Get the value object stored in this injector.TgetValue()Deprecated.Get the actual dependency value.voidinject(T value)Inject the given value.protected Value<T>setStoredValue(Value<T> value)Set the value object stored in this injector (must not benull).voidsetValue(Value<T> value)Deprecated.Set the value to be injected to aValueinstance.voiduninject()Uninject the given value (in other words, cancel or undo a previous injection).
-
-
-
Method Detail
-
getValue
public T getValue() throws IllegalStateException
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
public void setValue(Value<T> value)
Deprecated.Set the value to be injected to aValueinstance.- Parameters:
value- the value to set, cannot benull
-
getOptionalValue
public T getOptionalValue()
Deprecated.Get the value if it was injected, or returnnullif it was not.- Returns:
- the value or
nullif it was not injected
-
inject
public void inject(T value) throws InjectionExceptionInject 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
protected Value<T> getStoredValue()
Get the value object stored in this injector.- Returns:
- the value object
-
-