1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.module.jca; |
12 | |
|
13 | |
import org.mule.config.MuleManifest; |
14 | |
import org.mule.module.jca.i18n.JcaMessages; |
15 | |
|
16 | |
import javax.resource.ResourceException; |
17 | |
import javax.resource.spi.ManagedConnectionMetaData; |
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
public class MuleManagedConnectionMetaData implements ManagedConnectionMetaData |
23 | |
{ |
24 | |
private final MuleManagedConnection managedConnection; |
25 | |
|
26 | |
public MuleManagedConnectionMetaData(MuleManagedConnection mc) |
27 | 0 | { |
28 | 0 | this.managedConnection = mc; |
29 | 0 | } |
30 | |
|
31 | |
public String getEISProductName() throws ResourceException |
32 | |
{ |
33 | 0 | return MuleManifest.getVendorName(); |
34 | |
} |
35 | |
|
36 | |
public String getEISProductVersion() throws ResourceException |
37 | |
{ |
38 | 0 | return MuleManifest.getProductVersion(); |
39 | |
} |
40 | |
|
41 | |
|
42 | |
public int getMaxConnections() throws ResourceException |
43 | |
{ |
44 | 0 | return 0; |
45 | |
} |
46 | |
|
47 | |
public String getUserName() throws ResourceException |
48 | |
{ |
49 | 0 | if (managedConnection.isDestroyed()) |
50 | |
{ |
51 | 0 | throw new IllegalStateException( |
52 | |
JcaMessages.objectIsDisposed(managedConnection).toString()); |
53 | |
} |
54 | 0 | return managedConnection.getUsername(); |
55 | |
} |
56 | |
} |