JSPTemplates

org.tp23.jasper.runtime
Class ObjectContainerContextImpl

java.lang.Object
  |
  +--org.tp23.jasper.runtime.ObjectContainerContextImpl
All Implemented Interfaces:
ObjectContainerContext

public class ObjectContainerContextImpl
extends java.lang.Object
implements ObjectContainerContext

This Is a context for the Server. It provides access to any properties that are places in the myjapser.properties file that is stored IN the main JAR file. This will by default hold the following properties

  • myjasper.jsp.dir - the jsps location
  • myjasper.config.dir - the location of the configurations for the jsps (usually the same as the jsps location)
  • myjasper.class.dir - the location of generated .java and .class files This context will return the ObjectConfig for any uri passed inif one exists there is now notion of webapps or of cross context security.

    Author:
    Paul Hinds

    Fields inherited from interface org.tp23.jsp.ObjectContainerContext
    CLASS_DIR, CLASSPATH, CONFIG_CACHE, CONFIG_DIR, JSP_DIR
     
    Constructor Summary
    ObjectContainerContextImpl(ObjectJspFactory factory, Engine myJasper)
              Constructor for the ObjectContainerContextImpl object
    ObjectContainerContextImpl(ObjectJspFactory factory, Engine myJasper, java.util.Properties configuration)
               
     
    Method Summary
     java.lang.Object getAttribute(java.lang.String name)
              Gets the attribute from the configuration
     java.util.Enumeration getAttributeNames()
              Gets the attributeNames attribute of the ObjectContainerContextImpl object
     ObjectConfig getConfig(java.lang.String uri)
              Gets a Config object for a given JSP.
     Engine getContainer()
               
     int getMajorVersion()
              Gets the majorVersion attribute of the ObjectContainerContextImpl object
     java.lang.String getMimeType(java.lang.String file)
              Gets the mimeType attribute of the ObjectContainerContextImpl object
     int getMinorVersion()
              Gets the minorVersion attribute of the ObjectContainerContextImpl object
     java.lang.String getRealPath(java.lang.String path)
              Gets the realPath attribute of the ObjectContainerContext object
     java.net.URL getResource(java.lang.String path)
              Gets a net resource (not implemented)
     java.io.InputStream getResourceAsStream(java.lang.String path)
              Not implemented yet will eventually return any resource in the JSP directory
     java.lang.String getServerInfo()
              Gets a string describing the server
     void log(java.lang.String msg)
              Dump to System.out
     void log(java.lang.String message, java.lang.Throwable throwable)
              Dump to System.out
     void removeAttribute(java.lang.String name)
              removes an attribute (this will effect all JSP's in the MyJasper object)
     void setAttribute(java.lang.String name, java.lang.Object object)
              Sets the attribute into the configuration
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    ObjectContainerContextImpl

    public ObjectContainerContextImpl(ObjectJspFactory factory,
                                      Engine myJasper)
    Constructor for the ObjectContainerContextImpl object
    Parameters:
    factory - Description of Parameter

    ObjectContainerContextImpl

    public ObjectContainerContextImpl(ObjectJspFactory factory,
                                      Engine myJasper,
                                      java.util.Properties configuration)
    Method Detail

    getContainer

    public Engine getContainer()
    Specified by:
    getContainer in interface ObjectContainerContext

    setAttribute

    public void setAttribute(java.lang.String name,
                             java.lang.Object object)
    Sets the attribute into the configuration
    Specified by:
    setAttribute in interface ObjectContainerContext
    Parameters:
    name - The new attribute value
    object - The new attribute value

    getConfig

    public ObjectConfig getConfig(java.lang.String uri)
    Gets a Config object for a given JSP. loaded files are cached by default set myjasper.config.cache=false for no caching
    Specified by:
    getConfig in interface ObjectContainerContext
    Parameters:
    uri - Description of Parameter
    Returns:
    The config value

    getAttribute

    public java.lang.Object getAttribute(java.lang.String name)
    Gets the attribute from the configuration
    Specified by:
    getAttribute in interface ObjectContainerContext
    Parameters:
    name - the name of the attribute
    Returns:
    The attribute value

    getAttributeNames

    public java.util.Enumeration getAttributeNames()
    Gets the attributeNames attribute of the ObjectContainerContextImpl object
    Specified by:
    getAttributeNames in interface ObjectContainerContext
    Returns:
    The attributeNames value

    getMajorVersion

    public int getMajorVersion()
    Gets the majorVersion attribute of the ObjectContainerContextImpl object
    Specified by:
    getMajorVersion in interface ObjectContainerContext
    Returns:
    The majorVersion value

    getMimeType

    public java.lang.String getMimeType(java.lang.String file)
    Gets the mimeType attribute of the ObjectContainerContextImpl object
    Specified by:
    getMimeType in interface ObjectContainerContext
    Parameters:
    file - Description of Parameter
    Returns:
    The mimeType value

    getMinorVersion

    public int getMinorVersion()
    Gets the minorVersion attribute of the ObjectContainerContextImpl object
    Specified by:
    getMinorVersion in interface ObjectContainerContext
    Returns:
    The minorVersion value

    getRealPath

    public java.lang.String getRealPath(java.lang.String path)
    Description copied from interface: ObjectContainerContext
    Gets the realPath attribute of the ObjectContainerContext object
    Specified by:
    getRealPath in interface ObjectContainerContext
    Following copied from interface: org.tp23.jsp.ObjectContainerContext
    Parameters:
    path - Description of Parameter
    Returns:
    The realPath value

    getResource

    public java.net.URL getResource(java.lang.String path)
    Gets a net resource (not implemented)
    Specified by:
    getResource in interface ObjectContainerContext
    Parameters:
    path - Description of Parameter
    Returns:
    null (not yet implemented)

    getResourceAsStream

    public java.io.InputStream getResourceAsStream(java.lang.String path)
    Not implemented yet will eventually return any resource in the JSP directory
    Specified by:
    getResourceAsStream in interface ObjectContainerContext
    Parameters:
    path - Description of Parameter
    Returns:
    null

    getServerInfo

    public java.lang.String getServerInfo()
    Gets a string describing the server
    Specified by:
    getServerInfo in interface ObjectContainerContext
    Returns:
    org.tp23.jasper.MyJasper

    log

    public void log(java.lang.String msg)
    Dump to System.out
    Specified by:
    log in interface ObjectContainerContext
    Parameters:
    msg - the message to log

    log

    public void log(java.lang.String message,
                    java.lang.Throwable throwable)
    Dump to System.out
    Specified by:
    log in interface ObjectContainerContext
    Parameters:
    message - the message
    throwable - an exception

    removeAttribute

    public void removeAttribute(java.lang.String name)
    removes an attribute (this will effect all JSP's in the MyJasper object)
    Specified by:
    removeAttribute in interface ObjectContainerContext
    Parameters:
    name - Description of Parameter

    JSPTemplates