1 28 29 30 package org.objectweb.ccm.runtime; 31 32 import org.objectweb.corba.runtime.*; 33 34 37 public class EmitterSet 38 implements java.io.Serializable 39 { 40 static final private String _class_name = "EmitterSet"; 42 private Emitter[] _elements; 43 44 public 46 EmitterSet() 47 { 48 _elements = new Emitter[0]; 50 } 51 52 public 54 EmitterSet(Emitter[] emitters) 55 { 56 _elements = emitters; 58 } 59 60 64 final public void 65 initializeChannel(org.omg.Components.CCM2Context ctx) 66 { 67 Emitter[] emitters = _elements; 68 for (int i=0;i<emitters.length;i++) { 69 try { 70 int chid = ctx.get_events().get_channel(emitters[i].name); 71 emitters[i].channel_id = chid; 72 } catch (org.omg.Components.ChannelUnavailable ex) { 73 final String opname = "initializeChannel"; 75 TheLogger.error(_class_name, opname, "FAILED", ex); 76 } 77 } 78 } 79 80 final public Emitter 81 get(String name) 82 throws org.omg.Components.InvalidName 83 { 84 Emitter[] emitters = _elements; 85 for (int i=0;i<emitters.length;i++) { 86 if (emitters[i].name.equals(name)) { 87 return emitters[i]; 88 } 89 } 90 91 throw new org.omg.Components.InvalidName(); 92 } 93 94 final public Emitter 95 uncheckedGet(String name) 96 { 97 Emitter[] emitters = _elements; 98 for (int i=0;i<emitters.length;i++) { 99 if (emitters[i].name.equals(name)) { 100 return emitters[i]; 101 } 102 } 103 104 return null; 106 } 107 } 108 | Popular Tags |