1 7 8 package com.sun.corba.se.impl.protocol.giopmsgheaders; 9 10 import org.omg.CORBA.INTERNAL ; 11 import org.omg.CORBA.CompletionStatus ; 12 import org.omg.CORBA.SystemException ; 13 14 import com.sun.corba.se.spi.ior.IOR; 15 import com.sun.corba.se.spi.ior.IORFactories; 16 17 import com.sun.corba.se.spi.orb.ORB; 18 19 import com.sun.corba.se.spi.ior.iiop.GIOPVersion; 20 21 import com.sun.corba.se.impl.encoding.CDRInputStream; 22 23 import com.sun.corba.se.spi.logging.CORBALogDomains ; 24 import com.sun.corba.se.impl.logging.ORBUtilSystemException ; 25 26 32 33 public final class LocateReplyMessage_1_0 extends Message_1_0 34 implements LocateReplyMessage { 35 36 38 private ORB orb = null; 39 private int request_id = (int) 0; 40 private int locate_status = (int) 0; 41 private IOR ior = null; 42 43 45 LocateReplyMessage_1_0(ORB orb) { 46 this.orb = orb; 47 } 48 49 LocateReplyMessage_1_0(ORB orb, int _request_id, 50 int _locate_status, IOR _ior) { 51 super(Message.GIOPBigMagic, false, Message.GIOPLocateReply, 0); 52 this.orb = orb; 53 request_id = _request_id; 54 locate_status = _locate_status; 55 ior = _ior; 56 } 57 58 60 public int getRequestId() { 61 return this.request_id; 62 } 63 64 public int getReplyStatus() { 65 return this.locate_status; 66 } 67 68 public short getAddrDisposition() { 69 return KeyAddr.value; 70 } 71 72 public SystemException getSystemException(String message) { 73 return null; } 75 76 public IOR getIOR() { 77 return this.ior; 78 } 79 80 82 public void read(org.omg.CORBA.portable.InputStream istream) { 83 super.read(istream); 84 this.request_id = istream.read_ulong(); 85 this.locate_status = istream.read_long(); 86 isValidReplyStatus(this.locate_status); 88 if (this.locate_status == OBJECT_FORWARD) { 90 CDRInputStream cdr = (CDRInputStream) istream; 91 this.ior = IORFactories.makeIOR( cdr ) ; 92 } 93 } 94 95 public void write(org.omg.CORBA.portable.OutputStream ostream) { 98 super.write(ostream); 99 ostream.write_ulong(this.request_id); 100 ostream.write_long(this.locate_status); 101 } 102 103 105 public static void isValidReplyStatus(int replyStatus) { 106 switch (replyStatus) { 107 case UNKNOWN_OBJECT : 108 case OBJECT_HERE : 109 case OBJECT_FORWARD : 110 break; 111 default : 112 ORBUtilSystemException localWrapper = ORBUtilSystemException.get( 113 CORBALogDomains.RPC_PROTOCOL ) ; 114 throw localWrapper.illegalReplyStatus( CompletionStatus.COMPLETED_MAYBE); 115 } 116 } 117 118 public void callback(MessageHandler handler) 119 throws java.io.IOException 120 { 121 handler.handleInput(this); 122 } 123 } | Popular Tags |