001    package railo.runtime.engine;
002    
003    import railo.runtime.PageSource;
004    
005    /**
006     * this class is just used to make the pagesource availble for old code in ra files
007     */
008    public final class ThreadLocalPageSource {
009    
010            private static ThreadLocal<PageSource> local=new ThreadLocal<PageSource>();
011    
012            /**
013             * register a Config for he current thread
014             * @param config Config to register
015             */
016            public static void register(PageSource ps) {
017                    local.set(ps);
018            }
019    
020            /**
021             * returns Config registered for the current thread
022             * @return Config for the current thread or null 
023             */
024            public static PageSource get() {
025                    return local.get();
026            }
027            
028            /**
029             * release the pagecontext for the current thread
030             */
031            public static void release() {
032                    local.set(null);
033            }
034    }