1 10 11 package org.mule.extras.spring.events; 12 13 import java.util.Collections ; 14 import java.util.HashMap ; 15 import java.util.Map ; 16 17 import org.mule.umo.UMOEventContext; 18 import org.mule.umo.endpoint.MalformedEndpointException; 19 import org.springframework.context.ApplicationContext; 20 import org.springframework.context.ApplicationEvent; 21 22 26 27 public class MuleApplicationEvent extends ApplicationEvent 28 { 29 32 private static final long serialVersionUID = 5297176859050194632L; 33 34 private final UMOEventContext context; 35 private final String endpoint; 36 private final ApplicationContext applicationContext; 37 private final Map properties = Collections.synchronizedMap(new HashMap ()); 38 39 public MuleApplicationEvent(Object message, String endpoint) 40 { 41 super(message); 42 this.endpoint = endpoint; 43 this.applicationContext = null; 44 this.context = null; 45 } 46 47 MuleApplicationEvent(Object message, UMOEventContext context, ApplicationContext appContext) 48 throws MalformedEndpointException 49 { 50 super(message); 51 this.context = context; 52 this.endpoint = context.getEndpointURI().toString(); 53 this.applicationContext = appContext; 54 } 55 56 public UMOEventContext getMuleEventContext() 57 { 58 return context; 59 } 60 61 public String getEndpoint() 62 { 63 return endpoint; 64 } 65 66 public ApplicationContext getApplicationContext() 67 { 68 return applicationContext; 69 } 70 71 public Map getProperties() 72 { 73 return properties; 74 } 75 76 public void setProperty(Object key, Object value) 77 { 78 this.properties.put(key, value); 79 } 80 81 public Object getProperty(Object key) 82 { 83 return properties.get(key); 84 } 85 86 } 87 | Popular Tags |