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
AGlobalRegistryProviderretrieving 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
Fields Modifier and Type Field Description protected StringclusterNameThe name of the cluster of which to provide the global registry.static StringCONF_CLUSTER_NAMEConfiguration key specifying the name of the cluster of which to provide the global registry.static StringCONF_LOCK_TIMEOUTConfiguration key for the lock timeout.protected longlockTimeoutThe 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
Constructors Constructor Description RegistryProviderDb(org.apache.commons.configuration2.Configuration conf, Registry registry)Creates a new global registry provider retrieving the global registry URIs from the cluster (synchronisation) JDBC data source.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description URI[]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, unprivilegeThread
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.aristaflow.adept2.base.service.ADEPT2Service
getLocalUris, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, init, ping, preShutdown, shutdown, start
-
-
-
-
Field Detail
-
CONF_LOCK_TIMEOUT
public static final String CONF_LOCK_TIMEOUT
Configuration key for the lock timeout.- See Also:
- Constant Field Values
-
CONF_CLUSTER_NAME
public static final String CONF_CLUSTER_NAME
Configuration key specifying the name of the cluster of which to provide the global registry.- See Also:
- Constant Field Values
-
lockTimeout
protected final long lockTimeout
The time in milliseconds to wait for the table lock before aborting.
-
clusterName
protected final String clusterName
The name of the cluster of which to provide the global registry.
-
-
Constructor Detail
-
RegistryProviderDb
public RegistryProviderDb(org.apache.commons.configuration2.Configuration conf, Registry registry)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 Detail
-
getGlobalRegistry
public URI[] getGlobalRegistry(SessionToken session) throws ServiceNotKnownException
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.
-
-