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 import com.sun.corba.se.impl.encoding.CDRInputStream; 21 22 import com.sun.corba.se.spi.logging.CORBALogDomains ; 23 import com.sun.corba.se.impl.logging.ORBUtilSystemException ; 24 25 31 32 public final class LocateReplyMessage_1_1 extends Message_1_1 33 implements LocateReplyMessage { 34 35 37 private ORB orb = null; 38 private int request_id = (int) 0; 39 private int reply_status = (int) 0; 40 private IOR ior = null; 41 42 44 LocateReplyMessage_1_1(ORB orb) { 45 this.orb = orb; 46 } 47 48 LocateReplyMessage_1_1(ORB orb, int _request_id, 49 int _reply_status, IOR _ior) { 50 super(Message.GIOPBigMagic, GIOPVersion.V1_1, FLAG_NO_FRAG_BIG_ENDIAN, 51 Message.GIOPLocateReply, 0); 52 this.orb = orb; 53 request_id = _request_id; 54 reply_status = _reply_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.reply_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.reply_status = istream.read_long(); 86 isValidReplyStatus(this.reply_status); 88 if (this.reply_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.reply_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
|