Class AbstractDistributedSingletonService<C extends SingletonContext>
- java.lang.Object
-
- org.wildfly.clustering.singleton.server.AbstractDistributedSingletonService<C>
-
- All Implemented Interfaces:
Supplier<C>,org.jboss.msc.Service,org.wildfly.clustering.provider.ServiceProviderRegistration.Listener,Lifecycle,SingletonContext,SingletonService,org.wildfly.clustering.singleton.Singleton,org.wildfly.clustering.singleton.SingletonElectionListener
- Direct Known Subclasses:
DistributedSingletonService,LegacyDistributedSingletonService
public abstract class AbstractDistributedSingletonService<C extends SingletonContext> extends Object implements SingletonService, SingletonContext, org.wildfly.clustering.provider.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<org.wildfly.clustering.group.Node> candidates, org.wildfly.clustering.group.Node elected)org.wildfly.clustering.group.NodegetPrimaryProvider()Set<org.wildfly.clustering.group.Node>getProviders()booleanisPrimary()voidprovidersChanged(Set<org.wildfly.clustering.group.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<org.wildfly.clustering.group.Node> nodes)
- Specified by:
providersChangedin interfaceorg.wildfly.clustering.provider.ServiceProviderRegistration.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<org.wildfly.clustering.group.Node> candidates, org.wildfly.clustering.group.Node elected)
- Specified by:
electedin interfaceorg.wildfly.clustering.singleton.SingletonElectionListener
-
isPrimary
public boolean isPrimary()
- Specified by:
isPrimaryin interfaceorg.wildfly.clustering.singleton.Singleton
-
getPrimaryProvider
public org.wildfly.clustering.group.Node getPrimaryProvider()
- Specified by:
getPrimaryProviderin interfaceorg.wildfly.clustering.singleton.Singleton
-
getProviders
public Set<org.wildfly.clustering.group.Node> getProviders()
- Specified by:
getProvidersin interfaceorg.wildfly.clustering.singleton.Singleton
-
-