|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
MessageBuilder.java | - | 100% | 100% | 100% |
|
1 |
package com.diasparsoftware.javax.jms;
|
|
2 |
|
|
3 |
import java.util.Map;
|
|
4 |
|
|
5 |
import javax.jms.*;
|
|
6 |
|
|
7 |
import com.diasparsoftware.java.util.*;
|
|
8 |
|
|
9 |
public class MessageBuilder { |
|
10 | 32 |
public void buildMapMessage( |
11 |
final MapMessage mapMessage, |
|
12 |
Map messageContent) { |
|
13 |
|
|
14 | 32 |
try {
|
15 | 32 |
CollectionUtil |
16 |
.forEachDo( |
|
17 |
messageContent, |
|
18 |
new ExceptionalMapEntryClosure() {
|
|
19 |
|
|
20 | 72 |
protected void eachMapEntry(Object key, Object value) |
21 |
throws JMSException {
|
|
22 |
|
|
23 | 72 |
mapMessage.setObject((String) key, value); |
24 |
} |
|
25 |
}); |
|
26 |
} |
|
27 |
catch (Exception e) {
|
|
28 | 8 |
throw new MessagingException( |
29 |
"Unable to build message from " + messageContent,
|
|
30 |
e); |
|
31 |
} |
|
32 |
} |
|
33 |
} |
|
34 |
|
|