1 50 51 package org.openlaszlo.iv.flash.servlet; 52 53 import java.io.*; 54 import java.net.*; 55 import java.util.*; 56 57 import javax.servlet.*; 58 import javax.servlet.http.*; 59 60 78 public class GeneratorServletContext { 79 80 private static Hashtable contexts = new Hashtable(); 81 82 private HttpServletRequest request; 83 private HttpServletResponse response; 84 private ServletConfig config; 85 86 public static GeneratorServletContext getContext() { 87 return (GeneratorServletContext) contexts.get( Thread.currentThread() ); 88 } 89 90 public static GeneratorServletContext createContext() { 91 GeneratorServletContext context = new GeneratorServletContext(); 92 contexts.put( Thread.currentThread(), context ); 93 return context; 94 } 95 96 public static void destroyContext() { 97 contexts.remove( Thread.currentThread() ); 98 } 99 100 101 public HttpServletRequest getHttpServletRequest() { 102 return request; 103 } 104 105 public HttpServletResponse getHttpServletResponse() { 106 return response; 107 } 108 109 public ServletConfig getServletConfig() { 110 return config; 111 } 112 113 public void setHttpServletRequest( HttpServletRequest request ) { 114 this.request = request; 115 } 116 117 public void setHttpServletResponse( HttpServletResponse response ) { 118 this.response = response; 119 } 120 121 public void setServletConfig( ServletConfig config ) { 122 this.config = config; 123 } 124 } 125 126 127 | Popular Tags |