Package org.wildfly.service
Class Installer.AbstractUnaryBuilder<B,I extends Installer<ST>,ST extends org.jboss.msc.service.ServiceTarget,SB extends DSB,DSB extends org.jboss.msc.service.ServiceBuilder<?>,T,V>
- java.lang.Object
-
- org.wildfly.service.Installer.AbstractBuilder<B,I,ST,SB,DSB>
-
- org.wildfly.service.Installer.AbstractUnaryBuilder<B,I,ST,SB,DSB,T,V>
-
- All Implemented Interfaces:
Function<SB,org.jboss.msc.Service>,Installer.Builder<B,I,ST,DSB>,Installer.Configuration<SB,DSB>,Installer.UnaryBuilder<B,I,ST,DSB,T,V>
- Direct Known Subclasses:
ServiceInstaller.DefaultUnaryBuilder
public abstract static class Installer.AbstractUnaryBuilder<B,I extends Installer<ST>,ST extends org.jboss.msc.service.ServiceTarget,SB extends DSB,DSB extends org.jboss.msc.service.ServiceBuilder<?>,T,V> extends Installer.AbstractBuilder<B,I,ST,SB,DSB> implements Installer.UnaryBuilder<B,I,ST,DSB,T,V>, Function<SB,org.jboss.msc.Service>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractUnaryBuilder(Function<T,V> mapper, Supplier<T> factory)protectedAbstractUnaryBuilder(Function<T,V> mapper, Supplier<T> factory, BiFunction<SB,Collection<org.jboss.msc.service.ServiceName>,Consumer<V>> provider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.jboss.msc.Serviceapply(SB builder)Function<SB,org.jboss.msc.Service>getServiceFactory()Returns the factory of this serviceprotected booleanhasStopTask()BonStart(Consumer<T> task)Configures a task to run onService.start(org.jboss.msc.service.StartContext).BonStop(Consumer<T> task)Configures a task to run onService.stop(org.jboss.msc.service.StopContext).Bprovides(org.jboss.msc.service.ServiceName name)Configures a service name provided by this service.BwithCaptor(Consumer<V> captor)Configures a captor invoked with the service value onService.start(org.jboss.msc.service.StartContext), and with null onService.stop(StopContext).-
Methods inherited from class org.wildfly.service.Installer.AbstractBuilder
asActive, asPassive, builder, getDependency, getInitialMode, requires
-
-
-
-
Method Detail
-
provides
public B provides(org.jboss.msc.service.ServiceName name)
Description copied from interface:Installer.UnaryBuilderConfigures a service name provided by this service.
-
withCaptor
public B withCaptor(Consumer<V> captor)
Description copied from interface:Installer.UnaryBuilderConfigures a captor invoked with the service value onService.start(org.jboss.msc.service.StartContext), and with null onService.stop(StopContext).- Specified by:
withCaptorin interfaceInstaller.UnaryBuilder<B,I extends Installer<ST>,ST extends org.jboss.msc.service.ServiceTarget,SB extends DSB,DSB extends org.jboss.msc.service.ServiceBuilder<?>,T>- Parameters:
captor- a consumer of the service value on start, and null on stop.- Returns:
- a reference to this builder
-
onStart
public B onStart(Consumer<T> task)
Description copied from interface:Installer.UnaryBuilderConfigures a task to run onService.start(org.jboss.msc.service.StartContext).- Specified by:
onStartin interfaceInstaller.UnaryBuilder<B,I extends Installer<ST>,ST extends org.jboss.msc.service.ServiceTarget,SB extends DSB,DSB extends org.jboss.msc.service.ServiceBuilder<?>,T>- Parameters:
task- a task consuming the service value source- Returns:
- a reference to this builder
-
onStop
public B onStop(Consumer<T> task)
Description copied from interface:Installer.UnaryBuilderConfigures a task to run onService.stop(org.jboss.msc.service.StopContext).- Specified by:
onStopin interfaceInstaller.UnaryBuilder<B,I extends Installer<ST>,ST extends org.jboss.msc.service.ServiceTarget,SB extends DSB,DSB extends org.jboss.msc.service.ServiceBuilder<?>,T>- Parameters:
task- a task consuming the service value source- Returns:
- a reference to this builder
-
getServiceFactory
public Function<SB,org.jboss.msc.Service> getServiceFactory()
Description copied from interface:Installer.ConfigurationReturns the factory of this service- Specified by:
getServiceFactoryin interfaceInstaller.Configuration<B,I extends Installer<ST>>- Returns:
- a service factory
-
apply
public org.jboss.msc.Service apply(SB builder)
-
hasStopTask
protected boolean hasStopTask()
-
-