Coverage Report - org.mule.module.spring.events.MuleApplicationEvent
 
Classes in this File Line Coverage Branch Coverage Complexity
MuleApplicationEvent
0%
0/18
N/A
1
 
 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.module.spring.events;
 8  
 
 9  
 import org.mule.api.MuleEventContext;
 10  
 import org.mule.api.endpoint.MalformedEndpointException;
 11  
 
 12  
 import java.util.Collections;
 13  
 import java.util.HashMap;
 14  
 import java.util.Map;
 15  
 
 16  
 import org.springframework.context.ApplicationContext;
 17  
 import org.springframework.context.ApplicationEvent;
 18  
 
 19  
 /**
 20  
  * <code>MuleApplicationEvent</code> is an Spring ApplicationEvent used to wrap a
 21  
  * DefaultMuleEvent
 22  
  */
 23  
 
 24  
 public class MuleApplicationEvent extends ApplicationEvent
 25  
 {
 26  
     /**
 27  
      * Serial version
 28  
      */
 29  
     private static final long serialVersionUID = 5297176859050194632L;
 30  
 
 31  
     private final MuleEventContext context;
 32  
     private final String endpoint;
 33  
     private final ApplicationContext applicationContext;
 34  0
     private final Map properties = Collections.synchronizedMap(new HashMap());
 35  
 
 36  
     public MuleApplicationEvent(Object message, String endpoint)
 37  
     {
 38  0
         super(message);
 39  0
         this.endpoint = endpoint;
 40  0
         this.applicationContext = null;
 41  0
         this.context = null;
 42  0
     }
 43  
 
 44  
     MuleApplicationEvent(Object message, MuleEventContext context, ApplicationContext appContext)
 45  
         throws MalformedEndpointException
 46  
     {
 47  0
         super(message);
 48  0
         this.context = context;
 49  0
         this.endpoint = context.getEndpointURI().toString();
 50  0
         this.applicationContext = appContext;
 51  0
     }
 52  
 
 53  
     public MuleEventContext getMuleEventContext()
 54  
     {
 55  0
         return context;
 56  
     }
 57  
 
 58  
     public String getEndpoint()
 59  
     {
 60  0
         return endpoint;
 61  
     }
 62  
 
 63  
     public ApplicationContext getApplicationContext()
 64  
     {
 65  0
         return applicationContext;
 66  
     }
 67  
 
 68  
     public Map getProperties()
 69  
     {
 70  0
         return properties;
 71  
     }
 72  
 
 73  
     public void setProperty(Object key, Object value)
 74  
     {
 75  0
         this.properties.put(key, value);
 76  0
     }
 77  
 
 78  
     public Object getProperty(Object key)
 79  
     {
 80  0
         return properties.get(key);
 81  
     }
 82  
 
 83  
 }