Class AbstractDistributedSingletonService<C extends SingletonContext>
- java.lang.Object
-
- org.wildfly.clustering.singleton.server.AbstractDistributedSingletonService<C>
-
- All Implemented Interfaces:
Supplier<C>,org.jboss.msc.Service,ServiceProviderRegistration.Listener,Lifecycle,SingletonContext,SingletonService,Singleton,SingletonElectionListener
- Direct Known Subclasses:
DistributedSingletonService,LegacyDistributedSingletonService
public abstract class AbstractDistributedSingletonService<C extends SingletonContext> extends Object implements SingletonService, SingletonContext, ServiceProviderRegistration.Listener, Supplier<C>
Logic common to current and legacySingletonServiceimplementations.- Author:
- Paul Ferraro
-
-
Constructor Summary
Constructors Constructor Description AbstractDistributedSingletonService(DistributedSingletonServiceContext context, Function<org.jboss.msc.service.ServiceTarget,Lifecycle> primaryLifecycleFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidelected(List<Node> candidates, Node elected)NodegetPrimaryProvider()Set<Node>getProviders()booleanisPrimary()voidprovidersChanged(Set<Node> nodes)voidstart()Start this object.voidstart(org.jboss.msc.service.StartContext context)voidstop()Stop this object.voidstop(org.jboss.msc.service.StopContext context)
-
-
-
Constructor Detail
-
AbstractDistributedSingletonService
public AbstractDistributedSingletonService(DistributedSingletonServiceContext context, Function<org.jboss.msc.service.ServiceTarget,Lifecycle> primaryLifecycleFactory)
-
-
Method Detail
-
start
public void start(org.jboss.msc.service.StartContext context) throws org.jboss.msc.service.StartException- Specified by:
startin interfaceorg.jboss.msc.Service- Throws:
org.jboss.msc.service.StartException
-
stop
public void stop(org.jboss.msc.service.StopContext context)
- Specified by:
stopin interfaceorg.jboss.msc.Service
-
providersChanged
public void providersChanged(Set<Node> nodes)
- Specified by:
providersChangedin interfaceServiceProviderRegistration.Listener
-
start
public void start()
Description copied from interface:LifecycleStart this object.
-
stop
public void stop()
Description copied from interface:LifecycleStop this object.
-
elected
public void elected(List<Node> candidates, Node elected)
- Specified by:
electedin interfaceSingletonElectionListener
-
getPrimaryProvider
public Node getPrimaryProvider()
- Specified by:
getPrimaryProviderin interfaceSingleton
-
getProviders
public Set<Node> getProviders()
- Specified by:
getProvidersin interfaceSingleton
-
-