1 26 27 package org.objectweb.openccm.explorer.DCI; 28 29 import org.ist.coach.DCI.NodeManager; 30 import org.objectweb.openccm.explorer.CORBA.TypageCORBA; 31 import org.objectweb.util.explorer.api.Table; 32 import org.objectweb.util.explorer.api.TreeView; 33 import org.objectweb.util.explorer.core.naming.lib.DefaultEntry; 34 import org.omg.Components.Deployment.ServerActivator; 35 import org.omg.Components.Deployment.ComponentServer; 36 37 44 public class ComponentServersTable 45 implements Table 46 { 47 48 54 60 66 protected String getName(org.omg.CORBA.Object o) { 67 TypageCORBA tc = new TypageCORBA(o, org.objectweb.openccm.corba.TheORB.getORB()); 68 return tc.getTypeID(); 69 } 70 71 77 80 public String [] getHeaders(TreeView treeView) { 81 return new String []{"Entry Name","Object"}; 82 } 83 84 87 public Object [][] getRows(TreeView treeView) { 88 NodeManager nodeManager = (NodeManager)treeView.getSelectedObject(); 89 ServerActivator serverActivator = nodeManager.provide_server_activator(); 90 if(serverActivator!=null){ 91 ComponentServer[] componentServerList = serverActivator.get_component_servers(); 92 Object [][] contenu = new Object [componentServerList.length][2]; 93 for (int i = 0; i < componentServerList.length; i++) { 94 contenu[i][0] = "ComponentServer " + (i+1); 95 contenu[i][1] = new DefaultEntry(getName(componentServerList[i]), componentServerList[i]); 96 } 97 return contenu; 98 } 99 return null; 100 } 101 } 102 | Popular Tags |