[jboss-cvs] jboss-seam/src/main/org/jboss/seam/interceptors ...

Shane Bryzak sbryzak at redhat.com
Mon Jun 18 19:18:38 EDT 2007


  User: sbryzak2
  Date: 07/06/18 19:18:38

  Modified:    src/main/org/jboss/seam/interceptors 
                        WebServiceInterceptor.java
  Log:
  fix NPE
  
  Revision  Changes    Path
  1.6       +35 -26    jboss-seam/src/main/org/jboss/seam/interceptors/WebServiceInterceptor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: WebServiceInterceptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/interceptors/WebServiceInterceptor.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- WebServiceInterceptor.java	14 Jun 2007 16:35:13 -0000	1.5
  +++ WebServiceInterceptor.java	18 Jun 2007 23:18:38 -0000	1.6
  @@ -33,6 +33,8 @@
      @AroundInvoke
      public Object aroundInvoke(InvocationContext invocation) throws Exception
      {
  +      if (Contexts.isEventContextActive())
  +      {
         try
         {
            MessageContext messageContext = (MessageContext) Contexts.getEventContext().get(
  @@ -48,6 +50,7 @@
            
            Object result = invocation.proceed();
            
  +            messageContext.put("org.jboss.seam.conversationId", Manager.instance().getCurrentConversationId());
            Manager.instance().endRequest( new ServletRequestSessionMap(request) );
            Lifecycle.endRequest();        
            
  @@ -57,7 +60,11 @@
         {
            Lifecycle.setPhaseId(null);         
         } 
  -      
  +      }
  +      else
  +      {
  +         return invocation.proceed();         
  +      }      
      }
      
      private String extractConversationId(InvocationContext invocation)
  @@ -72,9 +79,11 @@
            {
               if (annotation.annotationType().equals(ConversationId.class))
               {
  -               Conversation conversation = method.getDeclaringClass().getAnnotation(Conversation.class);
  -               String conversationName = conversation != null ?
  -                        conversation.value() : null;
  +               Conversation conversation = method.getAnnotation(Conversation.class);
  +               if (conversation == null)
  +               {
  +                  conversation = method.getDeclaringClass().getAnnotation(Conversation.class);                  
  +               }               
                  
                  ConversationId convId = (ConversationId) annotation;
                  Object paramValue = invocation.getParameters()[i];
  @@ -93,7 +102,7 @@
                     id = paramValue.toString();
                  }
                  
  -               return (conversationName != null) ? conversationName + ":" + id : id;
  +               return (conversation != null) ? conversation.value() + ":" + id : id;
               }
            }
         }
  
  
  



More information about the jboss-cvs-commits mailing list