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: import org.apache.commons.logging.Log;
07: import org.apache.commons.logging.LogFactory;
08:
09: import com.tc.aspectwerkz.joinpoint.StaticJoinPoint;
10:
11: /**
12: * Used to replace org.springframework.webflow.conversation.impl.UtilConcurrentConversationLock
13: *
14: * @author Eugene Kuleshov
15: */
16: public class ConversationLockProtocol {
17: private final transient Log logger = LogFactory.getLog(getClass());
18:
19: // a hack to work around class cast exception for call advice
20: public Object replaceUtilConversationLock(StaticJoinPoint jp)
21: throws Throwable {
22: Object o = jp.proceed();
23: if (o
24: .getClass()
25: .getName()
26: .equals(
27: "org.springframework.webflow.conversation.impl.UtilConcurrentConversationLock")) {
28: logger.info("Creating distributed ConversationLock");
29: return new DSOConversationLock();
30: }
31: return o;
32:
33: }
34:
35: }
|