1 7 8 package com.sun.corba.se.impl.protocol.giopmsgheaders; 9 10 import org.omg.CORBA.Principal ; 11 import com.sun.corba.se.spi.servicecontext.ServiceContexts; 12 import com.sun.corba.se.spi.ior.iiop.GIOPVersion; 13 import com.sun.corba.se.spi.orb.ORB; 14 import com.sun.corba.se.spi.ior.ObjectKey; 15 16 22 23 public final class RequestMessage_1_0 extends Message_1_0 24 implements RequestMessage { 25 26 28 private ORB orb = null; 29 private ServiceContexts service_contexts = null; 30 private int request_id = (int) 0; 31 private boolean response_expected = false; 32 private byte[] object_key = null; 33 private String operation = null; 34 private Principal requesting_principal = null; 35 private ObjectKey objectKey = null; 36 37 39 RequestMessage_1_0(ORB orb) { 40 this.orb = orb; 41 } 42 43 RequestMessage_1_0(ORB orb, ServiceContexts _service_contexts, 44 int _request_id, boolean _response_expected, byte[] _object_key, 45 String _operation, Principal _requesting_principal) { 46 super(Message.GIOPBigMagic, false, Message.GIOPRequest, 0); 47 this.orb = orb; 48 service_contexts = _service_contexts; 49 request_id = _request_id; 50 response_expected = _response_expected; 51 object_key = _object_key; 52 operation = _operation; 53 requesting_principal = _requesting_principal; 54 } 55 56 58 public ServiceContexts getServiceContexts() { 59 return this.service_contexts; 60 } 61 62 public int getRequestId() { 63 return this.request_id; 64 } 65 66 public boolean isResponseExpected() { 67 return this.response_expected; 68 } 69 70 public byte[] getReserved() { 71 return null; 73 } 74 75 public ObjectKey getObjectKey() { 76 if (this.objectKey == null) { 77 this.objectKey = MessageBase.extractObjectKey(object_key, orb); 79 } 80 81 return this.objectKey; 82 } 83 84 public String getOperation() { 85 return this.operation; 86 } 87 88 public Principal getPrincipal() { 89 return this.requesting_principal; 90 } 91 92 93 95 public void setThreadPoolToUse(int poolToUse) { 96 } 99 100 101 103 public void read(org.omg.CORBA.portable.InputStream istream) { 104 super.read(istream); 105 this.service_contexts 106 = new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream ) istream); 107 this.request_id = istream.read_ulong(); 108 this.response_expected = istream.read_boolean(); 109 int _len0 = istream.read_long(); 110 this.object_key = new byte[_len0]; 111 istream.read_octet_array(this.object_key, 0, _len0); 112 this.operation = istream.read_string(); 113 this.requesting_principal = istream.read_Principal(); 114 } 115 116 public void write(org.omg.CORBA.portable.OutputStream ostream) { 117 super.write(ostream); 118 if (this.service_contexts != null) { 119 service_contexts.write( 120 (org.omg.CORBA_2_3.portable.OutputStream ) ostream, 121 GIOPVersion.V1_0); 122 } else { 123 ServiceContexts.writeNullServiceContext( 124 (org.omg.CORBA_2_3.portable.OutputStream ) ostream); 125 } 126 ostream.write_ulong(this.request_id); 127 ostream.write_boolean(this.response_expected); 128 nullCheck(this.object_key); 129 ostream.write_long(this.object_key.length); 130 ostream.write_octet_array(this.object_key, 0, this.object_key.length); 131 ostream.write_string(this.operation); 132 if (this.requesting_principal != null) { 133 ostream.write_Principal(this.requesting_principal); 134 } else { 135 ostream.write_long(0); 136 } 137 } 138 139 public void callback(MessageHandler handler) 140 throws java.io.IOException 141 { 142 handler.handleInput(this); 143 } 144 } | Popular Tags |