1 21 package org.jacorb.orb.portableInterceptor; 22 23 import org.omg.IOP.*; 24 import org.omg.CORBA.*; 25 import org.omg.PortableInterceptor.*; 26 import org.omg.Dynamic.Parameter ; 27 import java.util.*; 28 29 38 39 public abstract class RequestInfoImpl 40 extends org.omg.CORBA.LocalObject 41 implements RequestInfo 42 { 43 44 protected int request_id; 45 protected String operation = null; 46 47 protected Parameter [] arguments = null; 48 protected TypeCode[] exceptions = null; 49 protected Any result = null; 50 protected boolean response_expected; 51 protected org.omg.CORBA.Object forward_reference = null; 52 protected short reply_status; 53 protected org.omg.PortableInterceptor.Current current = null; 54 55 protected Hashtable request_ctx = null; 56 protected Hashtable reply_ctx = null; 57 58 protected short caller_op = -1; 59 60 public RequestInfoImpl() { 61 request_ctx = new Hashtable(); 62 reply_ctx = new Hashtable(); 63 } 64 65 70 public void setRequestServiceContexts(ServiceContext[] ctx){ 71 for (int _i = 0; _i < ctx.length; _i++) 72 request_ctx.put(new Integer (ctx[_i].context_id), ctx[_i]); 73 } 74 75 80 public void setReplyServiceContexts(ServiceContext[] ctx){ 81 for (int _i = 0; _i < ctx.length; _i++) 82 reply_ctx.put(new Integer (ctx[_i].context_id), ctx[_i]); 83 } 84 85 public void setArguments (Parameter [] args) { 86 this.arguments = args; 87 } 88 89 public void setResult (Any result) { 90 this.result = result; 91 } 92 93 public org.omg.PortableInterceptor.Current current() { 94 return current; 95 } 96 97 public void setCurrent (org.omg.PortableInterceptor.Current current) { 98 this.current = current; 99 } 100 101 public void setReplyStatus (short reply_status) { 102 this.reply_status = reply_status; 103 } 104 105 public void setForwardReference (org.omg.CORBA.Object forward_reference) { 106 this.forward_reference = forward_reference; 107 } 108 109 public Parameter [] arguments() { 111 return arguments; 112 } 113 114 public String [] contexts() { 115 throw new NO_RESOURCES("JacORB does not support operation contexts", 116 1, CompletionStatus.COMPLETED_MAYBE); 117 } 118 119 public TypeCode[] exceptions() { 120 return exceptions; 121 } 122 123 public org.omg.CORBA.Object forward_reference() { 124 return forward_reference; 125 } 126 127 public ServiceContext get_reply_service_context(int id) { 128 Integer _id = new Integer (id); 129 if (! reply_ctx.containsKey(_id)) 130 throw new BAD_PARAM("No ServiceContext with id " + id, 23, 131 CompletionStatus.COMPLETED_MAYBE); 132 else 133 return (ServiceContext) reply_ctx.get(_id); 134 } 135 136 public ServiceContext get_request_service_context(int id) { 137 Integer _id = new Integer (id); 138 if (! request_ctx.containsKey(_id)) 139 throw new BAD_PARAM("No ServiceContext with id " + id, 23, 140 CompletionStatus.COMPLETED_MAYBE); 141 else 142 return (ServiceContext) request_ctx.get(_id); 143 } 144 145 public Any get_slot(int id) throws InvalidSlot { 146 return current.get_slot(id); 147 } 148 149 public String operation() { 150 return operation; 151 } 152 153 public String [] operation_context() { 154 throw new NO_RESOURCES("JacORB does not support operation contexts", 1, 155 CompletionStatus.COMPLETED_MAYBE); 156 } 157 158 public short reply_status() { 159 return reply_status; 160 } 161 162 public int request_id() { 163 return request_id; 164 } 165 166 public boolean response_expected() { 167 return response_expected; 168 } 169 170 public Any result() { 171 if (result == null) 172 throw new NO_RESOURCES("Stream-based skeletons/stubs do not support this op", 173 1, CompletionStatus.COMPLETED_MAYBE); 174 else 175 return result; 176 } 177 178 public short sync_scope() { 179 return org.omg.Messaging.SYNC_WITH_TRANSPORT.value; 180 } 181 } 183 184 185 186 187 188 | Popular Tags |