1 21 package ist.coach.itut_q816Components; 22 23 import intt.itu.itut_q816.ChannelInfoType; 24 import org.omg.CosNaming.NameComponent ; 25 import java.util.Hashtable ; 26 27 30 public class ChannelFinderProviderMonolithicImpl 31 extends org.omg.CORBA.LocalObject 32 implements CCM_ChannelFinderProvider, 33 intt.itu.itut_q816.CCM_ChannelFinder, 34 intt.itu.itut_q816.CCM_ChannelFinderComponent, 35 org.omg.Components.SessionComponent 36 { 37 45 private CCM_ChannelFinderProvider_Context the_context_; 46 47 Hashtable channels = null; 48 56 public 57 ChannelFinderProviderMonolithicImpl() 58 { 59 the_context_ = null; 60 channels = new Hashtable (); 61 } 62 78 public CCM_ChannelFinderProvider_Context 79 getContext() 80 { 81 return the_context_; 82 } 83 97 public void 98 configuration_complete() 99 throws org.omg.Components.InvalidConfiguration 100 { 101 System.err.println("ChannelFinderProvider configuration completed..."); 105 106 } 107 123 public void 124 set_session_context(org.omg.Components.SessionContext context) 125 throws org.omg.Components.CCMException 126 { 127 the_context_ = (CCM_ChannelFinderProvider_Context)context; 128 } 129 139 public void 140 ccm_activate() 141 throws org.omg.Components.CCMException 142 { 143 } 147 157 public void 158 ccm_passivate() 159 throws org.omg.Components.CCMException 160 { 161 } 165 175 public void 176 ccm_remove() 177 throws org.omg.Components.CCMException 178 { 179 } 183 194 public intt.itu.itut_q816.CCM_ChannelFinder 195 get_query() 196 { 197 return this; 198 } 199 205 public intt.itu.itut_q816.CCM_ChannelFinderComponent 206 get_admin() 207 { 208 return this; 209 } 210 221 public intt.itu.itut_q816.ChannelInfoType[] 222 list() 223 throws intt.itu.itut_x780.ApplicationError 224 { 225 intt.itu.itut_q816.ChannelInfoType[] channelsInfo = new intt.itu.itut_q816.ChannelInfoType[0]; 229 230 int c_size = channels.size(); 231 232 if (c_size > 0) { 233 channelsInfo = new intt.itu.itut_q816.ChannelInfoType[c_size]; 234 channelsInfo = 235 (ChannelInfoType[]) channels.values().toArray(channelsInfo); 236 } 237 238 return channelsInfo; 239 } 240 251 public void 252 register(java.lang.String channelID, 253 java.lang.String channelClass, 254 java.lang.String [] eventTypes, 255 java.lang.String [] excludedEventTypes, 256 java.lang.String [] sourceClasses, 257 java.lang.String [] excludedSourceClasses, 258 org.omg.CORBA.Object channel) 259 throws intt.itu.itut_q816.ChannelAlreadyRegistered, intt.itu.itut_x780.ApplicationError 260 { 261 265 System.err.println("ChannelFinder> register is called for " + 266 channelID + " of type " + channelClass); 267 268 if (channels.containsKey(channelID)) { 269 System.err.println("ChannelFinder> register found channel already registered.."); 270 throw new intt.itu.itut_q816.ChannelAlreadyRegistered(); 271 } 272 273 intt.itu.itut_q816.ChannelInfoType channelInfo = new ChannelInfoType(channelID, 274 channelClass, 275 eventTypes, 276 excludedEventTypes, 277 sourceClasses, 278 excludedSourceClasses, 279 channel); 280 281 channels.put(channelID, channelInfo); 282 } 283 289 public void 290 unregister(java.lang.String channelID) 291 throws intt.itu.itut_q816.ChannelNotFound, intt.itu.itut_x780.ApplicationError 292 { 293 297 if (channels.containsKey(channelID)) 298 channels.remove(channelID); 299 else 300 throw new intt.itu.itut_q816.ChannelNotFound(); 301 } 302 } 303 | Popular Tags |