Package org.jboss.msc.service
Class ValueInjectionService<T>
- java.lang.Object
-
- org.jboss.msc.service.ValueInjectionService<T>
-
- Type Parameters:
T
- the service type
@Deprecated public final class ValueInjectionService<T> extends Object implements Service<T>
Deprecated.UseService.newInstance(Consumer<T>,T
instead. This class will be removed in a future release.A service which propagates a value from a dependency.- Author:
- David M. Lloyd
-
-
Field Summary
-
Fields inherited from interface org.jboss.msc.service.Service
NULL, NULL_VALUE
-
-
Constructor Summary
Constructors Constructor Description ValueInjectionService()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Injector<T>
getInjector()
Deprecated.Get the injector, which should be used to inject the dependency.T
getValue()
Deprecated.Get the actual dependency value.void
start(StartContext context)
Deprecated.Start the service.void
stop(StopContext context)
Deprecated.Stop the service.
-
-
-
Method Detail
-
start
public void start(StartContext context)
Deprecated.Start the service. Do not return until the service has been fully started, unless an asynchronous service start is performed. All injections will be complete before this method is called.If the service start involves any activities that may block, the asynchronous mechanism provided by the
context
should be used. See theclass javadoc
for details.
-
stop
public void stop(StopContext context)
Deprecated.Stop the service. Do not return until the service has been fully stopped, unless an asynchronous service stop is performed. All injections will remain intact until the service is fully stopped. This method should not throw an exception.If the service start involves any activities that may block, the asynchronous mechanism provided by the
context
should be used. See theclass javadoc
for details.
-
getValue
public T getValue() throws IllegalStateException, IllegalArgumentException
Deprecated.Get the actual dependency value.- Specified by:
getValue
in interfaceValue<T>
- Returns:
- the actual dependency value
- Throws:
IllegalStateException
- if the value is time-sensitive and the current state does not allow retrieval.IllegalArgumentException
- when the value cannot be read due to misconfiguration
-
-