[jboss-cvs] jboss-seam/src/remoting/org/jboss/seam/remoting ...

Gavin King gavin.king at jboss.com
Wed Jun 20 04:23:19 EDT 2007


  User: gavin   
  Date: 07/06/20 04:23:19

  Modified:    src/remoting/org/jboss/seam/remoting     
                        ExecutionHandler.java InterfaceGenerator.java
                        PollHandler.java Remoting.java
                        SubscriptionHandler.java
  Log:
  split up Lifecycle, much better
  
  Revision  Changes    Path
  1.6       +1 -10     jboss-seam/src/remoting/org/jboss/seam/remoting/ExecutionHandler.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ExecutionHandler.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/remoting/org/jboss/seam/remoting/ExecutionHandler.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- ExecutionHandler.java	13 Jun 2007 21:10:14 -0000	1.5
  +++ ExecutionHandler.java	20 Jun 2007 08:23:19 -0000	1.6
  @@ -6,7 +6,6 @@
   import java.util.Iterator;
   import java.util.List;
   
  -import javax.servlet.ServletContext;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
   
  @@ -38,14 +37,6 @@
     private static final byte[] CONTEXT_TAG_OPEN = "<context>".getBytes();
     private static final byte[] CONTEXT_TAG_CLOSE = "</context>".getBytes();
   
  -  private ServletContext servletContext;
  -
  -  @Override
  -  public void setServletContext(ServletContext ctx)
  -  {
  -    this.servletContext = ctx;
  -  }
  -
     /**
      * The entry point for handling a request.
      *
  @@ -66,7 +57,7 @@
         final RequestContext ctx = unmarshalContext(env);
         final List<Call> calls = unmarshalCalls(env);
   
  -      new ContextualHttpServletRequest(request, servletContext)
  +      new ContextualHttpServletRequest(request)
         {
            
            @Override
  
  
  
  1.7       +1 -10     jboss-seam/src/remoting/org/jboss/seam/remoting/InterfaceGenerator.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: InterfaceGenerator.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/remoting/org/jboss/seam/remoting/InterfaceGenerator.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- InterfaceGenerator.java	19 Jun 2007 20:11:06 -0000	1.6
  +++ InterfaceGenerator.java	20 Jun 2007 08:23:19 -0000	1.7
  @@ -17,7 +17,6 @@
   import java.util.Map;
   import java.util.Set;
   
  -import javax.servlet.ServletContext;
   import javax.servlet.ServletException;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
  @@ -53,14 +52,6 @@
      */
     private Map<String,byte[]> interfaceCache = new HashMap<String,byte[]>();
   
  -  private ServletContext servletContext;
  -
  -  @Override
  -  public void setServletContext(ServletContext ctx)
  -  {
  -    this.servletContext = ctx;
  -  }
  -
     /**
      *
      * @param request HttpServletRequest
  @@ -70,7 +61,7 @@
     public void handle(final HttpServletRequest request, final HttpServletResponse response)
         throws Exception
     {
  -     new ContextualHttpServletRequest(request, servletContext)
  +     new ContextualHttpServletRequest(request)
        {
           @Override
           public void process() throws Exception
  
  
  
  1.6       +1 -10     jboss-seam/src/remoting/org/jboss/seam/remoting/PollHandler.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: PollHandler.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/remoting/org/jboss/seam/remoting/PollHandler.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- PollHandler.java	13 Jun 2007 23:42:47 -0000	1.5
  +++ PollHandler.java	20 Jun 2007 08:23:19 -0000	1.6
  @@ -9,7 +9,6 @@
   import javax.jms.Message;
   import javax.jms.ObjectMessage;
   import javax.jms.TextMessage;
  -import javax.servlet.ServletContext;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
   
  @@ -50,14 +49,6 @@
     private static final byte[] VALUE_TAG_OPEN = "<value>".getBytes();
     private static final byte[] VALUE_TAG_CLOSE = "</value>".getBytes();
   
  -  private ServletContext servletContext;
  -
  -  @Override
  -  public void setServletContext(ServletContext ctx)
  -  {
  -    this.servletContext = ctx;
  -  }
  -
     public void handle(HttpServletRequest request, final HttpServletResponse response)
         throws Exception
     {
  @@ -71,7 +62,7 @@
   
       final List<PollRequest> polls = unmarshalRequests(env);
   
  -    new ContextualHttpServletRequest(request, servletContext)
  +    new ContextualHttpServletRequest(request)
       {
          @Override
          public void process() throws Exception
  
  
  
  1.3       +3 -3      jboss-seam/src/remoting/org/jboss/seam/remoting/Remoting.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Remoting.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/remoting/org/jboss/seam/remoting/Remoting.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- Remoting.java	10 Jun 2007 19:26:00 -0000	1.2
  +++ Remoting.java	20 Jun 2007 08:23:19 -0000	1.3
  @@ -20,7 +20,7 @@
   import org.jboss.seam.annotations.Name;
   import org.jboss.seam.annotations.Scope;
   import org.jboss.seam.annotations.Startup;
  -import org.jboss.seam.contexts.Lifecycle;
  +import org.jboss.seam.contexts.ServletLifecycle;
   import org.jboss.seam.log.LogProvider;
   import org.jboss.seam.log.Logging;
   import org.jboss.seam.servlet.AbstractResource;
  @@ -65,7 +65,7 @@
         {
            try
            {
  -            Lifecycle.beginRequest( getServletContext(), request );
  +            ServletLifecycle.beginRequest(request);
   
               StringBuilder sb = new StringBuilder();
               sb.append("\nSeam.Remoting.resourcePath = \"");
  @@ -87,7 +87,7 @@
            }
            finally
            {
  -            Lifecycle.endRequest(request);
  +            ServletLifecycle.endRequest(request);
            }
         }
      }   
  
  
  
  1.5       +3 -14     jboss-seam/src/remoting/org/jboss/seam/remoting/SubscriptionHandler.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SubscriptionHandler.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/remoting/org/jboss/seam/remoting/SubscriptionHandler.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- SubscriptionHandler.java	19 Jun 2007 20:11:06 -0000	1.4
  +++ SubscriptionHandler.java	20 Jun 2007 08:23:19 -0000	1.5
  @@ -5,8 +5,6 @@
   import java.util.ArrayList;
   import java.util.List;
   
  -import javax.faces.event.PhaseId;
  -import javax.servlet.ServletContext;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
   
  @@ -14,6 +12,7 @@
   import org.dom4j.Element;
   import org.dom4j.io.SAXReader;
   import org.jboss.seam.contexts.Lifecycle;
  +import org.jboss.seam.contexts.ServletLifecycle;
   import org.jboss.seam.core.Manager;
   import org.jboss.seam.remoting.messaging.RemoteSubscriber;
   import org.jboss.seam.remoting.messaging.SubscriptionRegistry;
  @@ -27,14 +26,6 @@
   public class SubscriptionHandler extends BaseRequestHandler implements RequestHandler
   {
   
  -  private ServletContext servletContext;
  -
  -  @Override
  -  public void setServletContext(ServletContext ctx)
  -  {
  -    this.servletContext = ctx;
  -  }
  -
     /**
      * The entry point for handling a request.
      *
  @@ -64,14 +55,13 @@
         requests.add(new SubscriptionRequest(e.attributeValue("topic")));
       }
   
  +    ServletLifecycle.beginRequest(request);
       try
       {
  -      Lifecycle.setPhaseId(PhaseId.INVOKE_APPLICATION);
  -      Lifecycle.beginRequest(servletContext, request);
         ServletContexts.instance().setRequest(request);
   
         Manager.instance().initializeTemporaryConversation();
  -      Lifecycle.resumeConversation(request);
  +      ServletLifecycle.resumeConversation(request);
   
         for (SubscriptionRequest req : requests)
         {
  @@ -100,7 +90,6 @@
       finally
       {
         Lifecycle.endRequest();
  -      Lifecycle.setPhaseId(null);
       }
   
       // Package up the response
  
  
  



More information about the jboss-cvs-commits mailing list