1
2
3
4
5
6
7 package org.mule.endpoint.outbound;
8
9 import org.mule.api.MuleEvent;
10 import org.mule.api.MuleException;
11 import org.mule.api.config.MuleProperties;
12 import org.mule.api.processor.MessageProcessor;
13 import org.mule.util.ObjectUtils;
14
15
16 public class OutboundEventTimeoutMessageProcessor implements MessageProcessor
17 {
18
19 public MuleEvent process(MuleEvent event) throws MuleException
20 {
21 int timeout = event.getMessage().getOutboundProperty(MuleProperties.MULE_EVENT_TIMEOUT_PROPERTY, -1);
22 if (timeout >= 0)
23 {
24 event.setTimeout(timeout);
25 }
26 return event;
27 }
28
29 @Override
30 public String toString()
31 {
32 return ObjectUtils.toString(this);
33 }
34 }