1. /*
  2. * @(#)TaggedProfileTemplateBase.java 1.4 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.corba.se.spi.ior;
  8. import java.util.Iterator ;
  9. import org.omg.CORBA_2_3.portable.OutputStream ;
  10. import com.sun.corba.se.spi.orb.ORB ;
  11. import com.sun.corba.se.impl.ior.EncapsulationUtility ;
  12. public abstract class TaggedProfileTemplateBase
  13. extends IdentifiableContainerBase
  14. implements TaggedProfileTemplate
  15. {
  16. public void write( OutputStream os )
  17. {
  18. EncapsulationUtility.writeEncapsulation( this, os ) ;
  19. }
  20. public org.omg.IOP.TaggedComponent[] getIOPComponents( ORB orb, int id )
  21. {
  22. int count = 0 ;
  23. Iterator iter = iteratorById( id ) ;
  24. while (iter.hasNext()) {
  25. iter.next() ;
  26. count++ ;
  27. }
  28. org.omg.IOP.TaggedComponent[] result = new
  29. org.omg.IOP.TaggedComponent[count] ;
  30. int index = 0 ;
  31. iter = iteratorById( id ) ;
  32. while (iter.hasNext()) {
  33. TaggedComponent comp = (TaggedComponent)(iter.next()) ;
  34. result[index++] = comp.getIOPComponent( orb ) ;
  35. }
  36. return result ;
  37. }
  38. }