protected void writeBody ( NetworkDataRepresentation ndr ) { ndr.writeUnsignedLong ( getAllocationHint () ); ndr.writeUnsignedShort ( getContextId () ); ndr.writeUnsignedSmall ( (short)getCancelCount () ); ndr.writeUnsignedLong ( getStatus () ); }
byte[] stub = pdu.getStub(); if (stub == null) stub = new byte[0]; while (fragments.hasNext()) { FaultCoPdu fragment = (FaultCoPdu) fragments.next(); byte[] fragmentStub = fragment.getStub(); if (fragmentStub != null && fragmentStub.length > 0) { byte[] tmp = new byte[stub.length + fragmentStub.length]; pdu.setStub(stub); pdu.setAllocationHint(length); } else { pdu.setStub(null); pdu.setAllocationHint(0); pdu.setFlag(PFC_FIRST_FRAG, true); pdu.setFlag(PFC_LAST_FRAG, true); return pdu; } catch (Exception ex) {
protected void readBody(NetworkDataRepresentation ndr) { setAllocationHint(ndr.readUnsignedLong()); setContextId(ndr.readUnsignedShort()); setCancelCount(ndr.readUnsignedSmall()); setStatus((int) ndr.readUnsignedLong()); }
protected void readPdu ( NetworkDataRepresentation ndr ) { readHeader ( ndr ); readBody ( ndr ); readStub ( ndr ); }
public Object next() { if (index >= stub.length) throw new NoSuchElementException(); FaultCoPdu fragment = (FaultCoPdu) FaultCoPdu.this.clone(); int allocation = stub.length - index; fragment.setAllocationHint(allocation); if (stubSize < allocation) allocation = stubSize; byte[] fragmentStub = new byte[allocation]; System.arraycopy(stub, index, fragmentStub, 0, allocation); fragment.setStub(fragmentStub); int flags = getFlags() & ~(PFC_FIRST_FRAG | PFC_LAST_FRAG); if (index == 0) flags |= PFC_FIRST_FRAG; index += allocation; if (index >= stub.length) flags |= PFC_LAST_FRAG; fragment.setFlags(flags); return fragment; }
response = new FaultCoPdu (); response.setCallId ( ( (RequestCoPdu)request ).getCallId () ); ( (FaultCoPdu)response ).setStatus ( e.getHResult () ); throw new FaultException ( "Received fault.", fault.getStatus (), fault.getStub () );
byte[] stub = pdu.getStub(); if (stub == null) stub = new byte[0]; while (fragments.hasNext()) { FaultCoPdu fragment = (FaultCoPdu) fragments.next(); byte[] fragmentStub = fragment.getStub(); if (fragmentStub != null && fragmentStub.length > 0) { byte[] tmp = new byte[stub.length + fragmentStub.length]; pdu.setStub(stub); pdu.setAllocationHint(length); } else { pdu.setStub(null); pdu.setAllocationHint(0);
public Iterator fragment(int size) { byte[] stub = getStub(); if (stub == null) { return Arrays.asList(new FaultCoPdu[] { this }).iterator(); } int stubSize = size - 24; if (stub.length <= stubSize) { return Arrays.asList(new FaultCoPdu[] { this }).iterator(); } return new FragmentIterator(stubSize); }
case FaultCoPdu.FAULT_TYPE: throw new FaultException("Fault occurred.", ((FaultCoPdu) pdu).getStatus()); case ShutdownPdu.SHUTDOWN_TYPE: throw new RpcException("Server shutdown connection.");
public Object next() { if (index >= stub.length) throw new NoSuchElementException(); FaultCoPdu fragment = (FaultCoPdu) FaultCoPdu.this.clone(); int allocation = stub.length - index; fragment.setAllocationHint(allocation); if (stubSize < allocation) allocation = stubSize; byte[] fragmentStub = new byte[allocation]; System.arraycopy(stub, index, fragmentStub, 0, allocation); fragment.setStub(fragmentStub); int flags = getFlags() & ~(PFC_FIRST_FRAG | PFC_LAST_FRAG); if (index == 0) flags |= PFC_FIRST_FRAG; index += allocation; if (index >= stub.length) flags |= PFC_LAST_FRAG; fragment.setFlags(flags); return fragment; }
break; case FaultCoPdu.FAULT_TYPE: pdu = new FaultCoPdu (); break; case OrphanedPdu.ORPHANED_TYPE:
response = new FaultCoPdu(); response.setCallId(((RequestCoPdu) request).getCallId()); ((FaultCoPdu)response).setStatus(e.getHResult()); throw new FaultException("Received fault.", fault.getStatus(), fault.getStub()); } else if (request instanceof ShutdownPdu) { throw new RpcException("Received shutdown request from server.");
public Object next () { if ( index >= stub.length ) throw new NoSuchElementException (); FaultCoPdu fragment = (FaultCoPdu)FaultCoPdu.this.clone (); int allocation = stub.length - index; fragment.setAllocationHint ( allocation ); if ( stubSize < allocation ) allocation = stubSize; byte[] fragmentStub = new byte[allocation]; System.arraycopy ( stub, index, fragmentStub, 0, allocation ); fragment.setStub ( fragmentStub ); int flags = getFlags () & ~ ( PFC_FIRST_FRAG | PFC_LAST_FRAG ); if ( index == 0 ) flags |= PFC_FIRST_FRAG; index += allocation; if ( index >= stub.length ) flags |= PFC_LAST_FRAG; fragment.setFlags ( flags ); return fragment; }
public Iterator fragment(int size) { byte[] stub = getStub(); if (stub == null) { return Arrays.asList(new FaultCoPdu[] { this }).iterator(); } int stubSize = size - 24; if (stub.length <= stubSize) { return Arrays.asList(new FaultCoPdu[] { this }).iterator(); } return new FragmentIterator(stubSize); }
case FaultCoPdu.FAULT_TYPE: throw new FaultException("Fault occurred.", ((FaultCoPdu) pdu).getStatus()); case ShutdownPdu.SHUTDOWN_TYPE: throw new RpcException("Server shutdown connection.");
protected void readPdu(NetworkDataRepresentation ndr) { readHeader(ndr); readBody(ndr); readStub(ndr); }
break; case FaultCoPdu.FAULT_TYPE: pdu = new FaultCoPdu(); break; case OrphanedPdu.ORPHANED_TYPE: