Coverage Report - org.mule.providers.soap.axis.extensions.AxisMuleSession
 
Classes in this File Line Coverage Branch Coverage Complexity
AxisMuleSession
15%
4/26
N/A
1
 
 1  
 /*
 2  
  * $Id: AxisMuleSession.java 7963 2007-08-21 08:53:15Z dirk.olmes $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 package org.mule.providers.soap.axis.extensions;
 11  
 
 12  
 import org.mule.umo.UMOSession;
 13  
 
 14  
 import java.util.Enumeration;
 15  
 
 16  
 import org.apache.axis.session.Session;
 17  
 import org.apache.commons.collections.iterators.IteratorEnumeration;
 18  
 
 19  
 /**
 20  
  * Provides an adapter to a MuleSession so that Axis can write to the session
 21  
  */
 22  
 public class AxisMuleSession implements Session
 23  
 {
 24  
 
 25  
     private UMOSession session;
 26  160
     private Object lock = new Object();
 27  
 
 28  
     public AxisMuleSession(UMOSession session)
 29  160
     {
 30  160
         this.session = session;
 31  160
     }
 32  
 
 33  
     public Object get(String string)
 34  
     {
 35  0
         synchronized(lock)
 36  
         {
 37  0
             return session.getProperty(string);
 38  0
         }
 39  
     }
 40  
 
 41  
     public void set(String string, Object object)
 42  
     {
 43  0
         synchronized(lock)
 44  
         {
 45  0
             session.setProperty(string, object);
 46  0
         }
 47  0
     }
 48  
 
 49  
     public void remove(String string)
 50  
     {
 51  0
         synchronized(lock)
 52  
         {
 53  0
             session.removeProperty(string);
 54  0
         }
 55  0
     }
 56  
 
 57  
     public Enumeration getKeys()
 58  
     {
 59  0
         synchronized(lock)
 60  
         {
 61  0
             return new IteratorEnumeration(session.getPropertyNames());
 62  0
         }
 63  
     }
 64  
 
 65  
     public void setTimeout(int i)
 66  
     {
 67  
          // TODO not supported
 68  0
     }
 69  
 
 70  
     public int getTimeout()
 71  
     {
 72  0
         return 0;
 73  
     }
 74  
 
 75  
     public void touch()
 76  
     {
 77  
         // nothing here to touch
 78  0
     }
 79  
 
 80  
     public void invalidate()
 81  
     {
 82  0
         synchronized(lock)
 83  
         {
 84  0
             session.setValid(false);
 85  0
         }
 86  0
     }
 87  
 
 88  
     public Object getLockObject()
 89  
     {
 90  0
         return lock;
 91  
     }
 92  
 }