1 23 24 29 30 package com.sun.enterprise.management.model; 31 32 import javax.management.ObjectName ; 33 import java.util.Set ; 34 35 public class JCAConnectionFactoryMdl extends J2EEManagedObjectMdl { 36 37 private static String MANAGED_OBJECT_TYPE = "JCAConnectionFactory"; 38 private String jcaResourceName; 39 private String jcaConnectionFactoryName; 40 private String managedConnFactory; 41 42 public JCAConnectionFactoryMdl(String jcaResName, String jcaConnFactName, String managedConFact) { 43 super(jcaConnFactName,false,false,false); 44 this.jcaResourceName = jcaResName; 45 this.jcaConnectionFactoryName = jcaConnFactName; 46 this.managedConnFactory = managedConFact; 47 } 48 public JCAConnectionFactoryMdl(String jcaResName, String serverName, String jcaConnFactName, String managedConFact) { 49 super(jcaConnFactName,serverName, false,false,false); 50 this.jcaResourceName = jcaResName; 51 this.jcaConnectionFactoryName = jcaConnFactName; 52 this.managedConnFactory = managedConFact; 53 } 54 55 59 public String getj2eeType() { 60 return MANAGED_OBJECT_TYPE; 61 } 62 63 67 public String getobjectName() { 68 Set s = findNames("j2eeType="+getj2eeType()+",name="+this.jcaConnectionFactoryName+",JCAResource="+this.getJCAResource()+",J2EEServer="+this.getJ2EEServer()); 69 Object [] objs = s.toArray(); 70 if (objs.length > 0) { 71 String name = ((ObjectName )objs[0]).toString(); 72 return name; 73 } else { 74 return null; 75 } 76 } 77 78 public String getmanagedConnectionFactory(){ 79 Set s = findNames("j2eeType=JCAManagedConnectionFactory,name=" + this.managedConnFactory + ",J2EEServer="+this.getJ2EEServer()); 80 Object [] objs = s.toArray(); 81 if (objs.length > 0) { 82 String name = ((ObjectName )objs[0]).toString(); 83 return name; 84 } else { 85 return null; 86 } 87 } 88 89 public String getJCAResource(){ 90 return this.jcaResourceName; 91 } 92 93 94 95 } 96 | Popular Tags |