1. /*
  2. * @(#)GenericTaggedProfile.java 1.9 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.impl.ior;
  8. import org.omg.CORBA_2_3.portable.InputStream ;
  9. import com.sun.corba.se.spi.ior.TaggedProfile ;
  10. import com.sun.corba.se.spi.ior.TaggedProfileTemplate ;
  11. import com.sun.corba.se.spi.ior.ObjectId ;
  12. import com.sun.corba.se.spi.ior.ObjectKeyTemplate ;
  13. import com.sun.corba.se.spi.ior.ObjectKey ;
  14. import com.sun.corba.se.spi.orb.ORB ;
  15. import com.sun.corba.se.spi.ior.iiop.GIOPVersion ;
  16. import com.sun.corba.se.impl.encoding.EncapsOutputStream ;
  17. /**
  18. * @author
  19. */
  20. public class GenericTaggedProfile extends GenericIdentifiable implements TaggedProfile
  21. {
  22. private ORB orb ;
  23. public GenericTaggedProfile( int id, InputStream is )
  24. {
  25. super( id, is ) ;
  26. this.orb = (ORB)(is.orb()) ;
  27. }
  28. public GenericTaggedProfile( ORB orb, int id, byte[] data )
  29. {
  30. super( id, data ) ;
  31. this.orb = orb ;
  32. }
  33. public TaggedProfileTemplate getTaggedProfileTemplate()
  34. {
  35. return null ;
  36. }
  37. public ObjectId getObjectId()
  38. {
  39. return null ;
  40. }
  41. public ObjectKeyTemplate getObjectKeyTemplate()
  42. {
  43. return null ;
  44. }
  45. public ObjectKey getObjectKey()
  46. {
  47. return null ;
  48. }
  49. public boolean isEquivalent( TaggedProfile prof )
  50. {
  51. return equals( prof ) ;
  52. }
  53. public void makeImmutable()
  54. {
  55. // NO-OP
  56. }
  57. public boolean isLocal()
  58. {
  59. return false ;
  60. }
  61. public org.omg.IOP.TaggedProfile getIOPProfile()
  62. {
  63. EncapsOutputStream os = new EncapsOutputStream( orb ) ;
  64. write( os ) ;
  65. InputStream is = (InputStream)(os.create_input_stream()) ;
  66. return org.omg.IOP.TaggedProfileHelper.read( is ) ;
  67. }
  68. }