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.RunData; 62 import org.apache.turbine.TurbineException; 63 import org.apache.turbine.ValveContext; 64 import org.apache.turbine.modules.Module; 65 66 76 public class DefaultActionValve 77 extends AbstractValve 78 implements TurbineConstants 79 { 80 85 public DefaultActionValve() 86 throws Exception 87 { 88 } 89 90 93 public void invoke(RunData data, ValveContext context) 94 throws IOException , TurbineException 95 { 96 try 97 { 98 preExecuteAction(data); 99 executeAction(data); 100 postExecuteAction(data); 101 } 102 catch (Exception e) 103 { 104 throw new TurbineException(e); 105 } 106 107 context.invokeNext(data); 109 } 110 111 119 protected void preExecuteAction(RunData data) 120 throws Exception 121 { 122 Module.getTemplateContext(data); 124 } 125 126 131 protected void executeAction(RunData data) 132 throws Exception 133 { 134 if (data.hasAction()) 137 { 138 Turbine.getResolver() 139 .getModule( ACTIONS, data.getAction() ).execute( data ); 140 } 141 } 142 143 148 protected void postExecuteAction(RunData data) 149 throws Exception 150 { 151 } 152 } 153 | Popular Tags |