1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.transport.jms.websphere; |
12 | |
|
13 | |
import org.mule.api.construct.FlowConstruct; |
14 | |
import org.mule.api.endpoint.InboundEndpoint; |
15 | |
import org.mule.api.lifecycle.CreateException; |
16 | |
import org.mule.api.lifecycle.InitialisationException; |
17 | |
import org.mule.api.transport.Connector; |
18 | |
import org.mule.transport.jms.XaTransactedJmsMessageReceiver; |
19 | |
|
20 | |
import javax.jms.Session; |
21 | |
|
22 | |
public class WebsphereTransactedJmsMessageReceiver extends XaTransactedJmsMessageReceiver |
23 | |
{ |
24 | |
public WebsphereTransactedJmsMessageReceiver(Connector connector, FlowConstruct flowConstruct, |
25 | |
InboundEndpoint endpoint) throws InitialisationException, CreateException |
26 | |
{ |
27 | 0 | super(connector, flowConstruct, endpoint); |
28 | 0 | } |
29 | |
|
30 | |
protected void doConnect() throws Exception |
31 | |
{ |
32 | 0 | if (connector.isConnected() && connector.isEagerConsumer()) |
33 | |
{ |
34 | 0 | createConsumer(); |
35 | |
} |
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | 0 | if (connector.isConnected() && !this.connected.get() && connector.getSessionFromTransaction() == null) |
41 | |
{ |
42 | |
|
43 | 0 | Session s = connector.getConnection().createSession(false, 1); |
44 | 0 | s.close(); |
45 | |
} |
46 | 0 | } |
47 | |
} |
48 | |
|
49 | |
|