[webbeans-commits] Webbeans SVN: r2429 - extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Thu Apr 16 07:21:41 EDT 2009


Author: pete.muir at jboss.org
Date: 2009-04-16 07:21:41 -0400 (Thu, 16 Apr 2009)
New Revision: 2429

Modified:
   extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansApplication.java
   extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansComponentInstantiationListener.java
   extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansMetaData.java
   extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansRequestCycle.java
   extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansWebRequestCycleProcessor.java
Log:
ws

Modified: extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansApplication.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansApplication.java	2009-04-16 11:17:22 UTC (rev 2428)
+++ extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansApplication.java	2009-04-16 11:21:41 UTC (rev 2429)
@@ -10,13 +10,17 @@
 import org.apache.wicket.request.IRequestCycleProcessor;
 
 /**
- * A convenience subclass of wicket's WebApplication which adds the hooks necessary to use JSR-299 injections
- * in wicket components, as well as manage JSR-299 conversation scopes with Wicket page metadata.  If you have 
- * your own WebApplication subclass, and can't subclass this class, you just need to do the three things that this
- * class does, i.e. register the WebBeansComponentInstantiationListener, and override the two methods below to return
- * the RequestCycle and IRequestCycleProcessor subclasses specific to WebBeans, or your subclasses of those classes.
+ * A convenience subclass of wicket's WebApplication which adds the hooks
+ * necessary to use JSR-299 injections in wicket components, as well as manage
+ * JSR-299 conversation scopes with Wicket page metadata. If you have your own
+ * WebApplication subclass, and can't subclass this class, you just need to do
+ * the three things that this class does, i.e. register the
+ * WebBeansComponentInstantiationListener, and override the two methods below to
+ * return the RequestCycle and IRequestCycleProcessor subclasses specific to
+ * WebBeans, or your subclasses of those classes.
+ * 
  * @author cpopetz
- *
+ * 
  * @see WebApplication
  * @see WebBeansWebRequestCycleProcessor
  * @see WebBeansRequestCycle
@@ -25,6 +29,7 @@
 {
    /**
     * Use the constructor to add our component instantiation listener
+    * 
     * @see WebBeansComponentInstantiationListener
     */
    public WebBeansApplication()
@@ -34,6 +39,7 @@
 
    /**
     * Override to return our WebBeans-specific request cycle processor
+    * 
     * @see WebBeansWebRequestCycleProcessor
     */
    @Override
@@ -44,6 +50,7 @@
 
    /**
     * Override to return our WebBeans-specific request cycle
+    * 
     * @see WebBeansRequestCycle
     */
    @Override

