Interface SingletonServiceBuilder<T>
- All Superinterfaces:
ServiceBuilder<T>
A service builder for singleton service installation.
- Author:
- Paul Ferraro
-
Method Summary
Modifier and TypeMethodDescriptionaddListener(LifecycleListener listener) Adds a service listener to be added to the service.install()Installs configured service into the container.requireQuorum(int quorum) Defines the minimum number of members required before a singleton election will take place.Sets initial service mode.setInstance(Service service) Sets service instance.Defines a listener to trigger following the election of a primary singleton provider.Defines the policy for electing a primary singleton provider.Methods inherited from interface org.jboss.msc.service.ServiceBuilder
addAliases, addDependency, addMonitor, provides, requires
-
Method Details
-
install
SingletonServiceController<T> install()Description copied from interface:ServiceBuilderInstalls configured service into the container.- Specified by:
installin interfaceServiceBuilder<T>- Returns:
- installed service controller
-
setInitialMode
Description copied from interface:ServiceBuilderSets initial service mode.- Specified by:
setInitialModein interfaceServiceBuilder<T>- Parameters:
mode- initial service mode- Returns:
- this builder
-
setInstance
Description copied from interface:ServiceBuilderSets service instance. IfServiceBuilder.install()method call is issued without this method being called thenNULLservice will be installed into the container.Once this method have been called then all subsequent calls of
ServiceBuilder.requires(ServiceName), andServiceBuilder.provides(ServiceName...)methods will fail because their return values should be provided to service instance.- Specified by:
setInstancein interfaceServiceBuilder<T>- Parameters:
service- the service instance- Returns:
- this configurator
-
addListener
Description copied from interface:ServiceBuilderAdds a service listener to be added to the service.- Specified by:
addListenerin interfaceServiceBuilder<T>- Parameters:
listener- the listener to add to the service- Returns:
- this builder
-
requireQuorum
Defines the minimum number of members required before a singleton election will take place.- Parameters:
quorum- the quorum required for electing a primary singleton provider- Returns:
- a reference to this configurator
-
withElectionPolicy
Defines the policy for electing a primary singleton provider.- Parameters:
policy- an election policy- Returns:
- a reference to this configurator
-
withElectionListener
Defines a listener to trigger following the election of a primary singleton provider.- Parameters:
listener- an election listener- Returns:
- a reference to this configurator
-