Coverage Report - org.mule.providers.KeyedPoolMessageDispatcherFactoryAdapter
 
Classes in this File Line Coverage Branch Coverage Complexity
KeyedPoolMessageDispatcherFactoryAdapter
0%
0/22
0%
0/1
1.167
 
 1  
 /*
 2  
  * $Id: KeyedPoolMessageDispatcherFactoryAdapter.java 7976 2007-08-21 14:26:13Z 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  
 
 11  
 package org.mule.providers;
 12  
 
 13  
 import org.mule.config.i18n.CoreMessages;
 14  
 import org.mule.umo.UMOException;
 15  
 import org.mule.umo.endpoint.UMOImmutableEndpoint;
 16  
 import org.mule.umo.provider.UMOMessageDispatcher;
 17  
 import org.mule.umo.provider.UMOMessageDispatcherFactory;
 18  
 
 19  
 import org.apache.commons.pool.KeyedPoolableObjectFactory;
 20  
 
 21  
 /**
 22  
  * <code>KeyedPoolMessageDispatcherFactoryAdapter</code> adapts a
 23  
  * <code>UMOMessageDispatcherFactory</code> with methods from commons-pool
 24  
  * <code>KeyedPoolableObjectFactory</code>. It is only required for dispatcher
 25  
  * factories that do not inherit from <code>AbstractMessageDispatcherFactory</code>.
 26  
  * 
 27  
  * @see AbstractMessageDispatcherFactory
 28  
  */
 29  
 public class KeyedPoolMessageDispatcherFactoryAdapter
 30  
     implements UMOMessageDispatcherFactory, KeyedPoolableObjectFactory
 31  
 {
 32  
     private final UMOMessageDispatcherFactory factory;
 33  
 
 34  
     public KeyedPoolMessageDispatcherFactoryAdapter(UMOMessageDispatcherFactory factory)
 35  
     {
 36  0
         super();
 37  
 
 38  0
         if (factory == null)
 39  
         {
 40  0
             throw new IllegalArgumentException(CoreMessages.objectIsNull("factory").toString());
 41  
         }
 42  
 
 43  0
         this.factory = factory;
 44  0
     }
 45  
 
 46  
     public void activateObject(Object key, Object obj) throws Exception
 47  
     {
 48  0
         factory.activate((UMOImmutableEndpoint) key, (UMOMessageDispatcher) obj);
 49  0
     }
 50  
 
 51  
     public void destroyObject(Object key, Object obj) throws Exception
 52  
     {
 53  0
         factory.destroy((UMOImmutableEndpoint) key, (UMOMessageDispatcher) obj);
 54  0
     }
 55  
 
 56  
     public Object makeObject(Object key) throws Exception
 57  
     {
 58  0
         return factory.create((UMOImmutableEndpoint) key);
 59  
     }
 60  
 
 61  
     public void passivateObject(Object key, Object obj) throws Exception
 62  
     {
 63  0
         factory.passivate((UMOImmutableEndpoint) key, (UMOMessageDispatcher) obj);
 64  0
     }
 65  
 
 66  
     public boolean validateObject(Object key, Object obj)
 67  
     {
 68  0
         return factory.validate((UMOImmutableEndpoint) key, (UMOMessageDispatcher) obj);
 69  
     }
 70  
 
 71  
     public boolean isCreateDispatcherPerRequest()
 72  
     {
 73  0
         return factory.isCreateDispatcherPerRequest();
 74  
     }
 75  
 
 76  
     public UMOMessageDispatcher create(UMOImmutableEndpoint endpoint) throws UMOException
 77  
     {
 78  0
         return factory.create(endpoint);
 79  
     }
 80  
 
 81  
     public void activate(UMOImmutableEndpoint endpoint, UMOMessageDispatcher dispatcher) throws UMOException
 82  
     {
 83  0
         factory.activate(endpoint, dispatcher);
 84  0
     }
 85  
 
 86  
     public void destroy(UMOImmutableEndpoint endpoint, UMOMessageDispatcher dispatcher)
 87  
     {
 88  0
         factory.destroy(endpoint, dispatcher);
 89  0
     }
 90  
 
 91  
     public void passivate(UMOImmutableEndpoint endpoint, UMOMessageDispatcher dispatcher)
 92  
     {
 93  0
         factory.passivate(endpoint, dispatcher);
 94  0
     }
 95  
 
 96  
     public boolean validate(UMOImmutableEndpoint endpoint, UMOMessageDispatcher dispatcher)
 97  
     {
 98  0
         return factory.validate(endpoint, dispatcher);
 99  
     }
 100  
 
 101  
 }