Author: struberg
Date: Tue May 18 13:00:42 2010
New Revision: 945635

URL: http://svn.apache.org/viewvc?rev=945635&view=rev
Log:
OWB-377 fix logging

Modified:
    
openwebbeans/trunk/webbeans-jsf/src/main/java/org/apache/webbeans/jsf/WebBeansPhaseListener.java
    
openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/WebBeansPhaseListener.java

Modified: 
openwebbeans/trunk/webbeans-jsf/src/main/java/org/apache/webbeans/jsf/WebBeansPhaseListener.java
URL: 
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jsf/src/main/java/org/apache/webbeans/jsf/WebBeansPhaseListener.java?rev=945635&r1=945634&r2=945635&view=diff
==============================================================================
--- 
openwebbeans/trunk/webbeans-jsf/src/main/java/org/apache/webbeans/jsf/WebBeansPhaseListener.java
 (original)
+++ 
openwebbeans/trunk/webbeans-jsf/src/main/java/org/apache/webbeans/jsf/WebBeansPhaseListener.java
 Tue May 18 13:00:42 2010
@@ -48,12 +48,12 @@ public class WebBeansPhaseListener imple
         if (phaseEvent.getPhaseId().equals(PhaseId.RENDER_RESPONSE) ||
                 JSFUtil.getCurrentFacesContext().getResponseComplete())
         {
-               ConversationManager conversationManager = 
ConversationManager.getInstance();
-               Conversation conversation = 
conversationManager.getConversationBeanReference();
-               
+            ConversationManager conversationManager = 
ConversationManager.getInstance();
+            Conversation conversation = 
conversationManager.getConversationBeanReference();
+
             if (conversation.isTransient())
             {
-                logger.debug(OWBLogConst.INFO_0014, new 
Object[]{conversation.getId()});
+                logger.debug(OWBLogConst.INFO_0014, conversation.getId());
                 ContextFactory.destroyConversationContext();                   
                                 
             }
             else
@@ -77,39 +77,39 @@ public class WebBeansPhaseListener imple
             //It looks for cid parameter in the JSF request.
             //If request contains cid, then it must restore conversation
             //Otherwise create NonexistentException
-               ConversationManager conversationManager = 
ConversationManager.getInstance();
-               Conversation conversation = 
conversationManager.getConversationBeanReference();
-               String cid = JSFUtil.getConversationId();
-               
-                       if (conversation.isTransient())
-                       {
-                               logger.debug(OWBLogConst.INFO_0016, new 
Object[]{conversation.getId()});
-                               ContextFactory.initConversationContext(null);
-                               
-                   //Not restore, throw exception
-                               if(cid != null && !cid.equals(""))
-                               {
-                                   throw new 
NonexistentConversationException("Propogated conversation with cid=" + cid + " 
is not restored. It creates a new transient conversation.");
-                               }
-                       }
-                       else
-                       {
-                               logger.debug(OWBLogConst.INFO_0015, new 
Object[]{conversation.getId()});
-                               
-                               //Conversation must be used by one thread at a 
time
-                               ConversationImpl owbConversation = 
(ConversationImpl)conversation;
-                               
if(!owbConversation.getInUsed().compareAndSet(false, true))
-                               {                                   
-                                   
ContextFactory.initConversationContext(null);
-                                   //Throw Busy exception
-                                   throw new 
BusyConversationException("Propogated conversation with cid=" + cid + " is used 
by other request. It creates a new transient conversation");
-                               }
-                               else
-                               {
-                      ConversationContext conversationContext = 
conversationManager.getConversationContext(conversation);
-                      
ContextFactory.initConversationContext(conversationContext);
-                               }                               
-                       }
+            ConversationManager conversationManager = 
ConversationManager.getInstance();
+            Conversation conversation = 
conversationManager.getConversationBeanReference();
+            String cid = JSFUtil.getConversationId();
+
+            if (conversation.isTransient())
+            {
+                logger.debug(OWBLogConst.INFO_0016, conversation.getId());
+                ContextFactory.initConversationContext(null);
+
+                //Not restore, throw exception
+                if(cid != null && !cid.equals(""))
+                {
+                    throw new NonexistentConversationException("Propogated 
conversation with cid=" + cid + " is not restored. It creates a new transient 
conversation.");
+                }
+            }
+            else
+            {
+                logger.debug(OWBLogConst.INFO_0015, conversation.getId());
+
+                //Conversation must be used by one thread at a time
+                ConversationImpl owbConversation = 
(ConversationImpl)conversation;
+                if(!owbConversation.getInUsed().compareAndSet(false, true))
+                {
+                    ContextFactory.initConversationContext(null);
+                    //Throw Busy exception
+                    throw new BusyConversationException("Propogated 
conversation with cid=" + cid + " is used by other request. It creates a new 
transient conversation");
+                }
+                else
+                {
+                    ConversationContext conversationContext = 
conversationManager.getConversationContext(conversation);
+                    
ContextFactory.initConversationContext(conversationContext);
+                }
+            }
         }
     }
 

Modified: 
openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/WebBeansPhaseListener.java
URL: 
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/WebBeansPhaseListener.java?rev=945635&r1=945634&r2=945635&view=diff
==============================================================================
--- 
openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/WebBeansPhaseListener.java
 (original)
+++ 
openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/WebBeansPhaseListener.java
 Tue May 18 13:00:42 2010
@@ -48,12 +48,12 @@ public class WebBeansPhaseListener imple
         if (phaseEvent.getPhaseId().equals(PhaseId.RENDER_RESPONSE) ||
                 JSFUtil.getCurrentFacesContext().getResponseComplete())
         {
-               ConversationManager conversationManager = 
ConversationManager.getInstance();
-               Conversation conversation = 
conversationManager.getConversationBeanReference();
-               
+            ConversationManager conversationManager = 
ConversationManager.getInstance();
+            Conversation conversation = 
conversationManager.getConversationBeanReference();
+
             if (conversation.isTransient())
             {
-                logger.debug(OWBLogConst.INFO_0014, new 
Object[]{conversation.getId()});
+                logger.debug(OWBLogConst.INFO_0014, conversation.getId());
                 ContextFactory.destroyConversationContext();                   
                                 
             }
             else
@@ -77,39 +77,39 @@ public class WebBeansPhaseListener imple
             //It looks for cid parameter in the JSF request.
             //If request contains cid, then it must restore conversation
             //Otherwise create NonexistentException
-               ConversationManager conversationManager = 
ConversationManager.getInstance();
-               Conversation conversation = 
conversationManager.getConversationBeanReference();
-               String cid = JSFUtil.getConversationId();
-               
-                       if (conversation.isTransient())
-                       {
-                               logger.debug(OWBLogConst.INFO_0016, new 
Object[]{conversation.getId()});
-                               ContextFactory.initConversationContext(null);
-                               
-                   //Not restore, throw exception
-                               if(cid != null && !cid.equals(""))
-                               {
-                                   throw new 
NonexistentConversationException("Propogated conversation with cid=" + cid + " 
is not restored. It creates a new transient conversation.");
-                               }
-                       }
-                       else
-                       {
-                               logger.debug(OWBLogConst.INFO_0015, new 
Object[]{conversation.getId()});
-                               
-                               //Conversation must be used by one thread at a 
time
-                               ConversationImpl owbConversation = 
(ConversationImpl)conversation;
-                               
if(!owbConversation.getInUsed().compareAndSet(false, true))
-                               {                                   
-                                   
ContextFactory.initConversationContext(null);
-                                   //Throw Busy exception
-                                   throw new 
BusyConversationException("Propogated conversation with cid=" + cid + " is used 
by other request. It creates a new transient conversation");
-                               }
-                               else
-                               {
-                      ConversationContext conversationContext = 
conversationManager.getConversationContext(conversation);
-                      
ContextFactory.initConversationContext(conversationContext);
-                               }                               
-                       }
+            ConversationManager conversationManager = 
ConversationManager.getInstance();
+            Conversation conversation = 
conversationManager.getConversationBeanReference();
+            String cid = JSFUtil.getConversationId();
+
+            if (conversation.isTransient())
+            {
+                logger.debug(OWBLogConst.INFO_0016, conversation.getId());
+                ContextFactory.initConversationContext(null);
+
+                //Not restore, throw exception
+                if(cid != null && !cid.equals(""))
+                {
+                    throw new NonexistentConversationException("Propogated 
conversation with cid=" + cid + " is not restored. It creates a new transient 
conversation.");
+                }
+            }
+            else
+            {
+                logger.debug(OWBLogConst.INFO_0015, conversation.getId());
+
+                //Conversation must be used by one thread at a time
+                ConversationImpl owbConversation = 
(ConversationImpl)conversation;
+                if(!owbConversation.getInUsed().compareAndSet(false, true))
+                {
+                    ContextFactory.initConversationContext(null);
+                    //Throw Busy exception
+                    throw new BusyConversationException("Propogated 
conversation with cid=" + cid + " is used by other request. It creates a new 
transient conversation");
+                }
+                else
+                {
+                    ConversationContext conversationContext = 
conversationManager.getConversationContext(conversation);
+                    
ContextFactory.initConversationContext(conversationContext);
+                }
+            }
         }
     }
 


Reply via email to