1
2
3
4
5
6
7
8 package it.imolinfo.jbi4corba.jbi.processor;
9
10 import it.imolinfo.jbi4corba.Logger;
11 import it.imolinfo.jbi4corba.LoggerFactory;
12 import it.imolinfo.jbi4corba.jbi.Messages;
13
14 import it.imolinfo.jbi4corba.jbi.endpoint.ConsumerEndpoint;
15
16 import javax.jbi.messaging.MessageExchange;
17
18
19
20
21
22
23
24
25 public class ConsumerExchangeProcessor implements ExchangeProcessor {
26
27
28
29
30 private static final transient Logger LOG
31 = LoggerFactory.getLogger(ConsumerExchangeProcessor.class);
32 private static final Messages MESSAGES =
33 Messages.getMessages(ConsumerExchangeProcessor.class);
34
35
36
37
38
39 ConsumerEndpoint consumerEndpoint;
40
41
42
43
44
45 public ConsumerExchangeProcessor(ConsumerEndpoint consumerEndpoint) {
46 this.consumerEndpoint = consumerEndpoint;
47 }
48
49
50
51
52
53
54 public void process(MessageExchange messageExchange) {
55
56 LOG.debug("process - MessageExchange=" + messageExchange);
57
58 try {
59 if (messageExchange != null) {
60 consumerEndpoint.getConsumerServiceDescriptor()
61 .getConsumerInvocationHandler().process(messageExchange);
62 } else {
63 LOG.debug("process - No Operations to do.");
64 }
65 } catch (Exception ex) {
66 String msg=MESSAGES.getString("CRB000800_Error_in_message_exchange",
67 new Object[] {ex.getMessage()});
68 LOG.error(msg);
69
70 }
71 }
72
73 }