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