Weaver 3.1.0a1-D1

com.oldlight.weaver.interpreter
Class WeaverServletContextImpl

java.lang.Object
  extended bycom.oldlight.weaver.interpreter.WeaverServletContextImpl
All Implemented Interfaces:
WeaverServletContext

public class WeaverServletContextImpl
extends Object
implements WeaverServletContext

Representation of the servlet.

Author:
Paul Harvey

Field Summary
private  WeaverApplication application
           
private  HashMap attributes
           
private  long creationTime
           
private  Map initParamMap
           
private  Object initParamMapSync
           
private  Properties properties
           
private  ServletConfig servletConfig
           
 
Constructor Summary
WeaverServletContextImpl(WeaverApplication application, ServletConfig servletConfig, Properties properties)
          Create a new WeaverServletContextImpl object.
 
Method Summary
 WeaverApplication getApplication()
          Get the definition of the application being executed.
 String getApplicationDate()
          Gets the application date as set in the WAD file.
 String getApplicationName()
          Gets the application name as set in the WAD file.
 String getApplicationVersion()
          Gets the application version as set in the WAD file.
 Object getAttribute(String name)
          Get the value of a named servlet scoped attribute.
 Map getAttributeMap()
          Get a map of servlet scoped attribute names to values.
 String getAuthorEmail()
          Gets the author email address as set in the WAD file.
 String getAuthorName()
          Gets the author name as set in the WAD file.
 String getConfigValue(String name)
          Get configuration value loaded from the per-servlet configuration file.
 Set getConfigValueNames()
          Get all configuration value names.
 long getCreationTime()
          Get the time that the application was created.
 String getInitParameter(String name)
          Get a servlet init parameter.
 Map getInitParameterMap()
          Get a map of servlet init parameter names to values (This method is used by the EL variable resolver)
 String getServletName()
          Get the name of the servlet running this application.
 String getVendorName()
          Gets the vendor name as set in the WAD file.
 void removeAttribute(String name)
          Remove a session scoped attribute.
 void setAttribute(String name, Object value)
          Set a servlet scoped attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

servletConfig

private ServletConfig servletConfig

properties

private Properties properties

attributes

private HashMap attributes

creationTime

private long creationTime

application

private WeaverApplication application

initParamMapSync

private Object initParamMapSync

initParamMap

private Map initParamMap
Constructor Detail

WeaverServletContextImpl

public WeaverServletContextImpl(WeaverApplication application,
                                ServletConfig servletConfig,
                                Properties properties)
Create a new WeaverServletContextImpl object.

Parameters:
application - Definition of the application (WAD file) this servlet is running.
servletConfig - Servlet config for this servlet
properties - Per-servlet config object for this servlet.
Method Detail

getCreationTime

public long getCreationTime()
Get the time that the application was created.

Specified by:
getCreationTime in interface WeaverServletContext
Returns:
The requested time.

getServletName

public String getServletName()
Get the name of the servlet running this application.

Specified by:
getServletName in interface WeaverServletContext
Returns:
The servlet name.

getApplication

public WeaverApplication getApplication()
Get the definition of the application being executed.

Returns:
The application being executed.

getApplicationName

public String getApplicationName()
Description copied from interface: WeaverServletContext
Gets the application name as set in the WAD file.

Specified by:
getApplicationName in interface WeaverServletContext
Returns:
The application name.

getApplicationVersion

public String getApplicationVersion()
Description copied from interface: WeaverServletContext
Gets the application version as set in the WAD file.

Specified by:
getApplicationVersion in interface WeaverServletContext
Returns:
The application version.

getApplicationDate

public String getApplicationDate()
Description copied from interface: WeaverServletContext
Gets the application date as set in the WAD file.

Specified by:
getApplicationDate in interface WeaverServletContext
Returns:
The application date.

getAuthorEmail

public String getAuthorEmail()
Description copied from interface: WeaverServletContext
Gets the author email address as set in the WAD file.

Specified by:
getAuthorEmail in interface WeaverServletContext
Returns:
The author EMail address.

getAuthorName

public String getAuthorName()
Description copied from interface: WeaverServletContext
Gets the author name as set in the WAD file.

Specified by:
getAuthorName in interface WeaverServletContext
Returns:
The author name.

getVendorName

public String getVendorName()
Description copied from interface: WeaverServletContext
Gets the vendor name as set in the WAD file.

Specified by:
getVendorName in interface WeaverServletContext
Returns:
The vendor name.

getInitParameter

public String getInitParameter(String name)
Get a servlet init parameter.

Specified by:
getInitParameter in interface WeaverServletContext
Parameters:
name - The name of the init parameter to return.
Returns:
The requested parameter, or null if it cannot be found.

getInitParameterMap

public Map getInitParameterMap()
Get a map of servlet init parameter names to values (This method is used by the EL variable resolver)

Returns:
The requested map.

getConfigValue

public String getConfigValue(String name)
Get configuration value loaded from the per-servlet configuration file.

Specified by:
getConfigValue in interface WeaverServletContext
Parameters:
name - Name of config value to retrieve
Returns:
The requested configuration value, or null if it can't be found.

getConfigValueNames

public Set getConfigValueNames()
Get all configuration value names.

Specified by:
getConfigValueNames in interface WeaverServletContext
Returns:
Set of configuration value names.

setAttribute

public void setAttribute(String name,
                         Object value)
Set a servlet scoped attribute.

Specified by:
setAttribute in interface WeaverServletContext
Parameters:
name - The name of the attribute to set.
value - The value to set the attribute to.

getAttributeMap

public Map getAttributeMap()
Get a map of servlet scoped attribute names to values. (This method is called by the EL variable resolver).

Returns:
The requested map.

getAttribute

public Object getAttribute(String name)
Get the value of a named servlet scoped attribute.

Specified by:
getAttribute in interface WeaverServletContext
Parameters:
name - The name of the attribute to retrieve.
Returns:
The value of the named attribute, or null if not found.

removeAttribute

public void removeAttribute(String name)
Remove a session scoped attribute.

Specified by:
removeAttribute in interface WeaverServletContext
Parameters:
name - The name of the attribute to remove.

Copyright ©Paul Harvey