public void processFragment(ByteBuffer byteBuffer, FragmentMessage msg) { ByteBufferWithInfo bbwi = new ByteBufferWithInfo(orb, byteBuffer, msg.getHeaderLength()); synchronized (fragmentQueue) { if (debug) { // print address of ByteBuffer being queued int bbAddress = System.identityHashCode(byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append("processFragment() - queueing ByteBuffer id ("); sb.append(bbAddress).append(") to fragment queue."); String strMsg = sb.toString(); dprint(strMsg); } fragmentQueue.enqueue(bbwi); endOfStream = !msg.moreFragmentsToFollow(); fragmentQueue.notify(); } }
public void overflow(ByteBufferWithInfo bbwi) { // Set the fragment's moreFragments field to true MessageBase.setFlag(bbwi.byteBuffer, Message.MORE_FRAGMENTS_BIT); sendFragment(false); // Reuse the old buffer // REVISIT - need to account for case when needed > available even after fragmenting. This is the large array // case, so the caller should retry when it runs out of space. bbwi.position(0); bbwi.buflen = bbwi.byteBuffer.limit(); bbwi.fragmented = true; // Now we must marshal in the fragment header/GIOP header // REVISIT - we can optimize this by not creating the fragment message each time. FragmentMessage header = ((CDROutputObject) outputObject).getMessageHeader().createFragmentMessage(); header.write(((CDROutputObject) outputObject)); }
FragmentMessage_1_2(Message_1_1 msg12) { this.magic = msg12.magic; this.GIOP_version = msg12.GIOP_version; this.flags = msg12.flags; this.message_type = GIOPFragment; this.message_size = 0; switch (msg12.message_type) { case GIOPRequest : this.request_id = ((RequestMessage) msg12).getRequestId(); break; case GIOPReply : this.request_id = ((ReplyMessage) msg12).getRequestId(); break; case GIOPLocateRequest : this.request_id = ((LocateRequestMessage) msg12).getRequestId(); break; case GIOPLocateReply : this.request_id = ((LocateReplyMessage) msg12).getRequestId(); break; case GIOPFragment : this.request_id = ((FragmentMessage) msg12).getRequestId(); break; } }
FragmentMessage_1_2(Message_1_1 msg12) { this.magic = msg12.magic; this.GIOP_version = msg12.GIOP_version; this.flags = msg12.flags; this.message_type = GIOPFragment; this.message_size = 0; switch (msg12.message_type) { case GIOPRequest : this.request_id = ((RequestMessage) msg12).getRequestId(); break; case GIOPReply : this.request_id = ((ReplyMessage) msg12).getRequestId(); break; case GIOPLocateRequest : this.request_id = ((LocateRequestMessage) msg12).getRequestId(); break; case GIOPLocateReply : this.request_id = ((LocateReplyMessage) msg12).getRequestId(); break; case GIOPFragment : this.request_id = ((FragmentMessage) msg12).getRequestId(); break; } }
public void processFragment(ByteBuffer byteBuffer, FragmentMessage msg) { ByteBufferWithInfo bbwi = new ByteBufferWithInfo(orb, byteBuffer, msg.getHeaderLength()); synchronized (fragmentQueue) { if (debug) { // print address of ByteBuffer being queued int bbAddress = System.identityHashCode(byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append("processFragment() - queueing ByteBuffer id ("); sb.append(bbAddress).append(") to fragment queue."); String strMsg = sb.toString(); dprint(strMsg); } fragmentQueue.enqueue(bbwi); endOfStream = !msg.moreFragmentsToFollow(); fragmentQueue.notify(); } }
public void overflow(ByteBufferWithInfo bbwi) { // Set the fragment's moreFragments field to true MessageBase.setFlag(bbwi.byteBuffer, Message.MORE_FRAGMENTS_BIT); sendFragment(false); // Reuse the old buffer // REVISIT - need to account for case when needed > available even after fragmenting. This is the large array // case, so the caller should retry when it runs out of space. bbwi.position(0); bbwi.buflen = bbwi.byteBuffer.limit(); bbwi.fragmented = true; // Now we must marshal in the fragment header/GIOP header // REVISIT - we can optimize this by not creating the fragment message each time. FragmentMessage header = ((CDROutputObject) outputObject).getMessageHeader().createFragmentMessage(); header.write(((CDROutputObject) outputObject)); }
public static int getRequestId(Message msg) { switch (msg.getType()) { case GIOPRequest : return ((RequestMessage) msg).getRequestId(); case GIOPReply : return ((ReplyMessage) msg).getRequestId(); case GIOPLocateRequest : return ((LocateRequestMessage) msg).getRequestId(); case GIOPLocateReply : return ((LocateReplyMessage) msg).getRequestId(); case GIOPCancelRequest : return ((CancelRequestMessage) msg).getRequestId(); case GIOPFragment : return ((FragmentMessage) msg).getRequestId(); } throw wrapper.illegalGiopMsgType(CompletionStatus.COMPLETED_MAYBE); }
public void overflow(ByteBufferWithInfo bbwi) { // Set the fragment's moreFragments field to true MessageBase.setFlag(bbwi.byteBuffer, Message.MORE_FRAGMENTS_BIT); // Enqueue the previous fragment queue.enqueue(bbwi); // Create a new bbwi ByteBufferWithInfo newBbwi = new ByteBufferWithInfo(orb, this); newBbwi.fragmented = true; // XREVISIT - Downcast ((CDROutputObject) outputObject).setByteBufferWithInfo(newBbwi); // Now we must marshal in the fragment header/GIOP header // REVISIT - we can optimize this by not creating the fragment message each time. // XREVISIT - Downcast FragmentMessage header = ((CDROutputObject) outputObject).getMessageHeader().createFragmentMessage(); header.write((CDROutputObject) outputObject); }
public static int getRequestId(Message msg) { switch (msg.getType()) { case GIOPRequest : return ((RequestMessage) msg).getRequestId(); case GIOPReply : return ((ReplyMessage) msg).getRequestId(); case GIOPLocateRequest : return ((LocateRequestMessage) msg).getRequestId(); case GIOPLocateReply : return ((LocateReplyMessage) msg).getRequestId(); case GIOPCancelRequest : return ((CancelRequestMessage) msg).getRequestId(); case GIOPFragment : return ((FragmentMessage) msg).getRequestId(); } throw wrapper.illegalGiopMsgType(CompletionStatus.COMPLETED_MAYBE); }
public void overflow(ByteBufferWithInfo bbwi) { // Set the fragment's moreFragments field to true MessageBase.setFlag(bbwi.byteBuffer, Message.MORE_FRAGMENTS_BIT); // Enqueue the previous fragment queue.enqueue(bbwi); // Create a new bbwi ByteBufferWithInfo newBbwi = new ByteBufferWithInfo(orb, this); newBbwi.fragmented = true; // XREVISIT - Downcast ((CDROutputObject) outputObject).setByteBufferWithInfo(newBbwi); // Now we must marshal in the fragment header/GIOP header // REVISIT - we can optimize this by not creating the fragment message each time. // XREVISIT - Downcast FragmentMessage header = ((CDROutputObject) outputObject).getMessageHeader().createFragmentMessage(); header.write((CDROutputObject) outputObject); }