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