1 26 27 package org.objectweb.ccm.IDL3; 28 29 37 38 public class EmitsDeclImpl 39 extends EventsDeclImpl 40 implements EmitsDecl 41 { 42 48 51 private org.omg.CORBA.ComponentIR.EmitsDef emits_def_; 52 53 56 private OperationDeclImpl[] client_mapping_; 57 58 61 private OperationDeclImpl[] local_context_mapping_; 62 63 69 74 protected 75 EmitsDeclImpl(Repository rep, ScopeImpl parent) 76 { 77 super(rep, parent); 79 80 emits_def_ = null; 82 client_mapping_ = null; 83 local_context_mapping_ = null; 84 the_declaration_kind_ = DeclarationKind._dk_emits; 85 } 86 87 93 98 protected void 99 load(org.omg.CORBA.Contained contained) 100 { 101 emits_def_ = org.omg.CORBA.ComponentIR.EmitsDefHelper.narrow(contained); 102 super.load(contained); 103 } 104 105 111 114 public void 115 create() 116 { 117 emits_def_ = the_parent_.getComponentDef().create_emits(getId(), 118 getName(), 119 getVersion(), 120 event_.getEventDef()); 121 122 super.create(); 123 } 124 125 131 134 public OperationDecl[] 135 getClientMapping() 136 { 137 if (client_mapping_!=null) 138 return client_mapping_; 139 140 InterfaceDecl client = ((ComponentDecl)the_parent_).getClientMapping(); 142 client.getContents(true, DeclarationKind._dk_null); 143 144 client_mapping_ = new OperationDeclImpl[2]; 145 client_mapping_[0] = (OperationDeclImpl)client.find("connect_"+getName()); 146 client_mapping_[1] = (OperationDeclImpl)client.find("disconnect_"+getName()); 147 148 return client_mapping_; 149 } 150 151 154 public OperationDecl[] 155 getLocalContextMapping() 156 { 157 if (local_context_mapping_!=null) 158 return local_context_mapping_; 159 160 InterfaceDecl context = ((ComponentDecl)the_parent_).getLocalContextMapping(); 162 context.getContents(true, DeclarationKind._dk_null); 163 164 local_context_mapping_ = new OperationDeclImpl[1]; 165 local_context_mapping_[0] = (OperationDeclImpl)context.find("push_"+getName()); 166 167 return local_context_mapping_; 168 } 169 170 176 181 protected org.omg.CORBA.Contained 182 getContained() 183 { 184 return emits_def_; 185 } 186 } 187 | Popular Tags |