net.officefloor.plugin.servlet.context
Interface OfficeServletContext

All Known Implementing Classes:
OfficeServletContextImpl

public interface OfficeServletContext

Provides ServletContext functionality specific to an Office.

All methods defined on this interface come from ServletContext with the addition of an Office parameter to identify the context Office.

Deprecated methods will typically be excluded.

Author:
Daniel Sagenschneider

Method Summary
 Object getAttribute(Office office, String name)
           
 Enumeration getAttributeNames(Office office)
           
 javax.servlet.ServletContext getContext(Office office, String uripath)
           
 String getContextPath(Office office)
           
 FilterChainFactory getFilterChainFactory(Office office)
           Obtains the FilterChainFactory for the Office.
 String getInitParameter(Office office, String name)
           
 Enumeration getInitParameterNames(Office office)
           
 String getMimeType(Office office, String file)
           
 javax.servlet.RequestDispatcher getNamedDispatcher(Office office, String name)
           
 String getRealPath(Office office, String path)
           
 javax.servlet.RequestDispatcher getRequestDispatcher(Office office, String path)
           
 URL getResource(Office office, String path)
           
 InputStream getResourceAsStream(Office office, String path)
           
 Set getResourcePaths(Office office, String path)
           
 String getServerInfo(Office office)
           
 String getServletContextName(Office office)
           
 void log(Office office, String msg)
           
 void log(Office office, String message, Throwable throwable)
           
 ServletTaskReference mapPath(Office office, String path)
           Obtains the ServletTaskReference to the Servlet Task corresponding the the input path.
 void removeAttribute(Office office, String name)
           
 void setAttribute(Office office, String name, Object object)
           
 

Method Detail

getFilterChainFactory

FilterChainFactory getFilterChainFactory(Office office)
                                         throws javax.servlet.ServletException

Obtains the FilterChainFactory for the Office.

This is a non ServletContext method and is provided as filtering is applied across an application. It is expected that the HttpServletContainer will make use of this FilterChainFactory for filtering Servlet servicing.

Parameters:
office - Office.
Returns:
FilterChainFactory.
Throws:
javax.servlet.ServletException - Filter instances are lazy loaded and initialising may fail for new Filter instances.

mapPath

ServletTaskReference mapPath(Office office,
                             String path)

Obtains the ServletTaskReference to the Servlet Task corresponding the the input path.

This is a non ServletContext method and is provided to allow routing to a Servlet for servicing the HttpRequest.

Parameters:
office - Office.
path - Path to be mapped to a Servlet Task.
Returns:
ServletTaskReference for the path or null if path does not map to a Servlet Task.

getContextPath

String getContextPath(Office office)
Parameters:
office - Office.
Returns:
Context path.
See Also:
ServletContext.getContextPath()

getContext

javax.servlet.ServletContext getContext(Office office,
                                        String uripath)
Parameters:
office - Office.
uripath - URI path.
Returns:
ServletContext.
See Also:
ServletContext.getContext(String)

getMimeType

String getMimeType(Office office,
                   String file)
Parameters:
office - Office.
file - File name.
Returns:
Mime type.
See Also:
ServletContext.getMimeType(String)

getResourcePaths

Set getResourcePaths(Office office,
                     String path)
Parameters:
office - Office.
path - Path.
Returns:
Resource paths.
See Also:
ServletContext.getResourcePaths(String)

getResource

URL getResource(Office office,
                String path)
                throws MalformedURLException
Parameters:
office - Office.
path - Path.
Returns:
URL.
Throws:
MalformedURLException - If malformed URL.
See Also:
ServletContext.getResource(String)

getResourceAsStream

InputStream getResourceAsStream(Office office,
                                String path)
Parameters:
office - Office.
path - Path.
Returns:
InputStream.
See Also:
ServletContext.getResourceAsStream(String)

getRequestDispatcher

javax.servlet.RequestDispatcher getRequestDispatcher(Office office,
                                                     String path)
Parameters:
office - Office.
path - Path.
Returns:
RequestDispatcher.
See Also:
ServletContext.getRequestDispatcher(String)

getNamedDispatcher

javax.servlet.RequestDispatcher getNamedDispatcher(Office office,
                                                   String name)
Parameters:
office - Office.
name - Name.
Returns:
RequestDispatcher.
See Also:
ServletContext.getNamedDispatcher(String)

log

void log(Office office,
         String msg)
Parameters:
office - Office.
msg - Message.
See Also:
ServletContext.log(String)

log

void log(Office office,
         String message,
         Throwable throwable)
Parameters:
office - Office.
message - Message.
throwable - Cause.
See Also:
ServletContext.log(String, Throwable)

getRealPath

String getRealPath(Office office,
                   String path)
Parameters:
office - Office.
path - Path.
Returns:
Real path.
See Also:
ServletContext.getRealPath(String)

getServerInfo

String getServerInfo(Office office)
Parameters:
office - Office.
Returns:
Server information.
See Also:
ServletContext.getServerInfo()

getInitParameter

String getInitParameter(Office office,
                        String name)
Parameters:
office - Office.
name - Name.
Returns:
Initialisation parameter value.
See Also:
ServletContext.getInitParameter(String)

getInitParameterNames

Enumeration getInitParameterNames(Office office)
Parameters:
office - Office.
Returns:
Initialisation parameter names.
See Also:
ServletContext.getInitParameterNames()

getAttribute

Object getAttribute(Office office,
                    String name)
Parameters:
office - Office.
name - Name.
Returns:
Attribute value.
See Also:
ServletContext.getAttribute(String)

getAttributeNames

Enumeration getAttributeNames(Office office)
Parameters:
office - Office.
Returns:
Attribute names.
See Also:
ServletContext.getAttributeNames()

setAttribute

void setAttribute(Office office,
                  String name,
                  Object object)
Parameters:
office - Office.
name - Name.
object - Attribute value.
See Also:
ServletContext.setAttribute(String, Object)

removeAttribute

void removeAttribute(Office office,
                     String name)
Parameters:
office - Office.
name - Name.
See Also:
ServletContext.removeAttribute(String)

getServletContextName

String getServletContextName(Office office)
Parameters:
office - Office.
Returns:
ServletContext name.
See Also:
ServletContext.getServletContextName()


Copyright © 2005-2011. All Rights Reserved.