Modified: extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansComponentInstantiationListener.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansComponentInstantiationListener.java	2009-04-16 11:17:22 UTC (rev 2428)
+++ extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansComponentInstantiationListener.java	2009-04-16 11:21:41 UTC (rev 2429)
@@ -6,10 +6,12 @@
 import org.jboss.webbeans.manager.api.WebBeansManager;
 
 /**
- * This listener uses the WebBeansManager to handle injections for all wicket components.
+ * This listener uses the WebBeansManager to handle injections for all wicket
+ * components.
+ * 
  * @author cpopetz
  * @see WebBeansManager
- *
+ * 
  */
 public class WebBeansComponentInstantiationListener implements IComponentInstantiationListener
 {

Modified: extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansMetaData.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansMetaData.java	2009-04-16 11:17:22 UTC (rev 2428)
+++ extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansMetaData.java	2009-04-16 11:21:41 UTC (rev 2429)
@@ -3,10 +3,11 @@
 import org.apache.wicket.MetaDataKey;
 
 /**
- * Public storage for the metadata key used by the WebBeans integration to store 
+ * Public storage for the metadata key used by the WebBeans integration to store
  * conversation ids in wicket page metadata.
+ * 
  * @author cpopetz
- *
+ * 
  */
 public class WebBeansMetaData
 {
@@ -15,7 +16,8 @@
     * This is the key we will use to to store the conversation metadata in the
     * wicket page.
     */
-   public static final MetaDataKey CID = new MetaDataKey(String.class) {
+   public static final MetaDataKey CID = new MetaDataKey(String.class) 
+   {
       private static final long serialVersionUID = -8788010688731927318L; 
    }; 
 }

Modified: extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansRequestCycle.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansRequestCycle.java	2009-04-16 11:17:22 UTC (rev 2428)
+++ extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansRequestCycle.java	2009-04-16 11:21:41 UTC (rev 2429)
@@ -17,91 +17,100 @@
 import org.jboss.webbeans.servlet.ConversationBeanStore;
 
 /**
- * WebBeansRequestCycle is a subclass of the standard wicket WebRequestCycle which:
+ * WebBeansRequestCycle is a subclass of the standard wicket WebRequestCycle
+ * which:
  * <ul>
- * <li>restores long-running conversations specified in wicket page metadata when a page target is first used.  
- * <li>propagates long running conversations to new page targets by specifying the above metadata
- * <li>propagates long running conversations across redirects through the use of a request parameter if the
- * redirect is handled with a BookmarkablePageRequest
- * <li> Sets up the conversational context
+ * <li>restores long-running conversations specified in wicket page metadata
+ * when a page target is first used.
+ * <li>propagates long running conversations to new page targets by specifying
+ * the above metadata
+ * <li>propagates long running conversations across redirects through the use of
+ * a request parameter if the redirect is handled with a BookmarkablePageRequest
+ * <li>Sets up the conversational context
  * </ul>
- * @see WebBeansWebRequestCycleProcessor Which handles propogation of conversation data for newly-started
- * long running conversations, by storing their ids in the page metadata
+ * 
+ * @see WebBeansWebRequestCycleProcessor Which handles propogation of
+ *      conversation data for newly-started long running conversations, by
+ *      storing their ids in the page metadata
  * @author cpopetz
- *
+ * 
  */
 public class WebBeansRequestCycle extends WebRequestCycle
 {
+
    public WebBeansRequestCycle(WebApplication application, WebRequest request, Response response)
    {
       super(application, request, response);
    }
 
    /**
-    * Override to set up the conversation context and to choose the conversation if a conversation id
-    * is present in target metadata.
+    * Override to set up the conversation context and to choose the conversation
+    * if a conversation id is present in target metadata.
     */
    @Override
    protected void onRequestTargetSet(IRequestTarget target)
    {
       super.onRequestTargetSet(target);
-      
+
       Page page = null;
       if (target instanceof IPageRequestTarget)
       {
          page = ((IPageRequestTarget) target).getPage();
       }
-      
-      //Two possible specifications of cid: page metadata or request url; the latter is used
-      //to propagate the conversation to mounted (bookmarkable) paths after a redirect
-      
+
+      // Two possible specifications of cid: page metadata or request url; the
+      // latter is used to propagate the conversation to mounted (bookmarkable)
+      // paths after a redirect
+
       String specifiedCid = null;
-      if (page != null) 
+      if (page != null)
       {
          specifiedCid = (String) page.getMetaData(WebBeansMetaData.CID);
       }
-      else 
+      else
       {
          specifiedCid = request.getParameter("cid");
       }
-      
+
       Manager manager = CurrentManager.rootManager();
       Conversation conversation = manager.getInstanceByType(Conversation.class);
-      
-      //restore a conversation if it exists
+
+      // restore a conversation if it exists
       if (specifiedCid != null)
       {
          // Restore this conversation
          manager.getInstanceByType(ConversationManager.class).beginOrRestoreConversation(specifiedCid);
       }
-      
-      //handle propagation of existing long running converstaions to new targets
-      if (conversation.isLongRunning()) 
+
+      // handle propagation of existing long running converstaions to new
+      // targets
+      if (conversation.isLongRunning())
       {
-         //Note that we can't propagate conversations with other redirect targets like 
-         //RequestRedirectTarget through this mechanism, because it does not provide an 
-         //interface to modify its target URL.  If propagation with those targets is to be supported, 
-         //it needs a custom Response subclass.
+         // Note that we can't propagate conversations with other redirect
+         // targets like RequestRedirectTarget through this mechanism, because
+         // it does not provide an interface to modify its target URL. If
+         // propagation with those targets is to be supported, it needs a custom
+         // Response subclass.
          if (isRedirect() && target instanceof BookmarkablePageRequestTarget)
          {
             BookmarkablePageRequestTarget bookmark = (BookmarkablePageRequestTarget) target;
-            //if a cid has already been specified, don't override it
+            // if a cid has already been specified, don't override it
             if (!bookmark.getPageParameters().containsKey("cid"))
                bookmark.getPageParameters().add("cid", conversation.getId());
          }
-         
-         //If we have a target page, propagate the conversation to the page's metadata
+
+         // If we have a target page, propagate the conversation to the page's
+         // metadata
          if (page != null)
          {
             page.setMetaData(WebBeansMetaData.CID, conversation.getId());
          }
       }
-      
-      //Now set up the conversational context if it isn't already
+
+      // Now set up the conversational context if it isn't already
       if (!ConversationContext.INSTANCE.isActive())
       {
-         ConversationContext.INSTANCE.setBeanStore(
-               new ConversationBeanStore(((WebRequest)request).getHttpServletRequest().getSession(), conversation.getId()));
+         ConversationContext.INSTANCE.setBeanStore(new ConversationBeanStore(((WebRequest) request).getHttpServletRequest().getSession(), conversation.getId()));
          ConversationContext.INSTANCE.setActive(true);
       }
    }

Modified: extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansWebRequestCycleProcessor.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansWebRequestCycleProcessor.java	2009-04-16 11:17:22 UTC (rev 2428)
+++ extensions/trunk/wicket/src/main/java/org/jboss/webbeans/wicket/WebBeansWebRequestCycleProcessor.java	2009-04-16 11:21:41 UTC (rev 2429)
@@ -10,17 +10,19 @@
 import org.jboss.webbeans.conversation.ConversationManager;
 
 /**
- * WebBeansWebRequestCycleProcessor is a subclass of the standard wicket WebRequestCycleProcessor which saves the conversation id 
- * of any long-running cornversation in wicket page metadata.  It also cleans up the conversation context.
+ * WebBeansWebRequestCycleProcessor is a subclass of the standard wicket
+ * WebRequestCycleProcessor which saves the conversation id of any long-running
+ * cornversation in wicket page metadata. It also cleans up the conversation
+ * context.
  * 
  * @author cpopetz
- *
+ * 
  */
-
 public class WebBeansWebRequestCycleProcessor extends WebRequestCycleProcessor
 {
    /**
-    * If a long running conversation has been started, store its id into page metadata
+    * If a long running conversation has been started, store its id into page
+    * metadata
     */
    @Override
    public void respond(RequestCycle requestCycle)




More information about the weld-commits mailing list