001 package railo.runtime; 002 003 import java.io.IOException; 004 005 import railo.runtime.config.ConfigWeb; 006 import railo.runtime.exp.PageException; 007 008 /** 009 * extends the source file with class features 010 */ 011 public interface PageSource extends SourceFile { 012 013 /** 014 * loads the Page from this PageSource 015 * @param config 016 * @return page Loaded 017 * @throws PageException 018 */ 019 public abstract Page loadPage(ConfigWeb config) throws PageException; 020 021 // FUTURE public abstract Page loadPage(PageContext pc) throws PageException; 022 023 /** 024 * loads the Page from this PageSource 025 * @param config 026 * @param defaultValue 027 * @return Page loaded 028 * @throws PageException 029 */ 030 public abstract Page loadPage(ConfigWeb config, Page defaultValue) throws PageException; 031 // FUTURE public abstract Page loadPage(PageContext pc, Page defaultValue) throws PageException; 032 033 /** 034 * returns the ralpath without the mapping 035 * @return Returns the realpath. 036 */ 037 public abstract String getRealpath(); 038 039 /** 040 * Returns the full name (mapping/realpath). 041 * @return mapping/realpath 042 */ 043 public abstract String getFullRealpath(); 044 045 /** 046 * @return returns the full class name (Example: railo.web.test_cfm) 047 */ 048 public abstract String getClazz(); 049 050 /** 051 * @return return the file name of the source file (test.cfm) 052 */ 053 public abstract String getFileName(); 054 055 /** 056 * @return returns the a classname matching to filename (Example: /railo/web/test_cfm) 057 */ 058 public abstract String getJavaName(); 059 060 /** 061 * @return returns the a package matching to file (Example: railo.web) 062 */ 063 public abstract String getComponentName(); 064 065 /** 066 * @return returns mapping where PageSource based on 067 */ 068 public abstract Mapping getMapping(); 069 070 /** 071 * @return returns if page source exists or not 072 */ 073 public abstract boolean exists(); 074 075 /** 076 * @return returns if the physical part of the source file exists 077 */ 078 public abstract boolean physcalExists(); 079 080 /** 081 * @return return the sozrce of the file as String array 082 * @throws IOException 083 */ 084 public abstract String[] getSource() throws IOException; 085 086 /** 087 * get an new Pagesoure from ralpath 088 * @param realPath 089 * @return new Pagesource 090 */ 091 public abstract PageSource getRealPage(String realPath); 092 093 /** 094 * sets time last accessed page 095 * @param lastAccess time ast accessed 096 */ 097 public abstract void setLastAccessTime(long lastAccess); 098 099 /** 100 * 101 * @return returns time last accessed page 102 */ 103 public abstract long getLastAccessTime(); 104 105 /** 106 * set time last accessed (now) 107 */ 108 public abstract void setLastAccessTime(); 109 110 /** 111 * @return returns how many this page is accessed since server is in use. 112 */ 113 public abstract int getAccessCount(); 114 115 }