Coverage Report - org.mule.config.spring.ServerNotificationManagerConfigurator
 
Classes in this File Line Coverage Branch Coverage Complexity
ServerNotificationManagerConfigurator
0%
0/25
0%
0/8
1.4
 
 1  
 /*
 2  
  * $Id: ServerNotificationManagerConfigurator.java 11549 2008-04-09 05:12:30Z 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.config.spring;
 12  
 
 13  
 import org.mule.api.MuleContext;
 14  
 import org.mule.api.context.MuleContextAware;
 15  
 import org.mule.context.notification.ServerNotificationManager;
 16  
 
 17  
 import java.util.Collection;
 18  
 import java.util.Map;
 19  
 
 20  
 import org.springframework.beans.factory.SmartFactoryBean;
 21  
 
 22  0
 public class ServerNotificationManagerConfigurator implements MuleContextAware, SmartFactoryBean
 23  
 {
 24  
 
 25  
     private MuleContext muleContext;
 26  
 
 27  
     private Boolean dynamic;
 28  
     private Map interfaceToEvents;
 29  
     private Collection interfaces;
 30  
     private Collection pairs;
 31  
 
 32  
     public void setMuleContext(MuleContext context)
 33  
     {
 34  0
         this.muleContext = context;
 35  0
     }
 36  
 
 37  
     public Object getObject() throws Exception
 38  
     {
 39  0
         ServerNotificationManager notificationManager = muleContext.getNotificationManager();
 40  0
         if (dynamic != null)
 41  
         {
 42  0
             notificationManager.setNotificationDynamic(dynamic.booleanValue());
 43  
         }
 44  0
         if (interfaceToEvents != null)
 45  
         {
 46  0
             notificationManager.setInterfaceToTypes(interfaceToEvents);
 47  
         }
 48  0
         if (interfaces != null)
 49  
         {
 50  0
             notificationManager.setDisabledInterfaces(interfaces);
 51  
         }
 52  0
         if (pairs != null)
 53  
         {
 54  0
             notificationManager.setAllListenerSubscriptionPairs(pairs);
 55  
         }
 56  0
         return notificationManager;
 57  
     }
 58  
 
 59  
     public Class getObjectType()
 60  
     {
 61  0
         return ServerNotificationManager.class;
 62  
     }
 63  
 
 64  
     public boolean isSingleton()
 65  
     {
 66  0
         return true;
 67  
     }
 68  
 
 69  
     public void setNotificationDynamic(boolean dynamic)
 70  
     {
 71  0
         this.dynamic = new Boolean(dynamic);
 72  0
     }
 73  
 
 74  
     public void setInterfaceToTypes(Map interfaceToEvents) throws ClassNotFoundException
 75  
     {
 76  0
         this.interfaceToEvents = interfaceToEvents;
 77  0
     }
 78  
 
 79  
     public void setAllListenerSubscriptionPairs(Collection pairs)
 80  
     {
 81  0
         this.pairs = pairs;
 82  0
     }
 83  
 
 84  
     public void setDisabledInterfaces(Collection interfaces) throws ClassNotFoundException
 85  
     {
 86  0
         this.interfaces = interfaces;
 87  0
     }
 88  
 
 89  
     public boolean isEagerInit()
 90  
     {
 91  0
         return true;
 92  
     }
 93  
 
 94  
     public boolean isPrototype()
 95  
     {
 96  0
         return false;
 97  
     }
 98  
 
 99  
 }