railo.runtime
Class PageSourceImpl

java.lang.Object
  extended by railo.runtime.PageSourceImpl
All Implemented Interfaces:
Serializable, PageSource, SourceFile, Sizeable

public final class PageSourceImpl
extends Object
implements SourceFile, PageSource, Sizeable

represent a cfml file on the runtime system

See Also:
Serialized Form

Field Summary
static byte LOAD_ARCHIVE
           
static byte LOAD_PHYSICAL
           
 
Method Summary
 String _getFullClassName()
           
static PageSource best(PageSource[] arr)
           
 void clear()
           
 void clear(ClassLoader cl)
          clear page, but only when page use the same clasloader as provided
 boolean equals(Object obj)
           
 boolean equals(PageSource other)
          is given object equal to this
 boolean exists()
           
 int getAccessCount()
           
 Resource getArchiveFile()
           
 String getClassName()
           
 String getClazz()
           
 String getComponentName()
           
 String getDisplayPath()
          return source path as String
 String getFileName()
           
 String getFullClassName()
           
 String getFullRealpath()
          Returns the full name (mapping/realpath).
 String getJavaName()
           
 long getLastAccessTime()
           
 Mapping getMapping()
           
 String getPackageName()
           
 Page getPage()
          return page when already loaded, otherwise null
 PageSource getParent()
           
 Resource getPhyscalFile()
          return file object, based on physical path and realpath
 PageSource getRealPage(String realPath)
          get an new Pagesoure from ralpath
 String getRealpath()
          returns the ralpath without the mapping
 String getRealPathAsVariableString()
           
 Resource getResource()
          if the mapping physical path and archive is invalid or not defined, it is possible this method returns null
 Resource getResourceTranslated(PageContext pc)
          if the pageSource is based on a archive, translate the source to a zip:// Resource
 String[] getSource()
           
 boolean isComponent()
           
 boolean isLoad()
           
 Page loadPage(ConfigWeb config)
          loads the Page from this PageSource
 Page loadPage(ConfigWeb config, Page defaultValue)
          loads the Page from this PageSource
 Page loadPage(PageContext pc)
           
 Page loadPage(PageContext pc, boolean forceReload)
           
 Page loadPage(PageContext pc, Page defaultValue)
           
static Page loadPage(PageContext pc, PageSource[] arr)
           
static Page loadPage(PageContext pc, PageSource[] arr, Page defaultValue)
           
static boolean pageExist(PageSource ps)
           
 boolean physcalExists()
           
 void setLastAccessTime()
          set time last accessed (now)
 void setLastAccessTime(long lastAccess)
          sets time last accessed page
 long sizeOf()
          return the size of the object
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOAD_ARCHIVE

public static final byte LOAD_ARCHIVE
See Also:
Constant Field Values

LOAD_PHYSICAL

public static final byte LOAD_PHYSICAL
See Also:
Constant Field Values
Method Detail

getPage

public Page getPage()
return page when already loaded, otherwise null

Parameters:
pc -
config -
Returns:
Throws:
PageException

getParent

public PageSource getParent()

loadPage

public Page loadPage(ConfigWeb config)
              throws PageException
Description copied from interface: PageSource
loads the Page from this PageSource

Specified by:
loadPage in interface PageSource
Returns:
page Loaded
Throws:
PageException

loadPage

public Page loadPage(ConfigWeb config,
                     Page defaultValue)
              throws PageException
Description copied from interface: PageSource
loads the Page from this PageSource

Specified by:
loadPage in interface PageSource
Returns:
Page loaded
Throws:
PageException

loadPage

public Page loadPage(PageContext pc,
                     boolean forceReload)
              throws PageException
Throws:
PageException

loadPage

public Page loadPage(PageContext pc)
              throws PageException
Specified by:
loadPage in interface PageSource
Throws:
PageException

loadPage

public Page loadPage(PageContext pc,
                     Page defaultValue)
              throws PageException
Specified by:
loadPage in interface PageSource
Throws:
PageException

getDisplayPath

public String getDisplayPath()
return source path as String

Specified by:
getDisplayPath in interface SourceFile
Returns:
source path as String

isComponent

public boolean isComponent()

getPhyscalFile

public Resource getPhyscalFile()
return file object, based on physical path and realpath

Specified by:
getPhyscalFile in interface SourceFile
Returns:
file Object

getArchiveFile

public Resource getArchiveFile()

getRealpath

public String getRealpath()
Description copied from interface: PageSource
returns the ralpath without the mapping

Specified by:
getRealpath in interface PageSource
Returns:
Returns the realpath.

