1 package com.atlassian.plugin.servlet.util;
2
3 import com.atlassian.plugin.hostcontainer.HostContainer;
4
5 import javax.servlet.ServletContext;
6
7
8
9
10
11
12 public class ServletContextHostContainerAccessor
13 {
14 private static final String HOST_CONTAINER_KEY = ServletContextHostContainerAccessor.class.getPackage()+".hostcontainer";
15
16
17
18
19
20
21
22
23 public static HostContainer getHostContainer(ServletContext servletContext) throws IllegalStateException
24 {
25 return (HostContainer) servletContext.getAttribute(HOST_CONTAINER_KEY);
26 }
27
28
29
30
31
32
33
34 public static void setHostContainer(ServletContext servletContext, HostContainer hostContainer)
35 {
36 servletContext.setAttribute(HOST_CONTAINER_KEY, hostContainer);
37 }
38
39 }