KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tcspring > ConversationLockProtocol


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 import org.apache.commons.logging.Log;
7 import org.apache.commons.logging.LogFactory;
8
9 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 JavaDoc replaceUtilConversationLock(StaticJoinPoint jp) throws Throwable JavaDoc {
21     Object JavaDoc o = jp.proceed();
22     if(o.getClass().getName().equals("org.springframework.webflow.conversation.impl.UtilConcurrentConversationLock")) {
23       logger.info("Creating distributed ConversationLock");
24       return new DSOConversationLock();
25     }
26     return o;
27
28   }
29
30 }
31
Popular Tags