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