1 23 24 29 30 package com.sun.enterprise.management.model; 31 32 import java.util.Set ; 33 import java.util.Iterator ; 34 import javax.management.ObjectName ; 35 36 public class JCAResourceMdl extends J2EEResourceMdl { 37 38 private static String MANAGED_OBJECT_TYPE = "JCAResource"; 39 40 String resourceAdapter = null; 41 String username = null; 42 String password = null; 43 String [] propNames = null; 44 String [] propValues = null; 45 46 public JCAResourceMdl(String name, String raName, 47 String username, String password, 48 String [] propNames, String [] propValues) { 49 super(name); 50 resourceAdapter = raName; 51 this.username = username; 52 this.password = password; 53 this.propNames = propNames; 54 this.propValues = propValues; 55 } 56 public JCAResourceMdl(String name, String serverName, String raName, 57 String username, String password, 58 String [] propNames, String [] propValues) { 59 super(name, serverName); 60 resourceAdapter = raName; 61 this.username = username; 62 this.password = password; 63 this.propNames = propNames; 64 this.propValues = propValues; 65 } 66 67 71 public String getj2eeType() { 72 return MANAGED_OBJECT_TYPE; 73 } 74 75 public String [] getconnectionFactories(){ 76 Set s = findNames("j2eeType=JCAConnectionFactory,J2EEServer="+ this.getJ2EEServer() + ",JCAResource=" + getname()); 77 Iterator it = s.iterator(); 78 String [] ret = new String [s.size()]; 79 int i =0; 80 while(it.hasNext()) { 81 ret[i++] = ((ObjectName )it.next()).toString(); 82 } 83 return ret; 84 } 85 86 public String getresourceAdapter() { 87 return resourceAdapter; 88 } 89 90 public String getusername() { 91 return username; 92 } 93 94 public String getpassword() { 95 return password; 96 } 97 98 public String [] getpropNames() { 99 return propNames; 100 } 101 102 public String [] getpropValues() { 103 return propValues; 104 } 105 } 106 | Popular Tags |