Changeset 3908
- Timestamp:
- 09/25/08 11:05:01 (3 months ago)
- Files:
-
- trunk/pfixcore/ChangeLog (modified) (1 diff)
- trunk/pfixcore/src/de/schlund/pfixcore/util/DummyContextFactory.java (deleted)
- trunk/pfixcore/src/de/schlund/pfixcore/workflow/ContextImpl.java (modified) (3 diffs)
- trunk/pfixcore/src/de/schlund/pfixcore/workflow/context/SessionContextImpl.java (modified) (2 diffs)
- trunk/pfixcore/src/org/pustefixframework/config/contextxmlservice/parser/ContextXMLParsingHandler.java (modified) (1 diff)
- trunk/pfixcore/src/org/pustefixframework/config/project/parser/PustefixContextDirectOutputRequestHandlerParsingHandler.java (modified) (2 diffs)
- trunk/pfixcore/src/org/pustefixframework/config/project/parser/PustefixContextXMLRequestHandlerParsingHandler.java (modified) (2 diffs)
- trunk/pfixcore/src/org/pustefixframework/http/PustefixContextDirectOutputRequestHandler.java (modified) (5 diffs)
- trunk/pfixcore/src/org/pustefixframework/http/PustefixContextXMLRequestHandler.java (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/pfixcore/ChangeLog
r3907 r3908 1 2008-09-25 Martin Leidig <mleidig@schlund.de> 2 3 Removed unnecessary injection of ServerContextImpl: 4 * src/org/pustefixframework/http/PustefixContextDirectOutputRequestHandler.java: 5 * src/org/pustefixframework/http/PustefixContextXMLRequestHandler.java 6 * src/org/pustefixframework/config/project/parser/PustefixContextDirectOutputRequestHandlerParsingHandler.java 7 * src/org/pustefixframework/config/project/parser/PustefixContextXMLRequestHandlerParsingHandler.java 8 9 * src/org/pustefixframework/config/contextxmlservice/parser/ContextXMLParsingHandler.java: 10 add init method to bean definition 11 * src/de/schlund/pfixcore/workflow/context/SessionContextImpl.java: 12 fixed NullPointerException occurring on session timeout 13 * src/de/schlund/pfixcore/workflow/ContextImpl.java: 14 call SessionContextImpl.init from init method called by Spring 15 * src/de/schlund/pfixcore/util/DummyContextFactory.java: 16 removed, unit tests now should be done by Spring means (setting up a 17 PustefixWebApplicationContext) 18 1 19 2008-09-24 Martin Leidig <mleidig@schlund.de> 2 20 trunk/pfixcore/src/de/schlund/pfixcore/workflow/ContextImpl.java
r3893 r3908 22 22 23 23 import javax.servlet.http.Cookie; 24 import javax.servlet.http.HttpSession;25 24 import javax.servlet.http.HttpSessionBindingEvent; 26 25 import javax.servlet.http.HttpSessionBindingListener; … … 54 53 } 55 54 56 //TODO: rework 57 public void setSession(HttpSession session) throws PustefixApplicationException, PustefixCoreException { 58 sessioncontext.init(this, session); 55 public void init() throws PustefixCoreException, PustefixApplicationException{ 56 sessioncontext.init(this); 59 57 } 60 58 … … 314 312 // Notification on session binding / unbinding 315 313 316 //TODO: remove317 314 public void valueBound(HttpSessionBindingEvent ev) { 318 315 this.sessioncontext.setSession(ev.getSession()); 319 316 } 320 //TODO: remove 317 321 318 public void valueUnbound(HttpSessionBindingEvent ev) { 322 319 if (ev.getSession() == this.sessioncontext.getSession()) { trunk/pfixcore/src/de/schlund/pfixcore/workflow/context/SessionContextImpl.java
r3797 r3908 65 65 } 66 66 67 public void init(Context context , HttpSession session) throws PustefixApplicationException, PustefixCoreException {67 public void init(Context context) throws PustefixApplicationException, PustefixCoreException { 68 68 69 //TODO: rework session stuff70 69 synchronized(this) { 71 70 if(authentication == null) { … … 101 100 public void setSession(HttpSession session) { 102 101 this.session = session; 103 i nitSession(session);102 if(session != null) initSession(session); 104 103 } 105 104 trunk/pfixcore/src/org/pustefixframework/config/contextxmlservice/parser/ContextXMLParsingHandler.java
r3897 r3908 159 159 beanBuilder = BeanDefinitionBuilder.genericBeanDefinition(ContextImpl.class); 160 160 beanBuilder.setScope("session"); 161 beanBuilder.setInitMethodName("init"); 161 162 beanBuilder.addPropertyReference("serverContext", ServerContextImpl.class.getName()); 162 163 beanBuilder.addPropertyReference("contextResourceManager", ContextResourceManagerImpl.class.getName()); trunk/pfixcore/src/org/pustefixframework/config/project/parser/PustefixContextDirectOutputRequestHandlerParsingHandler.java
r3899 r3908 55 55 56 56 import de.schlund.pfixcore.workflow.ContextImpl; 57 import de.schlund.pfixcore.workflow.context.ServerContextImpl;58 57 import de.schlund.pfixxml.config.includes.IncludesResolver; 59 58 import de.schlund.pfixxml.resources.ResourceUtil; … … 136 135 beanBuilder.setInitMethodName("init"); 137 136 beanBuilder.addPropertyValue("handlerURI", path + "/**"); 138 beanBuilder.addPropertyValue("serverContext", new RuntimeBeanReference(ServerContextImpl.class.getName()));139 137 beanBuilder.addPropertyValue("context", new RuntimeBeanReference(ContextImpl.class.getName())); 140 138 beanBuilder.addPropertyValue("stateMap", new RuntimeBeanReference(mapBeanName)); trunk/pfixcore/src/org/pustefixframework/config/project/parser/PustefixContextXMLRequestHandlerParsingHandler.java
r3906 r3908 52 52 53 53 import de.schlund.pfixcore.workflow.ContextImpl; 54 import de.schlund.pfixcore.workflow.context.ServerContextImpl;55 54 import de.schlund.pfixxml.config.BuildTimeProperties; 56 55 import de.schlund.pfixxml.resources.FileResource; … … 121 120 beanBuilder.addPropertyValue("dependFile", dependFile); 122 121 beanBuilder.addPropertyValue("handlerURI", path + "/**"); 123 beanBuilder.addPropertyValue("serverContext", new RuntimeBeanReference(ServerContextImpl.class.getName()));124 122 beanBuilder.addPropertyValue("context", new RuntimeBeanReference(ContextImpl.class.getName())); 125 123 beanBuilder.addPropertyValue("configuration", config); trunk/pfixcore/src/org/pustefixframework/http/PustefixContextDirectOutputRequestHandler.java
r3822 r3908 37 37 import de.schlund.pfixcore.workflow.DirectOutputState; 38 38 import de.schlund.pfixcore.workflow.PageRequest; 39 import de.schlund.pfixcore.workflow.context.ServerContextImpl;40 39 import de.schlund.pfixxml.PfixServletRequest; 41 40 import de.schlund.pfixxml.resources.FileResource; … … 72 71 private Map<String, DirectOutputState> stateMap; 73 72 74 private ServerContextImpl serverContext;75 73 private ContextImpl context; 76 74 … … 125 123 126 124 // Make sure the context is initialized and deinitialized this thread 127 context.setServerContext(serverContext);128 125 context.prepareForRequest(); 129 126 try { 130 127 if (config.isSynchronized()) { 131 128 synchronized (context) { 132 doProcess(preq, res, serverContext,context);129 doProcess(preq, res, context); 133 130 } 134 131 } else { 135 doProcess(preq, res, serverContext,context);132 doProcess(preq, res, context); 136 133 } 137 134 } finally { … … 140 137 } 141 138 142 protected void doProcess(PfixServletRequest preq, HttpServletResponse res, ServerContextImpl servercontext,ContextImpl context) throws Exception {139 protected void doProcess(PfixServletRequest preq, HttpServletResponse res, ContextImpl context) throws Exception { 143 140 ContextResourceManager crm = context.getContextResourceManager(); 144 141 … … 204 201 } 205 202 206 public void setServerContext(ServerContextImpl serverContext) {207 this.serverContext = serverContext;208 }209 210 203 public void setContext(ContextImpl context) { 211 204 this.context = context; trunk/pfixcore/src/org/pustefixframework/http/PustefixContextXMLRequestHandler.java
r3906 r3908 42 42 import de.schlund.pfixcore.workflow.ExtendedContext; 43 43 import de.schlund.pfixcore.workflow.context.RequestContextImpl; 44 import de.schlund.pfixcore.workflow.context.ServerContextImpl;45 44 import de.schlund.pfixxml.PfixServletRequest; 46 45 import de.schlund.pfixxml.PfixServletRequestImpl; … … 65 64 private ContextXMLServletConfig config = null; 66 65 67 private ServerContextImpl servercontext = null;68 66 private ContextImpl context = null; 69 67 … … 233 231 throw new PustefixRuntimeException("No valid session found! Aborting..."); 234 232 } 235 236 //TODO: remove237 synchronized (session) {238 context.setServerContext(servercontext);239 context.setSession(session);240 }241 242 233 return context; 243 234 } … … 265 256 } 266 257 267 public void setServerContext(ServerContextImpl servercontext) {268 this.servercontext = servercontext;269 }270 271 258 public void setContext(ContextImpl context) { 272 259 this.context = context;
