1 26 27 package org.objectweb.openccm.explorer.CosTrading; 28 29 import org.objectweb.openccm.corba.trader.SpecifiedServiceTypesWrapper; 30 import org.objectweb.util.explorer.api.Context; 31 import org.objectweb.util.explorer.api.Entry; 32 import org.objectweb.util.explorer.core.naming.lib.DefaultEntry; 33 import org.omg.CosTradingRepos.ServiceTypeRepository; 34 import org.omg.CosTradingRepos.ServiceTypeRepositoryPackage.SpecifiedServiceTypes; 35 import org.omg.CosTradingRepos.ServiceTypeRepositoryPackage.TypeStruct; 36 37 44 public class ServiceTypeRepositoryContext 45 implements Context 46 { 47 48 54 60 66 72 public Entry[] getEntries(Object object) { 73 ServiceTypeRepository str = (ServiceTypeRepository) object; 74 75 SpecifiedServiceTypes sst = SpecifiedServiceTypesWrapper.create_all(); 76 77 String [] names = str.list_types(sst); 78 Entry[] values = new Entry[names.length]; 79 80 for (int i = 0; i < names.length; i++) { 81 try { 82 TypeStruct ts = str.describe_type(names[i]); 83 values[i] = new DefaultEntry(names[i], ts); 84 } catch (org.omg.CosTrading.IllegalServiceType ex) { 85 } catch (org.omg.CosTrading.UnknownServiceType ex) { 87 } 89 } 90 return values; 91 } 92 93 } 94 | Popular Tags |