Package org.jboss.msc.service
Class ValueInjectionService<T>
- java.lang.Object
-
- org.jboss.msc.service.ValueInjectionService<T>
-
-
Field Summary
Fields Modifier and Type Field Description private InjectedValue<T>
injector
-
Fields inherited from interface org.jboss.msc.service.Service
NULL, NULL_VALUE
-
-
Constructor Summary
Constructors Constructor Description ValueInjectionService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Injector<T>
getInjector()
Get the injector, which should be used to inject the dependency.T
getValue()
Get the actual value.void
start(StartContext context)
Start the service.void
stop(StopContext context)
Stop the service.
-
-
-
Field Detail
-
injector
private final InjectedValue<T> injector
-
-
Method Detail
-
start
public void start(StartContext context) throws StartException
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.- Specified by:
start
in interfaceService<T>
- Parameters:
context
- the context which can be used to trigger an asynchronous service start- Throws:
StartException
- if the service could not be started for some reason
-
stop
public void stop(StopContext context)
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 java.lang.IllegalStateException, java.lang.IllegalArgumentException
Get the actual value.
-
-