com.atlassian.jira.plugin.webfragment
Class CacheableContextProviderDecorator

java.lang.Object
  extended by com.atlassian.jira.plugin.webfragment.CacheableContextProviderDecorator
All Implemented Interfaces:
com.atlassian.plugin.web.ContextProvider

public class CacheableContextProviderDecorator
extends Object
implements com.atlassian.plugin.web.ContextProvider

Decorator for CacheableContextProvider instances that stores the result of a getContextMap(java.util.Map) invocation in a request attribute. The uniqueness of the cache key is given by CacheableContextProvider.getUniqueContextKey(java.util.Map), since it is possible for multiple getContextMap(java.util.Map) invocations to be made in the same request with different contexts.

Since:
v4.4

Constructor Summary
CacheableContextProviderDecorator(CacheableContextProvider contextProvider)
           
 
Method Summary
 Map<String,Object> getContextMap(Map<String,Object> context)
           
protected  javax.servlet.http.HttpServletRequest getRequest(Map<String,Object> context)
          Method that retrieves the HttpServletRequest by the numerous methods that JIRA uses.
 void init(Map<String,String> params)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheableContextProviderDecorator

public CacheableContextProviderDecorator(CacheableContextProvider contextProvider)
Method Detail

getContextMap

public Map<String,Object> getContextMap(Map<String,Object> context)
Specified by:
getContextMap in interface com.atlassian.plugin.web.ContextProvider

init

public void init(Map<String,String> params)
          throws com.atlassian.plugin.PluginParseException
Specified by:
init in interface com.atlassian.plugin.web.ContextProvider
Throws:
com.atlassian.plugin.PluginParseException

getRequest

protected javax.servlet.http.HttpServletRequest getRequest(Map<String,Object> context)
Method that retrieves the HttpServletRequest by the numerous methods that JIRA uses. It tries to get it from: the context passed in (jirahelper or request), then from ExecutingHttpRequest, and then from the ActionContext

Parameters:
context - the context passed into the getContextMap method.
Returns:
the current request.


Copyright © 2002-2012 Atlassian. All Rights Reserved.