1. /*
  2. * @(#)TaggedProfileTemplate.java 1.11 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.List ;
  9. import java.util.Iterator ;
  10. import org.omg.CORBA_2_3.portable.OutputStream ;
  11. import com.sun.corba.se.spi.ior.Identifiable ;
  12. import com.sun.corba.se.spi.ior.Writeable ;
  13. import com.sun.corba.se.spi.ior.ObjectId ;
  14. import com.sun.corba.se.spi.ior.WriteContents ;
  15. import com.sun.corba.se.spi.orb.ORB ;
  16. /** Base template for creating TaggedProfiles. A TaggedProfile will often contain
  17. * tagged components. A template that does not contain components acts like
  18. * an empty immutable list.
  19. *
  20. * @author Ken Cavanaugh
  21. */
  22. public interface TaggedProfileTemplate extends List, Identifiable,
  23. WriteContents, MakeImmutable
  24. {
  25. /** Return an iterator that iterates over tagged components with
  26. * identifier id. It is not possible to modify the list through this
  27. * iterator.
  28. */
  29. public Iterator iteratorById( int id ) ;
  30. /** Create a TaggedProfile from this template.
  31. */
  32. TaggedProfile create( ObjectKeyTemplate oktemp, ObjectId id ) ;
  33. /** Write the profile create( oktemp, id ) to the OutputStream os.
  34. */
  35. void write( ObjectKeyTemplate oktemp, ObjectId id, OutputStream os) ;
  36. /** Return true if temp is equivalent to this template. Equivalence
  37. * means that in some sense an invocation on a profile created by this
  38. * template has the same results as an invocation on a profile
  39. * created from temp. Equivalence may be weaker than equality.
  40. */
  41. boolean isEquivalent( TaggedProfileTemplate temp );
  42. /** Return the tagged components in this profile (if any)
  43. * in the GIOP marshalled form, which is required for Portable
  44. * Interceptors. Returns null if either the profile has no
  45. * components, or if this type of profile can never contain
  46. * components.
  47. */
  48. org.omg.IOP.TaggedComponent[] getIOPComponents(
  49. ORB orb, int id );
  50. }