1 25 26 package org.objectweb.easybeans.jsr77; 27 28 import java.util.Map ; 29 30 import javax.management.MBeanException ; 31 import javax.management.RuntimeOperationsException ; 32 33 import org.objectweb.easybeans.api.EZBContainer; 34 import org.objectweb.easybeans.api.EZBServer; 35 import org.objectweb.easybeans.jmx.MBeansException; 36 import org.objectweb.easybeans.jmx.MBeansHelper; 37 38 42 public class J2EEServerMBean extends J2EEManagedObjectMBean<EZBServer> { 43 44 48 public J2EEServerMBean() throws MBeanException , RuntimeOperationsException { 49 super(); 50 } 51 52 55 public String [] getDeployedObjects() { 56 Map <String , EZBContainer> containers = getManagedComponent().getContainers(); 57 int size = containers.size(); 58 String [] deployedObjects = new String [size]; 59 60 int index = 0; 61 for(EZBContainer container : containers.values()) { 62 63 try { 64 deployedObjects[index] = MBeansHelper.getInstance().getObjectName(container); 65 } catch (MBeansException e) { 66 deployedObjects[index] = ""; 67 } 68 69 index++; 70 } 71 72 return deployedObjects; 73 } 74 75 79 public String [] getResources() { 80 throw new UnsupportedOperationException ("Not implemented yet !"); 82 } 83 84 87 public String [] getJavaVMs() { 88 throw new UnsupportedOperationException ("Not implemented yet !"); 90 } 91 92 95 public String getServerVendor() { 96 return "Objectweb"; 97 } 98 99 102 public String getServerVersion() { 103 return "Preview"; 104 } 105 106 } 107 | Popular Tags |