getFullRealpath

public String getFullRealpath()
Description copied from interface: PageSource
Returns the full name (mapping/realpath).

Specified by:
getFullRealpath in interface PageSource
Returns:
mapping/realpath

getRealPathAsVariableString

public String getRealPathAsVariableString()
Specified by:
getRealPathAsVariableString in interface SourceFile
Returns:
returns a variable string based on realpath and return it

getClazz

public String getClazz()
Specified by:
getClazz in interface PageSource
Returns:
returns the full class name (Example: railo.web.test_cfm)

getClassName

public String getClassName()
Specified by:
getClassName in interface SourceFile
Returns:
returns the a classname matching to filename (Example: test_cfm)

getFileName

public String getFileName()
Specified by:
getFileName in interface PageSource
Returns:
return the file name of the source file (test.cfm)

getJavaName

public String getJavaName()
Specified by:
getJavaName in interface PageSource
Returns:
returns the a classname matching to filename (Example: /railo/web/test_cfm)

getPackageName

public String getPackageName()
Specified by:
getPackageName in interface SourceFile
Returns:
returns the a package matching to file (Example: railo.web)

getComponentName

public String getComponentName()
Specified by:
getComponentName in interface PageSource
Returns:
returns the a package matching to file (Example: railo.web)

getMapping

public Mapping getMapping()
Specified by:
getMapping in interface PageSource
Returns:
returns mapping where PageSource based on

exists

public boolean exists()
Specified by:
exists in interface PageSource
Returns:
returns if page source exists or not

physcalExists

public boolean physcalExists()
Specified by:
physcalExists in interface PageSource
Returns:
returns if the physical part of the source file exists

getSource

public String[] getSource()
                   throws IOException
Specified by:
getSource in interface PageSource
Returns:
return the sozrce of the file as String array
Throws:
IOException

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

equals

public boolean equals(PageSource other)
is given object equal to this

Parameters:
other -
Returns:
is same

getRealPage

public PageSource getRealPage(String realPath)
Description copied from interface: PageSource
get an new Pagesoure from ralpath

Specified by:
getRealPage in interface PageSource
Returns:
new Pagesource

setLastAccessTime

public final void setLastAccessTime(long lastAccess)
Description copied from interface: PageSource
sets time last accessed page

Specified by:
setLastAccessTime in interface PageSource
Parameters:
lastAccess - time ast accessed

getLastAccessTime

public final long getLastAccessTime()
Specified by:
getLastAccessTime in interface PageSource
Returns:
returns time last accessed page

setLastAccessTime

public final void setLastAccessTime()
Description copied from interface: PageSource
set time last accessed (now)

Specified by:
setLastAccessTime in interface PageSource

getAccessCount

public final int getAccessCount()
Specified by:
getAccessCount in interface PageSource
Returns:
returns how many this page is accessed since server is in use.

getResource

public Resource getResource()
Description copied from interface: SourceFile
if the mapping physical path and archive is invalid or not defined, it is possible this method returns null

Specified by:
getResource in interface PageSource
Specified by:
getResource in interface SourceFile
Returns:
base Resource

getResourceTranslated

public Resource getResourceTranslated(PageContext pc)
                               throws ExpressionException
Description copied from interface: PageSource
if the pageSource is based on a archive, translate the source to a zip:// Resource

Specified by:
getResourceTranslated in interface PageSource
Parameters:
pc - the Page Context Object
Returns:
return the Resource matching this PageSource
Throws:
ExpressionException

clear

public void clear()

clear

public void clear(ClassLoader cl)
clear page, but only when page use the same clasloader as provided

Parameters:
cl -

getFullClassName

public String getFullClassName()
Specified by:
getFullClassName in interface SourceFile
Returns:
returns the full classname (package and name) matching to filename (Example: my.package.test_cfm)

_getFullClassName

public String _getFullClassName()

isLoad

public boolean isLoad()

toString

public String toString()
Overrides:
toString in class Object

sizeOf

public long sizeOf()
Description copied from interface: Sizeable
return the size of the object

Specified by:
sizeOf in interface Sizeable
Returns:
size of the object

best

public static PageSource best(PageSource[] arr)

pageExist

public static boolean pageExist(PageSource ps)

loadPage

public static Page loadPage(PageContext pc,
                            PageSource[] arr,
                            Page defaultValue)
                     throws PageException
Throws:
PageException

loadPage

public static Page loadPage(PageContext pc,
                            PageSource[] arr)
                     throws PageException
Throws:
PageException


Copyright © 2012 Railo