KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > impl > ior > iiop > JavaCodebaseComponentImpl


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
8 package com.sun.corba.se.impl.ior.iiop;
9
10 import org.omg.IOP.TAG_JAVA_CODEBASE JavaDoc ;
11
12 import org.omg.CORBA_2_3.portable.OutputStream JavaDoc ;
13
14 import com.sun.corba.se.spi.ior.TaggedComponentBase ;
15
16 import com.sun.corba.se.spi.ior.iiop.JavaCodebaseComponent ;
17
18 /**
19  * @author
20  */

21 public class JavaCodebaseComponentImpl extends TaggedComponentBase
22     implements JavaCodebaseComponent
23 {
24     private String JavaDoc URLs ;
25
26     public boolean equals( Object JavaDoc obj )
27     {
28     if (obj == null)
29         return false ;
30
31     if (!(obj instanceof JavaCodebaseComponentImpl))
32         return false ;
33
34     JavaCodebaseComponentImpl other = (JavaCodebaseComponentImpl)obj ;
35
36     return URLs.equals( other.getURLs() ) ;
37     }
38
39     public int hashCode()
40     {
41     return URLs.hashCode() ;
42     }
43
44     public String JavaDoc toString()
45     {
46     return "JavaCodebaseComponentImpl[URLs=" + URLs + "]" ;
47     }
48
49     public String JavaDoc getURLs()
50     {
51     return URLs ;
52     }
53
54     public JavaCodebaseComponentImpl( String JavaDoc URLs )
55     {
56     this.URLs = URLs ;
57     }
58     
59     public void writeContents(OutputStream JavaDoc os)
60     {
61     os.write_string( URLs ) ;
62     }
63     
64     public int getId()
65     {
66     return TAG_JAVA_CODEBASE.value ; // 25 in CORBA 2.3.1 13.6.3
67
}
68 }
69
Popular Tags