1 26 package org.objectweb.openccm.explorer.DCI; 27 28 import org.objectweb.openccm.OpenCCM_DCI.AssemblyManager; 29 import org.objectweb.openccm.OpenCCM_DCI.AssemblyFactoryManager; 30 import org.objectweb.openccm.OpenCCM_DCI.AssemblyFactoryManagerPackage.assembly_managersConnection; 31 import org.objectweb.util.explorer.api.Context; 32 import org.objectweb.util.explorer.api.Entry; 33 import org.objectweb.util.explorer.core.naming.lib.DefaultEntry; 34 35 42 public class AssemblyFactoryManagerContext 43 implements Context 44 { 45 46 52 58 64 67 protected String getName(AssemblyManager assemblyManager){ 68 String returnedValue = "Assembly "; 69 String assemblyId = assemblyManager.ass_id(); 70 if(assemblyId.indexOf(":")!=-1) 71 returnedValue = assemblyId.substring(0,assemblyId.indexOf(":")); 72 return returnedValue; 73 } 74 75 81 84 public Entry[] getEntries(Object object) { 85 AssemblyFactoryManager assemblyFactoryManager = (AssemblyFactoryManager)object; 86 87 java.util.List v = new java.util.Vector (); 88 89 assembly_managersConnection[] assemblyManagerList = assemblyFactoryManager.get_connections_assembly_managers(); 90 for (int i=0 ; i<assemblyManagerList.length ; i++){ 91 assembly_managersConnection assemblyManagerConnection = assemblyManagerList[i]; 92 AssemblyManagerWrapperWithCookie assemblyManagerWrapper = new AssemblyManagerWrapperWithCookie(); 93 assemblyManagerWrapper.setAssemblyFactory(assemblyFactoryManager.provide_assembly_factory()); 94 assemblyManagerWrapper.setCookie(assemblyManagerConnection.ck); 95 assemblyManagerWrapper.setAssemblyManager(assemblyManagerConnection.objref); 96 v.add(new DefaultEntry(getName(assemblyManagerConnection.objref)+ " (" + (i+1) + ")", assemblyManagerWrapper)); 97 } 98 99 return (Entry[]) v.toArray(new Entry[0]); 101 } 102 103 } 104 | Popular Tags |