KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > ra > MuleManagedConnectionMetaData


1 /*
2  * $Id: MuleManagedConnectionMetaData.java 3798 2006-11-04 04:07:14Z aperepel $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.ra;
12
13 import javax.resource.ResourceException JavaDoc;
14 import javax.resource.spi.ManagedConnectionMetaData JavaDoc;
15
16 import org.mule.MuleManager;
17 import org.mule.config.i18n.Message;
18 import org.mule.config.i18n.Messages;
19
20 /**
21  * <code>MuleManagedConnectionMetaData</code> TODO
22  */

23 public class MuleManagedConnectionMetaData implements ManagedConnectionMetaData JavaDoc
24 {
25     private final MuleManagedConnection managedConnection;
26
27     public MuleManagedConnectionMetaData(MuleManagedConnection mc)
28     {
29         this.managedConnection = mc;
30     }
31
32     public String JavaDoc getEISProductName() throws ResourceException JavaDoc
33     {
34         return MuleManager.getConfiguration().getVendorName();
35     }
36
37     public String JavaDoc getEISProductVersion() throws ResourceException JavaDoc
38     {
39         return MuleManager.getConfiguration().getProductVersion();
40     }
41
42     // TODO
43
public int getMaxConnections() throws ResourceException JavaDoc
44     {
45         return 0;
46     }
47
48     public String JavaDoc getUserName() throws ResourceException JavaDoc
49     {
50         if (managedConnection.isDestroyed())
51         {
52             throw new IllegalStateException JavaDoc(new Message(Messages.X_IS_DISPOSED, managedConnection).toString());
53         }
54         return managedConnection.getUsername();
55     }
56 }
57
Popular Tags