1. /*
  2. * @(#)JavaCodebaseComponentImpl.java 1.20 04/06/21
  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.iiop;
  8. import org.omg.IOP.TAG_JAVA_CODEBASE ;
  9. import org.omg.CORBA_2_3.portable.OutputStream ;
  10. import com.sun.corba.se.spi.ior.TaggedComponentBase ;
  11. import com.sun.corba.se.spi.ior.iiop.JavaCodebaseComponent ;
  12. /**
  13. * @author
  14. */
  15. public class JavaCodebaseComponentImpl extends TaggedComponentBase
  16. implements JavaCodebaseComponent
  17. {
  18. private String URLs ;
  19. public boolean equals( Object obj )
  20. {
  21. if (obj == null)
  22. return false ;
  23. if (!(obj instanceof JavaCodebaseComponentImpl))
  24. return false ;
  25. JavaCodebaseComponentImpl other = (JavaCodebaseComponentImpl)obj ;
  26. return URLs.equals( other.getURLs() ) ;
  27. }
  28. public int hashCode()
  29. {
  30. return URLs.hashCode() ;
  31. }
  32. public String toString()
  33. {
  34. return "JavaCodebaseComponentImpl[URLs=" + URLs + "]" ;
  35. }
  36. public String getURLs()
  37. {
  38. return URLs ;
  39. }
  40. public JavaCodebaseComponentImpl( String URLs )
  41. {
  42. this.URLs = URLs ;
  43. }
  44. public void writeContents(OutputStream os)
  45. {
  46. os.write_string( URLs ) ;
  47. }
  48. public int getId()
  49. {
  50. return TAG_JAVA_CODEBASE.value ; // 25 in CORBA 2.3.1 13.6.3
  51. }
  52. }