1 10 11 package org.mule.ra; 12 13 import javax.resource.ResourceException ; 14 import javax.resource.spi.ManagedConnectionMetaData ; 15 16 import org.mule.MuleManager; 17 import org.mule.config.i18n.Message; 18 import org.mule.config.i18n.Messages; 19 20 23 public class MuleManagedConnectionMetaData implements ManagedConnectionMetaData 24 { 25 private final MuleManagedConnection managedConnection; 26 27 public MuleManagedConnectionMetaData(MuleManagedConnection mc) 28 { 29 this.managedConnection = mc; 30 } 31 32 public String getEISProductName() throws ResourceException 33 { 34 return MuleManager.getConfiguration().getVendorName(); 35 } 36 37 public String getEISProductVersion() throws ResourceException 38 { 39 return MuleManager.getConfiguration().getProductVersion(); 40 } 41 42 public int getMaxConnections() throws ResourceException 44 { 45 return 0; 46 } 47 48 public String getUserName() throws ResourceException 49 { 50 if (managedConnection.isDestroyed()) 51 { 52 throw new IllegalStateException (new Message(Messages.X_IS_DISPOSED, managedConnection).toString()); 53 } 54 return managedConnection.getUsername(); 55 } 56 } 57 | Popular Tags |