1 26 27 package org.objectweb.ccm.IDL3; 28 29 37 38 abstract public class EventsDeclImpl 39 extends DeclarationImpl 40 implements EventsDecl 41 { 42 48 51 protected EventDeclImpl event_; 52 53 59 64 protected 65 EventsDeclImpl(Repository rep, ScopeImpl parent) 66 { 67 super(rep, parent); 69 70 event_ = null; 72 } 73 74 80 85 protected void 86 load(org.omg.CORBA.Contained contained) 87 { 88 org.omg.CORBA.ComponentIR.EventPortDef event_port = 89 org.omg.CORBA.ComponentIR.EventPortDefHelper.narrow(contained); 90 setEvent((EventRef)getRepository().lookupId(event_port.event().id())); 91 super.load(contained); 92 } 93 94 100 107 public Declaration[] 108 getDependencies() 109 { 110 if (dependencies_!=null) 111 return dependencies_; 112 113 org.objectweb.ccm.util.Vector events_depend = new org.objectweb.ccm.util.Vector(); 114 115 if (getType().isDeclaration()) 117 events_depend.add(getType()); 118 119 Declaration[] depend = getType().getDependencies(); 120 for (int i=0;i<depend.length;i++) 121 events_depend.add(depend[i]); 122 123 124 dependencies_ = (Declaration[])events_depend.toArray(new Declaration[0]); 125 return dependencies_; 126 } 127 128 134 139 public void 140 setEvent(EventRef event) 141 { 142 if (event != null) 143 { 144 event_ = (EventDeclImpl)event; 145 event_.addRef(); 146 } 147 } 148 149 152 public TypeRef 153 getType() 154 { 155 return event_; 156 } 157 158 164 167 public void 168 destroy() 169 { 170 if (event_!=null) 171 event_.removeRef(); 172 } 173 } 174 | Popular Tags |