01: /*
02: * $Id: MuleManagedConnectionMetaData.java 10789 2008-02-12 20:04:43Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
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: * <code>MuleManagedConnectionMetaData</code> TODO
21: */
22: public class MuleManagedConnectionMetaData implements
23: ManagedConnectionMetaData {
24: private final MuleManagedConnection managedConnection;
25:
26: public MuleManagedConnectionMetaData(MuleManagedConnection mc) {
27: this .managedConnection = mc;
28: }
29:
30: public String getEISProductName() throws ResourceException {
31: return MuleManifest.getVendorName();
32: }
33:
34: public String getEISProductVersion() throws ResourceException {
35: return MuleManifest.getProductVersion();
36: }
37:
38: // TODO
39: public int getMaxConnections() throws ResourceException {
40: return 0;
41: }
42:
43: public String getUserName() throws ResourceException {
44: if (managedConnection.isDestroyed()) {
45: throw new IllegalStateException(JcaMessages
46: .objectIsDisposed(managedConnection).toString());
47: }
48: return managedConnection.getUsername();
49: }
50: }
|