6.1.1.3.2.2. linotp.lib.app_globals module

The application’s Globals object

class linotp.lib.app_globals.Globals[source]

Bases: object

Globals acts as a container for objects available throughout the life of the application

delConfig(conf)[source]

delete one entry in the appl_globals

getConfig()[source]

retrieve (the deep copy of) the actual config

getLock()[source]
getResolverClasses()[source]
getResolverTypes()[source]
getTokenclasses()[source]
getTokenprefixes()[source]
isConfigComplet()[source]
releaseConfigLock()[source]
setConfig(config, replace=False)[source]

set the app global config for linotp

setConfigIncomplete(val=False)[source]

set the app global config for linotp

setConfigReadLock()[source]
setConfigWriteLock()[source]
setResolverClasses(resolver_clazzes=None)[source]

setter to hold the reference to all resolver class objects

setResolverTypes(resolver_types=None)[source]

setter to hold the reference to all resolver class names

setTokenclasses(tcl)[source]
setTokenprefixes(tpl)[source]
class linotp.lib.app_globals.RWLock[source]

A simple reader-writer lock Several readers can hold the lock simultaneously, XOR one writer. Write locks have priority over reads to prevent write starvation.

acquire_read()[source]

Acquire a read lock. Several threads can hold this typeof lock. It is exclusive with write locks.

acquire_write()[source]

Acquire a write lock. Only one thread can hold this lock, and only when no read locks are also held.

demote()[source]

Demote an already-acquired write lock to a read lock

promote()[source]

Promote an already-acquired read lock to a write lock WARNING: it is very easy to deadlock with this method

release()[source]

Release a lock, whether read or write.