001/**
002 *
003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved.
004 *
005 * This library is free software; you can redistribute it and/or
006 * modify it under the terms of the GNU Lesser General Public
007 * License as published by the Free Software Foundation; either 
008 * version 2.1 of the License, or (at your option) any later version.
009 * 
010 * This library is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013 * Lesser General Public License for more details.
014 * 
015 * You should have received a copy of the GNU Lesser General Public 
016 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
017 * 
018 **/
019package lucee.runtime.type.scope;
020
021import lucee.runtime.PageContext;
022import lucee.runtime.type.Struct;
023
024/**
025 * abstract class for all scopes 
026 */
027public interface Scope extends Struct {
028        
029        /**
030         * Scope Undefined
031         */
032        public static final int SCOPE_UNDEFINED=0;
033        /**
034         * Scope Variables
035         */
036        public static final int SCOPE_VARIABLES=1;
037        /**
038         * Scope Request
039         */
040        public static final int SCOPE_REQUEST=2;
041        /**
042         * Scope URL
043         */
044        public static final int SCOPE_URL=3;
045        /**
046         * Scope Form
047         */
048        public static final int SCOPE_FORM=4;
049        /**
050         * Scope Client
051         */
052        public static final int SCOPE_CLIENT=5;
053        /**
054         * Scope Cookie
055         */
056        public static final int SCOPE_COOKIE=6;
057        /**
058         * Scope Session
059         */
060        public static final int SCOPE_SESSION=7;
061        /**
062         * Scope Application
063         */
064        public static final int SCOPE_APPLICATION=8;
065        /**
066         * Scope Arguments
067         */
068        public static final int SCOPE_ARGUMENTS=9;
069        /**
070         * Scope CGI
071         */
072        public static final int SCOPE_CGI=10;   
073        /**
074         * Scope Server
075         */
076        public static final int SCOPE_SERVER=11;
077    
078    /**
079     * Scope Local
080     */
081    public static final int SCOPE_LOCAL=12;
082    
083    /**
084     * Scope Caller
085     */
086    public static final int SCOPE_CALLER=13;
087
088    public static final int SCOPE_CLUSTER=14;
089    
090
091    public static final int SCOPE_VAR=15; 
092    public static final int SCOPE_COUNT=16;
093    
094    
095    
096    
097        /**
098         * return if the scope is Initialiesd
099         * @return scope is init
100         */
101        public boolean isInitalized(); 
102        
103        /**
104         * Initalize Scope
105         * @param pc Page Context
106         */
107        public void initialize(PageContext pc);
108        
109        /**
110         * release scope for reuse
111         * @deprecated use instead <code>release(PageContext)</code>
112         */
113        public void release();
114        
115        /**
116         * release scope for reuse
117         */
118        public void release(PageContext pc);
119        
120    /** 
121     * @return return the scope type (SCOPE_SERVER, SCOPE_SESSION usw.) 
122     */ 
123    public int getType(); 
124    
125    /** 
126     * @return return the scope type as a String (server,session usw.) 
127     */ 
128    public String getTypeAsString(); 
129
130}