1 package org.apache.turbine.pipeline; 2 3 56 57 import java.io.IOException ; 58 59 import org.apache.turbine.Turbine; 60 import org.apache.turbine.TurbineConstants; 61 import org.apache.turbine.Resolver; 62 import org.apache.turbine.RunData; 63 import org.apache.turbine.TurbineException; 64 import org.apache.turbine.ValveContext; 65 import org.apache.turbine.modules.actions.SessionValidator; 66 67 74 public class DefaultSessionValidationValve 75 extends AbstractValve 76 implements TurbineConstants 77 { 78 protected SessionValidator sessionValidator = null; 79 80 85 public DefaultSessionValidationValve() 86 throws Exception 87 { 88 89 } 90 91 92 93 96 public void initialize() throws Exception { 97 super.initialize(); 98 Resolver r = Turbine.getResolver(); 99 if (r != null) 100 { 101 sessionValidator = (SessionValidator) 103 r.getModule(ACTIONS, Turbine.getConfiguration() 104 .getString(ACTION_SESSION_VALIDATOR)); 105 } 106 } 107 110 public void invoke(RunData data, ValveContext context) 111 throws IOException , TurbineException 112 { 113 try 114 { 115 sessionValidator.execute(data); 124 } 125 catch (Exception e) 126 { 127 throw new TurbineException(e); 128 } 129 130 context.invokeNext(data); 132 } 133 } 134 | Popular Tags |