forked from lucee/Lucee
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve OSGi bundle loading (reduce file access)
- Loading branch information
1 parent
63b74fe
commit a357a91
Showing
3 changed files
with
57 additions
and
7 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
37 changes: 37 additions & 0 deletions
37
core/src/main/java/lucee/runtime/engine/ThreadLocalConfigServer.java
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package lucee.runtime.engine; | ||
|
||
import lucee.runtime.config.ConfigServer; | ||
|
||
/** | ||
* class to handle thread local PageContext, do use pagecontext in classes that have no method | ||
* argument pagecontext | ||
*/ | ||
public final class ThreadLocalConfigServer { | ||
|
||
private static ThreadLocal<ConfigServer> cThreadLocal = new ThreadLocal<ConfigServer>(); | ||
|
||
/** | ||
* register a Config for he current thread | ||
* | ||
* @param config Config to register | ||
*/ | ||
public static void register(ConfigServer config) {// DO NOT CHANGE, used in Ortus extension via reflection | ||
cThreadLocal.set(config); | ||
} | ||
|
||
/** | ||
* returns Config registered for the current thread | ||
* | ||
* @return Config for the current thread or null | ||
*/ | ||
public static ConfigServer get() { | ||
return cThreadLocal.get(); | ||
} | ||
|
||
/** | ||
* release the pagecontext for the current thread | ||
*/ | ||
public static void release() {// DO NOT CHANGE, used in Ortus extension via reflection | ||
cThreadLocal.set(null); | ||
} | ||
} |
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