KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > ir3 > Container_impl


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2004 INRIA & USTL - LIFL - GOAL
5 Contact: openccm@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Philippe Merle.
23 Contributor(s): Mathieu Vadet, Christophe Demarey.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.ir3;
28
29 // Package dependencies
30
import org.omg.CORBA.*;
31
32 /**
33  * Implementation of the CORBA::Container interface.
34  *
35  * @author <a HREF="mailto:Philippe.Merle@lifl.fr">Philippe Merle</a>
36  * <a HREF="mailto:Mathieu.Vadet@lifl.fr">Mathieu Vadet</a>
37  *
38  * @version 0.4
39  */

40
41 abstract public class Container_impl
42                 extends Contained_impl
43                 implements ContainerOperations
44 {
45     // ==================================================================
46
//
47
// Internal state.
48
//
49
// ==================================================================
50

51     /**
52         The contained objects list.
53      */

54     protected java.util.List JavaDoc contained_elements_;
55
56     /**
57      * The contained objects list.
58      */

59     protected java.util.List JavaDoc contained_with_mappings_;
60
61     /**
62      * To know if the addition of contained objects should be done
63      * in the contained_elements_ list or in the mappings_elements_ list.
64      */

65     protected boolean mapping_started_;
66
67     // ==================================================================
68
//
69
// Constructor.
70
//
71
// ==================================================================
72

73     /**
74      * TODO
75      */

76     public
77     Container_impl(IFR ifr,
78                    Container_impl container)
79     {
80         // call the Contained_impl contructor.
81
super(ifr, container);
82
83         // create the contained list.
84
contained_elements_ = new java.util.ArrayList JavaDoc();
85         contained_with_mappings_ = new java.util.ArrayList JavaDoc();
86         mapping_started_ = false;
87     }
88
89     // ==================================================================
90
//
91
// Internal methods.
92
//
93
// ==================================================================
94

95     /**
96      * TODO
97      */

98     protected Contained_impl[]
99     getContainedElements()
100     {
101         if (!getIFR().getRepository().isIDL2Repository())
102             return (Contained_impl[])contained_elements_.toArray(new Contained_impl[0]);
103         else
104             return (Contained_impl[])contained_with_mappings_.toArray(new Contained_impl[0]);
105     }
106
107
108     /**
109      * Add a contained object to the container.
110      */

111     protected void
112     addContained(Contained_impl contained)
113     {
114         // check if the kind of this contained object is accepted.
115
if (!checkDefinitionKind(contained.def_kind()))
116             throw exceptionInvalidContainer();
117
118         if (!mapping_started_)
119             contained_elements_.add(contained);
120
121         contained_with_mappings_.add(contained);
122     }
123
124     // ==================================================================
125
//
126
// Static public methods.
127
//
128
// ==================================================================
129

130     /**
131      * Convert a List to a CORBA::ContainedSeq.
132      */

133     static public Contained[]
134     toContainedSeq(java.util.List JavaDoc list)
135     {
136         Contained[] result = new Contained[list.size()];
137         for(int i=0; i<result.length; i++)
138         {
139             result[i] = ((Contained_impl)list.get(i)).asContained();
140         }
141         return result;
142     }
143
144     // ==================================================================
145
//
146
// Internal methods for managing dependencies.
147
//
148
// ==================================================================
149

150     /**
151      * Cuts dependencies to other objects.
152      */

153     protected void
154     cutDependencies()
155     {
156         // Destroys all the contained objects and their mappings.
157
while(contained_with_mappings_.size() != 0)
158         {
159             ((Contained_impl) contained_with_mappings_.get(contained_with_mappings_.size() -1)).destroy();
160         }
161
162         // Calls the Contained_impl cutDependencies operation.
163
super.cutDependencies();
164     }
165
166     // ==================================================================
167
//
168
// Public methods.
169
//
170
// ==================================================================
171

172     /**
173      * Obtain its CORBA::Container object reference.
174      */

175     public Container
176     asContainer()
177     {
178         return ContainerHelper.narrow(asObject());
179     }
180
181     /**
182      * Check if this kind of objects is accepted by the container.
183      */

184     public boolean
185     checkDefinitionKind(DefinitionKind def_kind)
186     {
187         // By default, all kinds are accepted!
188
return true;
189     }
190
191     /**
192      * Add a contained object to the container.
193      */

194     public void
195     addContained(Contained_impl contained,
196                  String JavaDoc id,
197                  String JavaDoc name,
198                  String JavaDoc version)
199     {
200         contained.name(name);
201         contained.id(id);
202         contained.version(version);
203         addContained(contained);
204     }
205
206     /**
207      * Remove a contained object from the container.
208      */

209     public void
210     removeContained(Contained_impl contained)
211     {
212         contained_elements_.remove(contained);
213         contained_with_mappings_.remove(contained);
214     }
215
216     /**
217      * Select named contained objects.
218      */

219     public java.util.List JavaDoc
220     selectNamedContained(java.util.List JavaDoc selection,
221                          String JavaDoc search_name,
222                          int levels_to_search,
223                          DefinitionKind limit_type,
224                          boolean exclude_inherited)
225     {
226         if(levels_to_search == 0) return selection;
227         levels_to_search --;
228
229         // iterate on all contained elements.
230
Contained_impl[] containeds = getContainedElements();
231         for (int i=0;i<containeds.length;i++)
232         {
233             Contained_impl contained = containeds[i];
234
235             if ( (limit_type == DefinitionKind.dk_all)
236             || (limit_type == contained.def_kind()) )
237             {
238                 if ((getIFR().getRepository().isIDL2Repository()) &&
239                     (contained.def_kind()!=DefinitionKind.dk_Consumes) &&
240                     (contained.def_kind()!=DefinitionKind.dk_Emits) &&
241                     (contained.def_kind()!=DefinitionKind.dk_Publishes) &&
242                     (contained.def_kind()!=DefinitionKind.dk_Provides) &&
243                     (contained.def_kind()!=DefinitionKind.dk_Uses) &&
244                     (contained.def_kind()!=DefinitionKind.dk_Factory) &&
245                     (contained.def_kind()!=DefinitionKind.dk_Finder) &&
246                     (contained.def_kind()!=DefinitionKind.dk_Event) &&
247                     (contained.def_kind()!=DefinitionKind.dk_Component) &&
248                     (contained.def_kind()!=DefinitionKind.dk_Home) &&
249                     (search_name.equals(contained.name())))
250                     selection.add(contained);
251                 else if ((!getIFR().getRepository().isIDL2Repository()) &&
252                          (search_name.equals(contained.name())))
253                     selection.add(contained);
254             }
255
256             if(levels_to_search != 0)
257             {
258                 Container_impl container = (Container_impl)contained;
259                 if(container != null)
260                 {
261                     container.selectNamedContained(selection,
262                                                    search_name,
263                                                    levels_to_search,
264                                                    limit_type,
265                                                    exclude_inherited);
266                 }
267             }
268         }
269
270         return selection;
271     }
272
273     /**
274      * Select contained objects.
275      */

276     public java.util.List JavaDoc
277     selectContained(java.util.List JavaDoc selection,
278                     DefinitionKind limit_type,
279                     boolean exclude_inherited)
280     {
281         // iterate on all contained elements.
282
Contained_impl[] containeds = getContainedElements();
283         for (int i=0;i<containeds.length;i++)
284         {
285             Contained_impl contained = containeds[i];
286
287             if ( (limit_type == DefinitionKind.dk_all)
288          || (limit_type == contained.def_kind()) )
289             {
290                 selection.add(contained);
291             }
292         }
293
294         return selection;
295     }
296
297     /**
298      * Compute its CORBA::AttrDescriptionSeq.
299      */

300     public AttributeDescription[]
301     getAttrDescriptionSeq()
302     {
303         java.util.List JavaDoc selection = new java.util.ArrayList JavaDoc();
304
305         // Bug #300152
306
// selectContained(selection, DefinitionKind.dk_Attribute, true);
307
selectContained(selection, DefinitionKind.dk_Attribute, false);
308
309         AttributeDescription[] result =
310                   new AttributeDescription[selection.size()];
311
312         for(int i=0; i<selection.size(); i++)
313             result[i] = ((AttributeDef_impl)selection.get(i))
314                         .getAttributeDescription();
315
316         return result;
317     }
318
319     /**
320      * Compute its CORBA::ExtAttrDescriptionSeq.
321      */

322     public ExtAttributeDescription[]
323     getExtAttrDescriptionSeq()
324     {
325         java.util.List JavaDoc selection = new java.util.ArrayList JavaDoc();
326
327         // Bug #300152
328
// selectContained(selection, DefinitionKind.dk_Attribute, true);
329
selectContained(selection, DefinitionKind.dk_Attribute, false);
330
331         ExtAttributeDescription[] result =
332                   new ExtAttributeDescription[selection.size()];
333
334         for(int i=0; i<selection.size(); i++)
335             result[i] = ((ExtAttributeDef_impl)selection.get(i))
336                         .getExtAttributeDescription();
337
338         return result;
339     }
340
341     /**
342      * Compute its CORBA::OpDescriptionSeq.
343      */

344     public OperationDescription[]
345     getOpDescriptionSeq()
346     {
347         java.util.List JavaDoc selection = new java.util.ArrayList JavaDoc();
348
349         // Bug #300152
350
// selectContained(selection, DefinitionKind.dk_Operation, true);
351
selectContained(selection, DefinitionKind.dk_Operation, false);
352
353         OperationDescription[] result =
354                  new OperationDescription[selection.size()];
355
356         for(int i=0; i<selection.size(); i++)
357             result[i] = ((OperationDef_impl)selection.get(i))
358                         .getOperationDescription();
359
360         return result;
361     }
362
363     /**
364      * Check a new name according to already contained names.
365      */

366     public void
367     checkName(String JavaDoc name,
368               boolean exclude_inherited,
369               boolean in_inherited)
370     {
371         // iterate on all contained elements.
372
Contained_impl[] containeds = getContainedElements();
373         for (int i=0;i<containeds.length;i++)
374         {
375             Contained_impl contained = containeds[i];
376
377             DefinitionKind dk = contained.def_kind();
378
379             if (in_inherited && ( (dk == DefinitionKind.dk_Constant)
380                                  || (dk == DefinitionKind.dk_Exception)
381                                  || (dk == DefinitionKind.dk_Alias)
382                                  || (dk == DefinitionKind.dk_Struct)
383                                  || (dk == DefinitionKind.dk_Union)
384                                  || (dk == DefinitionKind.dk_Enum)
385                                  || (dk == DefinitionKind.dk_Native)
386                                 ))
387                 continue;
388
389             boolean found = name.equalsIgnoreCase(contained.name());
390
391             if(!found && dk == DefinitionKind.dk_Enum)
392         {
393                 String JavaDoc[] members = ((EnumDef_impl)contained).members();
394                 for(int j=0; j<members.length; j++)
395                 {
396                     if(name.equalsIgnoreCase(members[j]))
397                     {
398                         found = true;
399                         break;
400                     }
401             }
402         }
403
404             if(found)
405         {
406                 if(in_inherited)
407                    throw exceptionNameClashInInheritedContext(name);
408                 else
409                    throw exceptionNameAlreadyUsed(name);
410         }
411         }
412     }
413
414     // ==================================================================
415
//
416
// For CORBA::IRObject interface.
417
//
418
// ==================================================================
419

420     // ==================================================================
421
//
422
// For CORBA::Container interface.
423
//
424
// ==================================================================
425

426     /**
427      * IDL:omg.org/CORBA/Container/lookup:1.0
428      */

429     public Contained
430     lookup(String JavaDoc search_name)
431     {
432         // if search_name begins with "::" then lookup into the repository.
433
if(search_name.startsWith("::"))
434             return getIFR().getRepository().lookup(search_name);
435
436         int index = search_name.indexOf("::");
437         String JavaDoc s1 = null;
438         String JavaDoc s2 = null;
439
440         if (index == -1) {
441             s1 = search_name;
442         } else {
443             s1 = search_name.substring(0,index);
444             s2 = search_name.substring(index+2);
445         }
446
447         // lookup into all contained elements.
448
Contained_impl[] containeds = getContainedElements();
449         for (int i=0;i<containeds.length;i++)
450         {
451             Contained_impl contained = containeds[i];
452
453             if (s1.equals(contained.name())) {
454                 if (s2 == null) {
455                     return contained.asContained();
456                 } else {
457                     Container_impl container = (Container_impl)contained;
458                     if (container == null) {
459                         return null;
460                     } else {
461                         return container.lookup(s2);
462                     }
463                 }
464             }
465         }
466
467         return null;
468     }
469
470     /**
471      * IDL:omg.org/CORBA/Container/contents:1.0
472      */

473     public Contained[]
474     contents(DefinitionKind limit_type,
475              boolean exclude_inherited)
476     {
477         java.util.List JavaDoc selection = new java.util.ArrayList JavaDoc();
478
479         selectContained(selection, limit_type, exclude_inherited);
480
481         return toContainedSeq(selection);
482     }
483
484     /**
485      * IDL:omg.org/CORBA/Container/lookup_name:1.0
486      */

487     public Contained[]
488     lookup_name(String JavaDoc search_name,
489                 int levels_to_search,
490                 DefinitionKind limit_type,
491                 boolean exclude_inherited)
492     {
493         java.util.List JavaDoc selection = new java.util.ArrayList JavaDoc();
494
495         selectNamedContained(selection, search_name, levels_to_search,
496                              limit_type, exclude_inherited);
497
498         return toContainedSeq(selection);
499     }
500
501     /**
502      * IDL:omg.org/CORBA/Container/describe_contents:1.0
503      */

504     public org.omg.CORBA.ContainerPackage.Description[]
505     describe_contents(DefinitionKind limit_type,
506                       boolean exclude_inherited,
507                       int max_returned_objs)
508     {
509         java.util.List JavaDoc selection = new java.util.ArrayList JavaDoc();
510         selectContained(selection, limit_type, exclude_inherited);
511
512         int len = selection.size();
513         if(max_returned_objs >= 0 && len > max_returned_objs)
514             len = max_returned_objs;
515
516         org.omg.CORBA.ContainerPackage.Description[] result =
517                  new org.omg.CORBA.ContainerPackage.Description[len];
518
519         for(int i=0; i<len; i++)
520     {
521             Contained_impl contained = (Contained_impl)selection.get(i);
522
523             org.omg.CORBA.ContainerPackage.Description tmp =
524                         new org.omg.CORBA.ContainerPackage.Description();
525
526             tmp.contained_object = contained.asContained();
527             tmp.kind = contained.def_kind();
528             tmp.value = org.objectweb.openccm.corba.TheORB.create_any();
529             contained.setDescriptionValue(tmp.value);
530
531             result[i] = tmp;
532     }
533
534         return result;
535     }
536
537     /**
538      * IDL:omg.org/CORBA/Container/create_module:1.0
539      */

540     public ModuleDef
541     create_module(String JavaDoc id,
542                   String JavaDoc name,
543                   String JavaDoc version)
544     {
545         ModuleDef_impl module = new ModuleDef_impl(getIFR(), this);
546
547         try
548         {
549             addContained(module, id, name, version);
550         }
551         catch(SystemException exc)
552         {
553             module.destroy();
554             throw exc;
555         }
556
557         return module.asModuleDef();
558     }
559
560     /**
561      * IDL:omg.org/CORBA/Container/create_constant:1.0
562      */

563     public ConstantDef
564     create_constant(String JavaDoc id,
565                     String JavaDoc name,
566                     String JavaDoc version,
567                     IDLType type,
568                     Any value)
569     {
570         ConstantDef_impl constant = new ConstantDef_impl(getIFR(), this);
571
572         try
573         {
574             addContained(constant, id, name, version);
575             constant.type_def(type);
576             constant.value(value);
577         }
578         catch(SystemException exc)
579         {
580             constant.destroy();
581             throw exc;
582         }
583
584         return constant.asConstantDef();
585     }
586
587     /**
588      * IDL:omg.org/CORBA/Container/create_struct:1.0
589      */

590     public StructDef
591     create_struct(String JavaDoc id,
592                   String JavaDoc name,
593                   String JavaDoc version,
594                   StructMember[] members)
595     {
596         StructDef_impl struct = new StructDef_impl(getIFR(), this);
597
598         try
599         {
600             addContained(struct, id, name, version);
601             struct.members(members);
602         }
603         catch(SystemException exc)
604         {
605             struct.destroy();
606             throw exc;
607         }
608
609         return struct.asStructDef();
610     }
611
612     /**
613      * IDL:omg.org/CORBA/Container/create_union:1.0
614      */

615     public UnionDef
616     create_union(String JavaDoc id,
617                  String JavaDoc name,
618                  String JavaDoc version,
619                  IDLType discriminator_type,
620                  UnionMember[] members)
621     {
622         UnionDef_impl union = new UnionDef_impl(getIFR(), this);
623
624         try
625         {
626             addContained(union, id, name, version);
627             union.discriminator_type_def(discriminator_type);
628             union.members(members);
629         }
630         catch(SystemException exc)
631         {
632             union.destroy();
633             throw exc;
634         }
635
636         return union.asUnionDef();
637     }
638
639     /**
640      * IDL:omg.org/CORBA/Container/create_enum:1.0
641      */

642     public EnumDef
643     create_enum(String JavaDoc id,
644                 String JavaDoc name,
645                 String JavaDoc version,
646                 String JavaDoc[] members)
647     {
648         EnumDef_impl enumDef = new EnumDef_impl(getIFR(), this);
649
650         try
651         {
652             addContained(enumDef, id, name, version);
653             enumDef.members(members);
654         }
655         catch(SystemException exc)
656         {
657             enumDef.destroy();
658             throw exc;
659         }
660
661         return enumDef.asEnumDef();
662     }
663
664     /**
665      * IDL:omg.org/CORBA/Container/create_alias:1.0
666      */

667     public AliasDef
668     create_alias(String JavaDoc id,
669                  String JavaDoc name,
670                  String JavaDoc version,
671                  IDLType original_type)
672     {
673         AliasDef_impl alias = new AliasDef_impl(getIFR(), this);
674
675         try
676         {
677             addContained(alias, id, name, version);
678             alias.original_type_def(original_type);
679         }
680         catch(SystemException exc)
681         {
682             alias.destroy();
683             throw exc;
684         }
685
686         return alias.asAliasDef();
687     }
688
689     /**
690      * IDL:omg.org/CORBA/Container/create_interface:1.0
691      */

692     public InterfaceDef
693     create_interface(String JavaDoc id,
694                      String JavaDoc name,
695                      String JavaDoc version,
696                      InterfaceDef[] base_interfaces)
697     {
698         InterfaceDef_impl itf = new InterfaceDef_impl(getIFR(), this);
699
700         try
701         {
702             addContained(itf, id, name, version);
703             itf.base_interfaces(base_interfaces);
704         }
705         catch(SystemException exc)
706         {
707             itf.destroy();
708             throw exc;
709         }
710
711         return itf.asInterfaceDef();
712     }
713
714     /**
715      * IDL:omg.org/CORBA/Container/create_abstract_interface:1.0
716      */

717     public AbstractInterfaceDef
718     create_abstract_interface(String JavaDoc id,
719                               String JavaDoc name,
720                               String JavaDoc version,
721                               AbstractInterfaceDef[] base_interfaces)
722     {
723         AbstractInterfaceDef_impl itf =
724              new AbstractInterfaceDef_impl(getIFR(), this);
725
726         try
727         {
728             addContained(itf, id, name, version);
729             itf.base_interfaces(base_interfaces);
730         }
731         catch(SystemException exc)
732         {
733             itf.destroy();
734             throw exc;
735         }
736
737         return itf.asAbstractInterfaceDef();
738     }
739
740     /**
741      * IDL:omg.org/CORBA/Container/create_local_interface:1.0
742      */

743     public LocalInterfaceDef
744     create_local_interface(String JavaDoc id,
745                            String JavaDoc name,
746                            String JavaDoc version,
747                            InterfaceDef[] base_interfaces)
748     {
749         LocalInterfaceDef_impl itf =
750              new LocalInterfaceDef_impl(getIFR(), this);
751
752         try
753         {
754             addContained(itf, id, name, version);
755             itf.base_interfaces(base_interfaces);
756         }
757         catch(SystemException exc)
758         {
759             itf.destroy();
760             throw exc;
761         }
762
763         return itf.asLocalInterfaceDef();
764     }
765
766     /**
767      * IDL:omg.org/CORBA/Container/create_value:1.0
768      */

769     public ValueDef
770     create_value(String JavaDoc id,
771                  String JavaDoc name,
772                  String JavaDoc version,
773                  boolean is_custom,
774                  boolean is_abstract,
775                  ValueDef base_value,
776                  boolean is_truncatable,
777                  ValueDef[] abstract_base_values,
778                  InterfaceDef[] supported_interfaces,
779                  Initializer[] initializers)
780     {
781         ValueDef_impl value = new ValueDef_impl(getIFR(), this);
782
783         try
784         {
785             addContained(value, id, name, version);
786             value.is_custom(is_custom);
787             value.is_abstract(is_abstract);
788             value.base_value(base_value);
789             value.is_truncatable(is_truncatable);
790             value.abstract_base_values(abstract_base_values);
791             value.supported_interfaces(supported_interfaces);
792             value.initializers(initializers);
793         }
794         catch(SystemException exc)
795         {
796             value.destroy();
797             throw exc;
798         }
799
800         return value.asValueDef();
801     }
802
803     /**
804      * IDL:omg.org/CORBA/Container/create_value_box:1.0
805      */

806     public ValueBoxDef
807     create_value_box(String JavaDoc id,
808                      String JavaDoc name,
809                      String JavaDoc version,
810                      IDLType original_type_def)
811     {
812         ValueBoxDef_impl value_box = new ValueBoxDef_impl(getIFR(), this);
813
814         try
815         {
816             addContained(value_box, id, name, version);
817             value_box.original_type_def(original_type_def);
818         }
819         catch(SystemException exc)
820         {
821             value_box.destroy();
822             throw exc;
823         }
824
825         return value_box.asValueBoxDef();
826     }
827
828     /**
829      * IDL:omg.org/CORBA/Container/create_exception:1.0
830      */

831     public ExceptionDef
832     create_exception(String JavaDoc id,
833                      String JavaDoc name,
834                      String JavaDoc version,
835                      StructMember[] members)
836     {
837         ExceptionDef_impl e = new ExceptionDef_impl(getIFR(), this);
838
839         try
840         {
841             addContained(e, id, name, version);
842             e.members(members);
843         }
844         catch(SystemException exc)
845         {
846             e.destroy();
847             throw exc;
848         }
849
850         return e.asExceptionDef();
851     }
852
853     /**
854      * IDL:omg.org/CORBA/Container/create_native:1.0
855      */

856     public NativeDef
857     create_native(String JavaDoc id,
858                   String JavaDoc name,
859                   String JavaDoc version)
860     {
861         NativeDef_impl n = new NativeDef_impl(getIFR(), this);
862
863         try
864         {
865             addContained(n, id, name, version);
866         }
867         catch(SystemException exc)
868         {
869             n.destroy();
870             throw exc;
871         }
872
873         return n.asNativeDef();
874     }
875
876     /**
877      * IDL:omg.org/CORBA/Container/create_ext_value:1.0
878      */

879     public ExtValueDef
880     create_ext_value(String JavaDoc id,
881                      String JavaDoc name,
882                      String JavaDoc version,
883                      boolean is_custom,
884                      boolean is_abstract,
885                      ValueDef base_value,
886                      boolean is_truncatable,
887                      ValueDef[] abstract_base_values,
888                      InterfaceDef[] supported_interfaces,
889                      ExtInitializer[] initializers)
890     {
891         ExtValueDef_impl value = new ExtValueDef_impl(getIFR(), this);
892
893         try
894         {
895             addContained(value, id, name, version);
896             value.is_custom(is_custom);
897             value.is_abstract(is_abstract);
898             value.base_value(base_value);
899             value.is_truncatable(is_truncatable);
900             value.abstract_base_values(abstract_base_values);
901             value.supported_interfaces(supported_interfaces);
902             value.ext_initializers(initializers);
903         }
904         catch(SystemException exc)
905         {
906             value.destroy();
907             throw exc;
908         }
909
910         return value.asExtValueDef();
911     }
912
913     /**
914      * IDL:omg.org/CORBA/Container/create_ext_interface:1.0
915      */

916     public ExtInterfaceDef
917     create_ext_interface(String JavaDoc id,
918                          String JavaDoc name,
919                          String JavaDoc version,
920                          InterfaceDef[] base_interfaces)
921     {
922         ExtInterfaceDef_impl itf = new ExtInterfaceDef_impl(getIFR(), this);
923
924         try
925         {
926             addContained(itf, id, name, version);
927             itf.base_interfaces(base_interfaces);
928         }
929         catch(SystemException exc)
930         {
931             itf.destroy();
932             throw exc;
933         }
934
935         return itf.asExtInterfaceDef();
936     }
937
938     /**
939      * IDL:omg.org/CORBA/Container/create_ext_abstract_interface:1.0
940      */

941     public ExtAbstractInterfaceDef
942     create_ext_abstract_interface(String JavaDoc id,
943                                   String JavaDoc name,
944                                   String JavaDoc version,
945                                   AbstractInterfaceDef[] base_interfaces)
946     {
947         ExtAbstractInterfaceDef_impl itf =
948              new ExtAbstractInterfaceDef_impl(getIFR(), this);
949
950         try
951         {
952             addContained(itf, id, name, version);
953             itf.base_interfaces(base_interfaces);
954         }
955         catch(SystemException exc)
956         {
957             itf.destroy();
958             throw exc;
959         }
960
961         return itf.asExtAbstractInterfaceDef();
962     }
963
964     /**
965      * IDL:omg.org/CORBA/Container/create_ext_local_interface:1.0
966      */

967     public ExtLocalInterfaceDef
968     create_ext_local_interface(String JavaDoc id,
969                                String JavaDoc name,
970                                String JavaDoc version,
971                                InterfaceDef[] base_interfaces)
972     {
973         ExtLocalInterfaceDef_impl itf =
974              new ExtLocalInterfaceDef_impl(getIFR(), this);
975
976         try
977         {
978             addContained(itf, id, name, version);
979             itf.base_interfaces(base_interfaces);
980         }
981         catch(SystemException exc)
982         {
983             itf.destroy();
984             throw exc;
985         }
986
987         return itf.asExtLocalInterfaceDef();
988     }
989 }
990
Popular Tags