Coverage Report - org.mule.transport.jms.ReusableSessionWrapperFactory
 
Classes in this File Line Coverage Branch Coverage Complexity
ReusableSessionWrapperFactory
0%
0/8
0%
0/6
8
 
 1  
 /*
 2  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 6  
  */
 7  
 package org.mule.transport.jms;
 8  
 
 9  
 import javax.jms.QueueSession;
 10  
 import javax.jms.Session;
 11  
 import javax.jms.TopicSession;
 12  
 
 13  0
 public class ReusableSessionWrapperFactory
 14  
 {
 15  
 
 16  
     public static Session createWrapper(Session session)
 17  
     {
 18  0
         if (session instanceof TopicSession)
 19  
         {
 20  0
             return new ReusableTopicSessionWrapper((TopicSession) session);
 21  
         }
 22  0
         else if (session instanceof QueueSession)
 23  
         {
 24  0
             return new ReusableQueueSessionWrapper((javax.jms.QueueSession) session);
 25  
         }
 26  0
         else if (session instanceof Session)
 27  
         {
 28  0
             return new ReusableSessionWrapper(session);
 29  
         }
 30  
         else
 31  
         {
 32  0
             throw new IllegalArgumentException("session type " + session.getClass() + " no supported as reusable");
 33  
         }
 34  
     }
 35  
 
 36  
 }