1. /*
  2. * @(#)TaggedProfileFactoryFinder.java 1.13 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. //Source file: J:/ws/serveractivation/src/share/classes/com.sun.corba.se.internal.ior/TaggedProfileFactoryFinder.java
  8. package com.sun.corba.se.internal.ior;
  9. import com.sun.corba.se.internal.ior.IdEncapsulationFactoryFinder ;
  10. import com.sun.corba.se.internal.ior.IIOPProfile ;
  11. import com.sun.corba.se.internal.ior.GenericTaggedProfile ;
  12. import org.omg.IOP.TAG_INTERNET_IOP ;
  13. import org.omg.CORBA_2_3.portable.InputStream ;
  14. /**
  15. * @author
  16. */
  17. public class TaggedProfileFactoryFinder implements IdEncapsulationFactoryFinder
  18. {
  19. private TaggedProfileFactoryFinder()
  20. {
  21. }
  22. // initialize-on-demand holder
  23. private static class TaggedProfileFactoryFinderHolder {
  24. static TaggedProfileFactoryFinder value =
  25. new TaggedProfileFactoryFinder() ;
  26. }
  27. public static TaggedProfileFactoryFinder getFinder()
  28. {
  29. return TaggedProfileFactoryFinderHolder.value ;
  30. }
  31. /** Reads the TaggedProfile of type id from is.
  32. * @param id
  33. * @param is
  34. * @return IdEncapsulation
  35. * @exception
  36. * @author
  37. * @roseuid 39135AC6012F
  38. */
  39. public IdEncapsulation create(int id, InputStream is)
  40. {
  41. if (id == TAG_INTERNET_IOP.value)
  42. return new IIOPProfile( is ) ;
  43. else
  44. return new GenericTaggedProfile( id, is ) ;
  45. }
  46. }