@ConfigurationDescription(properties={@Property(name="ServiceAuthUserName",defaultValue="${arflow:confVar.SystemUserName}",description="The user name with which this service authenticates at the global security manager."),,,}) public abstract class AbstractNonPrivilegedService extends AbstractADEPT2Service
ClientSessionFactory. This can only be used for services that are created after the
global security manager is available.AbstractADEPT2Service.ActiveSessionsCONF_CSV_LOGGING, configuration, logger, registry, runtimeRequiredServices, startupRequiredServices| Modifier | Constructor and Description |
|---|---|
protected |
AbstractNonPrivilegedService(Configuration conf,
Registry registry,
java.lang.Class<?> cls)
Creates an ADEPT2 service with the designated registry, a logger for this
and assuming that there are no other services required.
|
protected |
AbstractNonPrivilegedService(Configuration conf,
Registry registry,
java.lang.String[] startupRequiredServices,
java.lang.String[] runtimeRequiredServices,
java.lang.Class<?> cls)
Creates an ADEPT2 service with the designated registry, a logger for this
and the designated required services.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
authenticateService()
(Re-)Authenticates this service using the security manager provided by
getSecurityManager(). |
protected void |
awaitActiveSessions(boolean emergency)
Awaits the termination of active sessions.
|
protected SessionToken |
createSession()
Creates a new session token using the client session factory assigned to
this service.
|
protected SecurityManager |
getSecurityManager()
Returns the security manager that will be used for authentication.
|
protected ClientSessionFactory |
getSessionFactory()
Returns the client session factory assigned to this service.
|
void |
init(java.net.URI[] localExportedUris,
java.net.URI[] globalExportedUris)
Copies the designated URI array and stores it internally and authenticates
to the system and sets the session factory.
|
void |
shutdown(boolean emergency)
Awaits the termination of the active sessions and nulls the session factory.
|
protected void |
simpleInit(java.net.URI[] localExportedUris,
java.net.URI[] globalExportedUris)
Initialises this service but does not explicitly authenticate.
|
_sessionActive, _sessionFinished, activeOrInvalidServiceStateException, changeLogContext, changeLogContext, changeLogContext, consoleLog, csvLoggingEnabled, getClassSpecificJulLogger, getDependencyRegistry, getLocalUris, getLogger, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, getUserCredentials, isActive, isSessionActive, isShutdown, logMethodEntry, logMethodEntry, logMethodEntry, logMethodExit, logMethodExit, ping, preShutdown, privilegeSession, privilegeThread, revertLogContextChanges, sessionActive, sessionActive, sessionActive, sessionActive, sessionFinished, sessionFinished, signalShutdown, signalStart, start, unprivilegeThreadprotected AbstractNonPrivilegedService(Configuration conf, Registry registry, java.lang.Class<?> cls) throws ConfigurationException
conf - The configuration providing the logon credentials for this service.registry - The registry to be used for accessing services by this
service. This is provided as parameter to the constructor when
creating a service.cls - The class specifying the name of the logger of this service.ConfigurationException - If the password for this authenticated
service cannot be parsed from the configuration, a
ConfigurationException will be thrown.protected AbstractNonPrivilegedService(Configuration conf, Registry registry, java.lang.String[] startupRequiredServices, java.lang.String[] runtimeRequiredServices, java.lang.Class<?> cls) throws ConfigurationException
conf - The configuration providing the logon credentials for this service.registry - The registry to be used for accessing services by this
service. This is provided as parameter to the constructor when
creating a service.startupRequiredServices - The service type names of services required
at startup time (in init(URI[], URI[]) and AbstractADEPT2Service.start()).runtimeRequiredServices - The service type names of services required
at runtime (after startup time).cls - The class specifying the name of the logger of this service.ConfigurationException - If the password for this authenticated
service cannot be parsed from the configuration, a
ConfigurationException will be thrown.public void init(java.net.URI[] localExportedUris,
java.net.URI[] globalExportedUris)
throws AbortServiceException
init in interface ADEPT2Serviceinit in class AbstractADEPT2ServicelocalExportedUris - The URIs with which this service is exported
locally or a local URI or an empty array for internal services.globalExportedUris - The URIs with which this service is published
globally or null in case the service is not
published.AbortServiceException - If authenticating at the security manager
fails, an AbortServiceException will be thrown.protected void simpleInit(java.net.URI[] localExportedUris,
java.net.URI[] globalExportedUris)
throws AbortServiceException
localExportedUris - The URIs with which this service is exported
locally or a local URI or an empty array for internal services.globalExportedUris - The URIs with which this service is published
globally or null in case the service is not
published.AbortServiceException - If the initialisation of the superclass
fails, an AbortServiceException will be thrown.protected SecurityManager getSecurityManager()
protected void authenticateService()
throws AuthenticationException,
AbortServiceException
getSecurityManager().AuthenticationException - If the provided credentials are incorrect, an
AuthenticationException will be thrown.AbortServiceException - If the authentication at the security manager fails an
AbortServiceException will be thrown.ConfigurationException - If the password cannot be parsed, a
ConfigurationException will be thrown.protected ClientSessionFactory getSessionFactory()
protected SessionToken createSession()
protected void awaitActiveSessions(boolean emergency)
emergency - Whether the active sessions should only be awaited for a
specific time.public void shutdown(boolean emergency)
shutdown in interface ADEPT2Serviceshutdown in class AbstractADEPT2Serviceemergency - Whether the shutdown will be an emergency shutdown.