-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Endre environment variabel til å bli privat
- Loading branch information
Showing
7 changed files
with
47 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
package no.nav.pdfgen.core | ||
|
||
import io.github.oshai.kotlinlogging.KotlinLogging | ||
import java.util.concurrent.atomic.AtomicReference | ||
|
||
val environment = AtomicReference(Environment()) | ||
private val coreEnvironment = AtomicReference(Environment()) | ||
private val log = KotlinLogging.logger {} | ||
|
||
class PDFGenCore { | ||
companion object { | ||
fun init(initialEnvironment: Environment) { | ||
environment.set(initialEnvironment) | ||
coreEnvironment.set(initialEnvironment) | ||
} | ||
|
||
val environment: Environment get() = coreEnvironment.get() | ||
fun reloadEnvironment() { | ||
environment.set(environment.get().copy()) | ||
log.debug { "Reloading environment" } | ||
coreEnvironment.set(coreEnvironment.get().copy()) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters