1 23 24 package com.sun.enterprise.management.model; 25 26 import java.util.*; 27 import javax.management.*; 28 import com.sun.enterprise.management.util.J2EEModuleCallBack; 29 30 public class ResourceAdapterModuleMdl extends J2EEModuleMdl { 31 32 private static String MANAGED_OBJECT_TYPE = "ResourceAdapterModule"; 33 34 private String resAdapterModuleName = null; 35 private String resAdapterName = null; 36 private String applicationName = null; 37 38 public ResourceAdapterModuleMdl(J2EEModuleCallBack module, String rarName) { 39 super(module); 40 this.resAdapterName = module.getName(); 41 this.resAdapterModuleName = rarName; 42 if(module.getParentName() != null){ 43 this.applicationName = module.getParentName(); 44 if(isStandAloneModule(applicationName)) 45 this.applicationName = "null"; 46 } 47 else { 48 this.applicationName = "null"; 50 } 51 } 52 53 public String [] getresourceAdapters() { 54 Set appMods = super.findNames("j2eeType=ResourceAdapter,ResourceAdapterModule=" + this.resAdapterModuleName +",J2EEServer=" + getJ2EEServer()+",J2EEApplication="+this.applicationName); 55 56 Iterator it = appMods.iterator(); 57 String [] mods = new String [appMods.size()]; 58 int i =0; 59 while(it.hasNext()) { 60 mods[i++] = ((ObjectName)it.next()).toString(); 61 } 62 return mods; 63 } 64 65 68 public String getj2eeType() { 69 return MANAGED_OBJECT_TYPE; 70 } 71 72 73 public String getJ2EEApplication() { 74 return this.applicationName; 75 } 76 77 public String getModuleName() { 78 return this.resAdapterModuleName; 79 } 80 81 } 82 | Popular Tags |