You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sk...@apache.org on 2007/08/17 13:58:26 UTC
svn commit: r567029 -
/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/SpringConversationScope.java
Author: skitching
Date: Fri Aug 17 04:58:24 2007
New Revision: 567029
URL: http://svn.apache.org/viewvc?view=rev&rev=567029
Log:
Add javadoc only.
Modified:
myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/SpringConversationScope.java
Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/SpringConversationScope.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/SpringConversationScope.java?view=diff&rev=567029&r1=567028&r2=567029
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/SpringConversationScope.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/SpringConversationScope.java Fri Aug 17 04:58:24 2007
@@ -41,6 +41,9 @@
import org.springframework.context.ConfigurableApplicationContext;
/**
+ * Handles creation and lookup of any bean whose bean-definition specifies a scope
+ * of "conversation".
+ *
* <p>adapts the conversation scope to a new spring scope</p>
* <p>It will also apply any advice configured</p>
* <p>A sample configuration for a conversation scope with persistence
@@ -104,9 +107,23 @@
}
/**
- * get the conversation bean.<br />
- * this will start a new conversation with the same name in case a conversation
- * is not existent yet.
+ * This is invoked by Spring whenever someone calls getBean(name) on a bean-factory
+ * and the bean-definition for that bean has scope="conversation".
+ * <p>
+ * First, the appropriate ConversationContext is retrieved.
+ * <p>
+ * Second, the appropriate Conversation is retrieved; if it does not yet exist then
+ * it is created and started. The conversation name is either specified on the
+ * bean-definition via a custom attribute, or defaults to the bean name.
+ * <p>
+ * Then if the bean already exists in the Conversation then it is returned. Otherwise
+ * a new instance is created, stored into the Conversation and returned.
+ * <p>
+ * When a bean is created, a proxy is actually created for it which has one or
+ * more AOP "advices" (ie method interceptors). The CurrentConversationAdvice class
+ * is always attached. Note that if the bean definition contains the aop:proxy
+ * tag (and most do) then the bean that spring creates is already a proxy, ie
+ * what is returned is a proxy of a proxy.
*/
public Object get(String name, ObjectFactory objectFactory)
{
@@ -279,6 +296,9 @@
);
}
+ /**
+ * Get an ApplicationContext injected by Spring. See ApplicationContextAware interface.
+ */
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
{
if (!(applicationContext instanceof ConfigurableApplicationContext))