@ConfigurationDescription(properties={@Property(name="GlobalRegistryUris",type=STRING,isRequired=true,description="A list of URIs that refer to global registries running on the available cluster nodes. At most one of the URIs will be valid at a time."),}) public class RegistryProviderConf extends AbstractADEPT2Service implements GlobalRegistryProvider
GlobalRegistryProvider retrieving a list of possible global
registry URIs from its configuration and trying to get a global registry with
this URIs. That is, you configure a list of all possible global registry URIs
and this global registry provider retrieves one of them. AbstractADEPT2Service.ActiveSessions| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CONF_GLOBAL_REGISTRY_URIS
Configuration key for the URIs of the possible global registries.
|
static java.lang.String |
CONF_TIMEOUT
Configuration key for the time in milliseconds to wait for the requested
URIs.
|
protected java.util.concurrent.ExecutorService |
earlyRequests
The executor service that requests a global registry for a specific URI
while the registry is starting or shutting down.
|
protected java.util.List<java.net.URI> |
globRegUris
The URIs of the possible global registries.
|
protected java.util.concurrent.ExecutorService |
requests
The executor service that requests a global registry for a specific URI
while the registry is active.
|
protected long |
timeout
The time in milliseconds to wait for the service requests.
|
CONF_CSV_LOGGING, configuration, logger, registry, runtimeRequiredServices, startupRequiredServices| Constructor and Description |
|---|
RegistryProviderConf(Configuration conf,
Registry registry)
Creates a new global registry provider retrieving the global registry URIs
from the designated configuration, trying to retrieve a valid global
registry from these when requested.
|
| Modifier and Type | Method and Description |
|---|---|
java.net.URI[] |
getGlobalRegistry(SessionToken session)
Gets the URIs of the current global registry.
|
void |
shutdown(boolean emergency)
This implementation waits 10 seconds in case of an emergency and otherwise indefinitely for the
termination of the active sessions.
|
_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, signalShutdown, signalStart, start, unprivilegeThreadclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLocalUris, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, init, ping, preShutdown, startpublic static final java.lang.String CONF_GLOBAL_REGISTRY_URIS
public static final java.lang.String CONF_TIMEOUT
protected final java.util.List<java.net.URI> globRegUris
protected final java.util.concurrent.ExecutorService requests
protected final java.util.concurrent.ExecutorService earlyRequests
protected final long timeout
public RegistryProviderConf(Configuration conf, Registry registry) throws AbortServiceException
conf - The configuration of this service.registry - The registry of this service.AbortServiceException - If there are no global registry URIs
configured or they are not valid, an
AbortServiceException will be thrown.public void shutdown(boolean emergency)
AbstractADEPT2Serviceshutdown in interface ADEPT2Serviceshutdown in class AbstractADEPT2Serviceemergency - Whether the shutdown will be an emergency shutdown.public java.net.URI[] getGlobalRegistry(SessionToken session) throws ServiceNotKnownException
GlobalRegistryProvidergetGlobalRegistry in interface GlobalRegistryProvidersession - The session which is used to check for access rights on this
method.ServiceNotKnownException - If there is currently no global registry,
a ServiceNotKnownException will be thrown.