KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)IIOPAddressImpl.java 1.5 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
8 package com.sun.corba.se.impl.ior.iiop;
9
10 import org.omg.CORBA.BAD_PARAM JavaDoc ;
11
12 import org.omg.CORBA_2_3.portable.InputStream JavaDoc ;
13 import org.omg.CORBA_2_3.portable.OutputStream JavaDoc ;
14
15 import com.sun.corba.se.spi.orb.ORB ;
16
17 import com.sun.corba.se.spi.logging.CORBALogDomains ;
18
19 import com.sun.corba.se.impl.logging.IORSystemException ;
20
21 /**
22  * @author
23  */

24 public final class IIOPAddressImpl extends IIOPAddressBase
25 {
26     private ORB orb ;
27     private IORSystemException wrapper ;
28     private String JavaDoc host;
29     private int port;
30     
31     public IIOPAddressImpl( ORB orb, String JavaDoc host, int port )
32     {
33     this.orb = orb ;
34     wrapper = IORSystemException.get( orb,
35         CORBALogDomains.OA_IOR ) ;
36
37     if ((port < 0) || (port > 65535))
38         throw wrapper.badIiopAddressPort( new Integer JavaDoc(port)) ;
39
40     this.host = host ;
41     this.port = port ;
42     }
43
44     public IIOPAddressImpl( InputStream JavaDoc is )
45     {
46     host = is.read_string() ;
47     short thePort = is.read_short() ;
48     port = shortToInt( thePort ) ;
49     }
50
51     public String JavaDoc getHost()
52     {
53     return host ;
54     }
55
56     public int getPort()
57     {
58     return port ;
59     }
60 }
61
Popular Tags