Class RegistryProviderDb
java.lang.Object
de.aristaflow.adept2.base.service.AbstractADEPT2Service
de.aristaflow.adept2.base.cluster.RegistryProviderDb
- All Implemented Interfaces:
GlobalRegistryProvider,ADEPT2Service,LogService,ServiceThreadHandling
@ConfigurationDescription(properties={@Property(name="LockTimeout",type=LONG,defaultValue="60000",description="The time (in milliseconds) to wait for a of the cluster synchronisation database. You should use the same value as configured for the cluster service."),})
public class RegistryProviderDb
extends AbstractADEPT2Service
implements GlobalRegistryProvider
A
GlobalRegistryProvider retrieving the global registry URI from
the cluster (synchronisation) JDBC data source.-
Nested Class Summary
Nested classes/interfaces inherited from class de.aristaflow.adept2.base.service.AbstractADEPT2Service
AbstractADEPT2Service.ActiveSessions -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StringThe name of the cluster of which to provide the global registry.static final StringConfiguration key specifying the name of the cluster of which to provide the global registry.static final StringConfiguration key for the lock timeout.protected final longThe time in milliseconds to wait for the table lock before aborting.Fields inherited from class de.aristaflow.adept2.base.service.AbstractADEPT2Service
CONF_CSV_LOGGING, configuration, logger, registry, runtimeRequiredServices, startupRequiredServices -
Constructor Summary
ConstructorsConstructorDescriptionRegistryProviderDb(Configuration conf, Registry registry) Creates a new global registry provider retrieving the global registry URIs from the cluster (synchronisation) JDBC data source. -
Method Summary
Modifier and TypeMethodDescriptionURI[]getGlobalRegistry(SessionToken session) Gets the URIs of the current global registry.Methods inherited from class de.aristaflow.adept2.base.service.AbstractADEPT2Service
_sessionActive, _sessionFinished, activeOrInvalidServiceStateException, changeLogContext, changeLogContext, changeLogContext, consoleLog, csvLoggingEnabled, getClassSpecificJulLogger, getDependencyRegistry, getLocalUris, getLogger, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, getUserCredentials, init, isActive, isSessionActive, isShutdown, logMethodEntry, logMethodEntry, logMethodEntry, logMethodExit, logMethodExit, ping, preShutdown, privilegeSession, privilegeThread, revertLogContextChanges, sessionActive, sessionActive, sessionActive, sessionActive, sessionFinished, sessionFinished, shutdown, signalShutdown, signalStart, start, unprivilegeThreadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.aristaflow.adept2.base.service.ADEPT2Service
getLocalUris, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, init, ping, preShutdown, shutdown, start
-
Field Details
-
CONF_LOCK_TIMEOUT
Configuration key for the lock timeout.- See Also:
-
CONF_CLUSTER_NAME
Configuration key specifying the name of the cluster of which to provide the global registry.- See Also:
-
lockTimeout
protected final long lockTimeoutThe time in milliseconds to wait for the table lock before aborting. -
clusterName
The name of the cluster of which to provide the global registry.
-
-
Constructor Details
-
RegistryProviderDb
Creates a new global registry provider retrieving the global registry URIs from the cluster (synchronisation) JDBC data source.- Parameters:
conf- The configuration of this service.registry- The registry of this service.
-
-
Method Details
-
getGlobalRegistry
Description copied from interface:GlobalRegistryProviderGets the URIs of the current global registry.- Specified by:
getGlobalRegistryin interfaceGlobalRegistryProvider- Parameters:
session- The session which is used to check for access rights on this method.- Returns:
- The URIs of the current global registry.
- Throws:
ServiceNotKnownException- If there is currently no global registry, aServiceNotKnownExceptionwill be thrown.
-