1 package org.apache.turbine.pipeline; 2 3 56 57 import java.io.IOException ; 58 59 import org.apache.fulcrum.security.util.AccessControlList; 60 import org.apache.turbine.RunData; 61 import org.apache.turbine.TemplateContext; 62 import org.apache.turbine.TurbineException; 63 import org.apache.turbine.ValveContext; 64 import org.apache.turbine.modules.Module; 65 66 78 public class CleanUpValve 79 extends AbstractValve 80 { 81 84 public CleanUpValve() 85 { 86 } 87 88 91 public void invoke(RunData data, ValveContext context) 92 throws IOException , TurbineException 93 { 94 try 95 { 96 cleanUp(data); 97 } 98 catch (Exception e) 99 { 100 throw new TurbineException(e); 101 } 102 103 context.invokeNext(data); 105 } 106 107 112 protected void cleanUp(RunData data) 113 throws Exception 114 { 115 TemplateContext context = Module.getTemplateContext(data); 116 Module.requestFinished(context); 117 118 if (data.getACL() == null) 121 { 122 try 123 { 124 data.getSession().removeAttribute 125 (AccessControlList.SESSION_KEY); 126 } 127 catch (IllegalStateException invalidatedSession) 128 { 129 } 132 } 133 } 134 } 135 | Popular Tags |