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/10/07 19:25:21 UTC

svn commit: r582654 - in /myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation: basic/ jsf/components/ spring/

Author: skitching
Date: Sun Oct  7 10:25:19 2007
New Revision: 582654

URL: http://svn.apache.org/viewvc?rev=582654&view=rev
Log:
Minor javadoc updates only.

Modified:
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/basic/BasicConversationMessager.java
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/components/UIEndConversation.java
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/AbstractSpringOrchestraScope.java
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/BeanDefinitionConversationNameAttrDecorator.java
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/OrchestraNamespaceHandler.java
    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/basic/BasicConversationMessager.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/basic/BasicConversationMessager.java?rev=582654&r1=582653&r2=582654&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/basic/BasicConversationMessager.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/basic/BasicConversationMessager.java Sun Oct  7 10:25:19 2007
@@ -27,7 +27,7 @@
  * Handle user-specific notifications about conversation anomalies, when we are running
  * in a plain servlet environment (no JSF etc).
  * <p>
- * Unfortunately there is no standard way of dislpaying a message to a user in such an
+ * Unfortunately there is no standard way of displaying a message to a user in such an
  * environment (except possibly throwing an exception, forcing the standard error page
  * to be shown). This implementation therefore just logs the message to the standard
  * server application log.

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/components/UIEndConversation.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/components/UIEndConversation.java?rev=582654&r1=582653&r2=582654&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/components/UIEndConversation.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/components/UIEndConversation.java Sun Oct  7 10:25:19 2007
@@ -34,15 +34,14 @@
 import org.apache.myfaces.shared_orchestra.util.StringUtils;
 
 /**
- * End a conversation.
- * <p>
- * Also does navigation on exception - maybe this should be separated out into a different tag?
+ * Can be used to end a manual-scope conversation, and optionally handles exceptions thrown
+ * by action methods.
  * <p>
  * When nested within a UICommand component (eg a commandLink or commandButton) the specified
  * conversation will be ended after the method invoked by the parent component is executed.
  * <pre>
  * &lt;h:commandLink action="#{backing.saveAction}"&gt;
- *     &lt;n:endConversationTag name="conversation1" onOutcome="success" /&gt;
+ *     &lt;orchestra:endConversation name="conversation1" onOutcome="success" /&gt;
  * &lt;/h:commandLink&gt;
  * </pre>
  * <p>
@@ -72,11 +71,11 @@
  * 
  * <h2>errorOutcome</h2>
  * 
- * In case of an exception, use the given outcome as new outcome so normal navigation to a 
- * specified page can occur instead of showing the default errorPage. This value is
- * checked against the onOutcome list to determine whether the specified conversation
- * should be terminated when an exception occurs. If an exception occurs, but no
- * errorOutcome is specified then the conversation is never terminated.
+ * In case of an exception being thrown by the action method, use the given outcome as the
+ * new outcome so normal navigation to a specified page can occur instead of showing the
+ * default errorPage. This value is checked against the onOutcome list to determine whether
+ * the specified conversation should be terminated when an exception occurs. If an exception
+ * occurs, but no errorOutcome is specified then the conversation is never terminated.
  */
 public class UIEndConversation extends AbstractConversationComponent
 {

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/AbstractSpringOrchestraScope.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/AbstractSpringOrchestraScope.java?rev=582654&r1=582653&r2=582654&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/AbstractSpringOrchestraScope.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/AbstractSpringOrchestraScope.java Sun Oct  7 10:25:19 2007
@@ -66,7 +66,7 @@
 	}
 
 	/**
-	 * the advices which will be applied to the conversation scoped bean
+	 * The advices (interceptors) which will be applied to the conversation scoped bean.
 	 */
 	public void setAdvices(Advice[] advices)
 	{
@@ -74,13 +74,10 @@
 	}
 
 	/**
+	 * Return the conversation context id.
 	 * <p>
-	 * return the conversation context id.
-	 * </p>
-	 * <p>
-	 * Note: This conversationId is someting spring requires. It has nothing to do with the Orchestra
-	 * conversation id
-	 * </p>
+	 * Note: This conversationId is something spring requires. It has nothing to do with the Orchestra
+	 * conversation id.
 	 */
 	public String getConversationId()
 	{
@@ -95,7 +92,8 @@
 
 	/**
 	 * This is invoked by Spring whenever someone calls getBean(name) on a bean-factory
-	 * and the bean-definition for that bean has scope="conversation".
+	 * and the bean-definition for that bean has a scope attribute that maps to an
+	 * instance of this class.
 	 * <p>
 	 * First, the appropriate ConversationContext is retrieved.
 	 * <p>
@@ -206,8 +204,8 @@
 	}
 
 	/**
-	 * set the {@link org.apache.myfaces.orchestra.conversation.Conversation} object to the bean if it implements the
-	 * {@link org.apache.myfaces.orchestra.conversation.ConversationAware} interface
+	 * Set the {@link org.apache.myfaces.orchestra.conversation.Conversation} object to the bean if it implements the
+	 * {@link org.apache.myfaces.orchestra.conversation.ConversationAware} interface.
 	 */
 	public void setBeanFactory(BeanFactory beanFactory) throws BeansException
 	{
@@ -235,7 +233,7 @@
 	}
 
 	/**
-	 * get the conversation for the given beanName
+	 * Get the conversation for the given beanName.
 	 */
 	protected Conversation getConversationForBean(String beanName)
 	{
@@ -245,7 +243,7 @@
 	}
 
 	/**
-	 * get the conversation name associating to the beanName
+	 * Get the conversation name associated with the beanName.
 	 */
 	protected String getConversationNameForBean(String beanName)
 	{
@@ -268,9 +266,9 @@
 	}
 
 	/**
-	 * strip off any spring namespace. (e.g. scopedTarget.)
-	 * This method will simply strip off anything before the first
-	 * dot.
+	 * Strip off any Spring namespace (eg scopedTarget).
+	 * <p>
+	 * This method will simply strip off anything before the first dot.
 	 */
 	protected String buildBeanName(String name)
 	{
@@ -294,9 +292,11 @@
 	}
 
 	/**
-	 * add the given runnable wrapped within an {@link org.apache.myfaces.orchestra.conversation.ConversationBindingListener} to
+	 * Add the given runnable wrapped within an
+	 * {@link org.apache.myfaces.orchestra.conversation.ConversationBindingListener} to
 	 * the conversation map.
-	 * That way it will be called during conversation destroy.
+	 * <p>
+	 * This ensures it will be called during conversation destroy.
 	 */
 	public void registerDestructionCallback(String name, final Runnable runnable)
 	{

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/BeanDefinitionConversationNameAttrDecorator.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/BeanDefinitionConversationNameAttrDecorator.java?rev=582654&r1=582653&r2=582654&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/BeanDefinitionConversationNameAttrDecorator.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/BeanDefinitionConversationNameAttrDecorator.java Sun Oct  7 10:25:19 2007
@@ -33,7 +33,16 @@
  */
 public class BeanDefinitionConversationNameAttrDecorator implements BeanDefinitionDecorator
 {
+	/**
+	 * The name of the xml attribute in the spring bean definition that is used by
+	 * orchestra as the conversation name.
+	 */
 	public final static String XSD_CONVERSATION_NAME_ATTRIBUTE = "conversationName"; // NON-NLS
+	
+	/**
+	 * A unique key used to store the orchestra conversationName within the attributes map
+	 * of a spring bean definition.
+	 */
 	public final static String CONVERSATION_NAME_ATTRIBUTE = "org.apache.myfaces.orchestra.spring.conversationName"; // NON-NLS
 
 	public BeanDefinitionHolder decorate(

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/OrchestraNamespaceHandler.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/OrchestraNamespaceHandler.java?rev=582654&r1=582653&r2=582654&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/OrchestraNamespaceHandler.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/OrchestraNamespaceHandler.java Sun Oct  7 10:25:19 2007
@@ -21,15 +21,21 @@
 import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
 
 /**
- * Wire the custom namespace "orchestra" to its parser to allow to configure
- * further Orchestra aspects. Handler objects are registered with spring that will
- * be invoked whenever specific xml attributes are encountered in the bean definitions.
+ * Wire the custom orchestra xml attributes to the appropriate handler classes.
+ * <p>
+ * This is invoked by spring due to the "magic" files named "spring.handlers" and
+ * "spring.schemas" in the META-INF directory.
+ * <p>
+ * When Spring encounters an attribute in a namespace specified by the above
+ * config files it invokes the appropriate bean definition decorator registered
+ * by this class. 
  */
 public class OrchestraNamespaceHandler extends NamespaceHandlerSupport
 {
 	public void init()
 	{
-		// registerBeanDefinitionParser("orchestra", new OrchestraBeanDefinitionParser()); // NON-NLS
-		registerBeanDefinitionDecoratorForAttribute(BeanDefinitionConversationNameAttrDecorator.XSD_CONVERSATION_NAME_ATTRIBUTE, new BeanDefinitionConversationNameAttrDecorator());
+		registerBeanDefinitionDecoratorForAttribute(
+			BeanDefinitionConversationNameAttrDecorator.XSD_CONVERSATION_NAME_ATTRIBUTE,
+			new BeanDefinitionConversationNameAttrDecorator());
 	}
 }

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?rev=582654&r1=582653&r2=582654&view=diff
==============================================================================
--- 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 Sun Oct  7 10:25:19 2007
@@ -27,7 +27,7 @@
 
 /**
  * Handles creation and lookup of any bean whose bean-definition specifies a scope
- * of "conversation".
+ * that maps to an instance of this type.
  * <p>
  * A scope bean handles Spring-specific callbacks in order to locate or create any beans whose definition
  * specifies that scope. A scope can also be thought of as a "conversation template", as this object
@@ -36,24 +36,25 @@
  * <h2>Example</h2>
  * A sample configuration for a conversation scope with persistence:
  * <pre>
- * 	&lt;bean class="org.springframework.beans.factory.config.CustomScopeConfigurer"&gt;
- * &lt;property name="scopes"&gt;
- * &lt;map&gt;
- * &lt;entry key="conversation.manual"&gt;
- * &lt;bean class="org.apache.myfaces.orchestra.conversation.spring.SpringConversationScope"&gt;
- * &lt;property name="advices"&gt;
- * &lt;list&gt;
- * &lt;ref bean="persistentContextConversationInterceptor" /&gt;
- * &lt;/list&gt;
- * &lt;/property&gt;
+ * &lt;bean class="org.springframework.beans.factory.config.CustomScopeConfigurer"&gt;
+ *   &lt;property name="scopes"&gt;
+ *     &lt;map&gt;
+ *       &lt;entry key="conversation.manual"&gt;
+ *         &lt;bean class="org.apache.myfaces.orchestra.conversation.spring.SpringConversationScope"&gt;
+ *           &lt;property name="advices"&gt;
+ *             &lt;list&gt;
+ *               &lt;ref bean="persistentContextConversationInterceptor" /&gt;
+ *             &lt;/list&gt;
+ *           &lt;/property&gt;
+ *         &lt;/bean&gt;
+ *       &lt;/entry&gt;
+ *     &lt;/map&gt;
+ *   &lt;/property&gt;
  * &lt;/bean&gt;
- * &lt;/entry&gt;
- * &lt;/map&gt;
- * &lt;/property&gt;
- * &lt;/bean&gt;
- * <p/>
+ * 
+ * 
  * &lt;bean id="persistentContextConversationInterceptor" class="org.apache.myfaces.orchestra.conversation.spring.PersistenceContextConversationInterceptor"&gt;
- * &lt;property name="persistenceContextFactory" ref="yourPersistentContextFactory" /&gt;
+ *   &lt;property name="persistenceContextFactory" ref="yourPersistentContextFactory" /&gt;
  * &lt;/bean&gt;
  * </pre>
  * <p>
@@ -83,7 +84,7 @@
 	private String lifetime = "manual";
 
 	/**
-	 * @see #setTimeout
+	 * See {@link #setTimeout}.
 	 */
 	public Integer getTimeout()
 	{
@@ -99,6 +100,9 @@
 		this.timeout = timeout;
 	}
 
+	/**
+	 * See {@link #setLifetime}.
+	 */
 	public String getLifetime()
 	{
 		return lifetime;
@@ -165,6 +169,11 @@
 		}
 	}
 
+	/**
+	 * Mark the specified conversation as having been accessed.
+	 * <p>
+	 * This affects conversation timeouts, and the removal of flash conversations.
+	 */
 	protected void notifyAccessConversation(Conversation conversation)
 	{
 		super.notifyAccessConversation(conversation);