1 /*2 * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.3 */4 package com.tcspring;5 6 7 /**8 * Evil hack to make FlowExecutionImpl rehydration work.9 * 10 * @author Eugene Kuleshov11 */12 public class WebFlowProtocol {13 14 // public void setFlowId(StaticJoinPoint jp, Flow flow, FlowExecution instance) throws Exception {15 // // System.err.println("### WebFlowProtocol.setFlowId() " + flow.getId());16 // setValue(instance, "flowId", flow.getId());17 // }18 // 19 // public void setFlowId(StaticJoinPoint jp, Flow flow, FlowSession instance) throws Exception {20 // // System.err.println("### WebFlowProtocol.setFlowId() " + flow.getId());21 // setValue(instance, "flowId", flow.getId());22 // }23 // 24 // public void setStateId(StaticJoinPoint jp, State state, FlowSession instance) throws Exception {25 // // System.err.println("### WebFlowProtocol.setStateId() " + state.getId());26 // setValue(instance, "stateId", state.getId());27 // }28 //29 // private void setValue(Object instance, String fieldName, String value) throws Exception {30 // // shortcut trough reflection API:31 // // Field field = instance.getClass().getDeclaredField(fieldName);32 // // field.setAccessible(true);33 // // field.set(instance, value); 34 // if(instance instanceof TransparentAccess) {35 // ((TransparentAccess) instance).__tc_setmanagedfield(instance.getClass().getName()+"."+fieldName, value);36 // }37 // }38 39 public Object isStateRestored() {40 // System.err.println("### WebFlowProtocol.isStateRestored()");41 // return flowExecution.getAttributes()!=null && flowExecution.getConversationScope()!=null ? Boolean.TRUE : Boolean.FALSE;42 return Boolean.FALSE;43 }44 45 }46 47