1 23 24 package com.sun.enterprise.management.model; 25 26 import java.util.*; 27 import javax.management.*; 28 import com.sun.enterprise.deployment.EjbBundleDescriptor; 29 import com.sun.enterprise.deployment.WebServicesDescriptor; 30 import com.sun.enterprise.deployment.WebServiceEndpoint; 31 import com.sun.enterprise.management.util.J2EEModuleCallBack; 32 33 public class EJBModuleMdl extends J2EEModuleMdl { 34 35 private static String MANAGED_OBJECT_TYPE = "EJBModule"; 36 37 private String ejbModuleName = null; 38 private String applicationName = null; 39 private boolean hasWebServices=false; 40 private String [] endpointAddresses = null; 41 42 public EJBModuleMdl(J2EEModuleCallBack module, EjbBundleDescriptor ejbBundle) { 43 super(module); 44 this.ejbModuleName = module.getName() ; 45 this.applicationName = module.getParentName(); 46 if(isStandAloneModule(applicationName)) 47 this.applicationName = "null"; 48 WebServicesDescriptor wsDesc = ejbBundle.getWebServices(); 49 if (wsDesc.hasWebServices()) { 50 hasWebServices = true; 51 Vector endpointList = new Vector(); 52 for (Iterator endpoints = wsDesc.getEndpoints().iterator(); 53 endpoints.hasNext();) { 54 WebServiceEndpoint wse = (WebServiceEndpoint) endpoints.next(); 55 endpointList.add(wse.getEndpointAddressUri()); 56 } 57 endpointAddresses = new String [endpointList.size()]; 58 endpointList.copyInto(endpointAddresses); 59 } 60 } 61 62 public String [] getejbs() { 63 Set appMods = findNames("EJBModule=" + this.ejbModuleName+",J2EEServer=" + getJ2EEServer()+",J2EEApplication="+this.applicationName); 64 65 Iterator it = appMods.iterator(); 66 String [] mods = new String [appMods.size()]; 67 int i =0; 68 while(it.hasNext()) { 69 mods[i++] = ((ObjectName)it.next()).toString(); 70 } 71 return mods; 72 } 73 74 77 public String getj2eeType() { 78 return MANAGED_OBJECT_TYPE; 79 } 80 81 82 public String getJ2EEApplication() { 83 return this.applicationName; 84 } 85 86 public String getModuleName() { 87 return this.ejbModuleName; 88 } 89 90 } 91 | Popular Tags |