HATS 7.5.1 Web API Reference

Publicly accessible methods not documented here are for IBM internal use only and may change in a future release of the product.

com.ibm.hats.web.runtime
Class WebContext

java.lang.Object
  extended by com.ibm.hats.web.runtime.WebContext
All Implemented Interfaces:
IContext

public class WebContext
extends Object
implements IContext

Class Name: WebContext
Class Type:
Normal
Base Class:
None
Intf Class:
IContext
Description:
A wrapper for the ServletContext class.


Constructor Summary
WebContext(javax.servlet.ServletContext theServletContext)
          Constructor which builds a WebContext from a ServletContext.
 
Method Summary
 boolean equals(Object webContext)
          Compares the specified WebContext object's internal ServletContext with the internal ServletContext object.
 Object getAttribute(String name)
          Returns the specified attribute.
 Enumeration getAttributeNames()
          Returns a list of attribute names.
 WebContext getContext(String contextRoot)
          Retrieve a WebContext for the specified context root
 String getContextName()
          Returns the application name.
 String getInitParameter(String name)
          Retrieve the specified initialization parameter.
 Enumeration getInitParameterNames()
          Returns an Enumeration of initialization parameter names.
 String getRealPath(String arg0)
          Retrieve the real path.
 IRequestDispatcher getRequestDispatcher(String arg0)
          Get the Request dispatcher associated with the resource in input
 InputStream getResourceAsStream(String resource)
          Retrieve the specified resource as a stream.
 InputStream getResourceAsStream(String[] resources)
          Retrieve the specified resource as a stream.
 javax.servlet.ServletContext getServletContext()
          Retrieve the servlet context.
 int hashCode()
          Calculate the hash code.
 void log(String arg0)
          Add the specified information to the log.
 void log(String arg0, Throwable arg1)
          Logs exception information.
 void removeAttribute(String name)
          Removes the specified attribute.
 void setAttribute(String name, Object value)
          Sets the specified attribute.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebContext

public WebContext(javax.servlet.ServletContext theServletContext)
Constructor which builds a WebContext from a ServletContext. The parameter constructor.

Parameters:
theServletContext - The servlet context to be used in the construction of this class.
Method Detail

equals

public boolean equals(Object webContext)
Compares the specified WebContext object's internal ServletContext with the internal ServletContext object.

Overrides:
equals in class Object
Parameters:
webContext - The WebContext object to be used for comparison.
Returns:
True if the objects compare, false otherwise.
See Also:
Object.equals(java.lang.Object)

getAttribute

public Object getAttribute(String name)
Returns the specified attribute.

Specified by:
getAttribute in interface IContext
Parameters:
name - The name of the attribute to retrieve.
Returns:
The specified attribute.
See Also:
ServletContext.getAttribute(java.lang.String)

getAttributeNames

public Enumeration getAttributeNames()
Returns a list of attribute names.

Specified by:
getAttributeNames in interface IContext
Returns:
Returns an Enumeration of attribute names.
See Also:
ServletContext.getAttributeNames()

getContextName

public String getContextName()
Returns the application name.

Specified by:
getContextName in interface IContext
Returns:
The application name.
See Also:
ServletContext.getServletContextName()

getInitParameter

public String getInitParameter(String name)
Retrieve the specified initialization parameter.

Specified by:
getInitParameter in interface IContext
Parameters:
name - The name of the initialization parameter to retrieve.
Returns:
The specified initialization parameter.
See Also:
ServletContext.getInitParameter(java.lang.String)

getInitParameterNames

public Enumeration getInitParameterNames()
Returns an Enumeration of initialization parameter names.

Specified by:
getInitParameterNames in interface IContext
Returns:
An Enumeration of initialization parameter names.
See Also:
ServletContext.getInitParameterNames()

getRealPath

public String getRealPath(String arg0)
Retrieve the real path.

Specified by:
getRealPath in interface IContext
Parameters:
arg0 - The real path to retrieve.
Returns:
The real path.
See Also:
ServletContext.getRealPath(java.lang.String)

getRequestDispatcher

public IRequestDispatcher getRequestDispatcher(String arg0)
Description copied from interface: IContext
Get the Request dispatcher associated with the resource in input

Specified by:
getRequestDispatcher in interface IContext
Parameters:
arg0 - Input parameter used to specify the request dispatcher.
Returns:
The specified request dispatcher.
See Also:
ServletContext.getRequestDispatcher(java.lang.String)

getResourceAsStream

public InputStream getResourceAsStream(String resource)
Retrieve the specified resource as a stream.

Specified by:
getResourceAsStream in interface IContext
Parameters:
resource - The resource to retrieve as a stream.
Returns:
The specified InputStream.
See Also:
ServletContext.getResourceAsStream(java.lang.String)

getResourceAsStream

public InputStream getResourceAsStream(String[] resources)
Retrieve the specified resource as a stream.

Specified by:
getResourceAsStream in interface IContext
Parameters:
resources - The resource to retrieve as a stream.
Returns:
The specified InputStream.
See Also:
ServletContext.getResourceAsStream(java.lang.String)

getServletContext

public javax.servlet.ServletContext getServletContext()
Retrieve the servlet context.

Returns:
Returns the context.

getContext

public WebContext getContext(String contextRoot)
Retrieve a WebContext for the specified context root

Returns:
Returns a new WebContext.

hashCode

public int hashCode()
Calculate the hash code. This method overrides the hashCode method in Object.

Overrides:
hashCode in class Object
Returns:
The hash code.
See Also:
Object.hashCode()

log

public void log(String arg0)
Add the specified information to the log. This method is not currently implemented.

Specified by:
log in interface IContext
Parameters:
arg0 - The log entry.
See Also:
ServletContext.log(java.lang.String)

log

public void log(String arg0,
                Throwable arg1)
Logs exception information.

Specified by:
log in interface IContext
Parameters:
arg0 - The information to log.
arg1 - The exception information to log.
See Also:
ServletContext.log( java.lang.String, java.lang.Throwable )

removeAttribute

public void removeAttribute(String name)
Removes the specified attribute.

Specified by:
removeAttribute in interface IContext
Parameters:
name - The name of the attribute to be removed.
See Also:
ServletContext.removeAttribute( java.lang.String )

setAttribute

public void setAttribute(String name,
                         Object value)
Sets the specified attribute.

Specified by:
setAttribute in interface IContext
Parameters:
name - The name of the attribute to be set.
value - The value to be used in setting the named attribute.
See Also:
ServletContext.setAttribute(java.lang.String, java.lang.Object)

HATS 7.5.1 (201005110649)