/** * @see ca.uhn.hl7v2.protocol.Processor#receive(java.lang.String, long) */ public Transportable receive(String theAckId, long theTimeoutMillis) throws HL7Exception { if (!isReserved(theAckId)) { reserve(theAckId, theTimeoutMillis); } Transportable in = null; long until = System.currentTimeMillis() + theTimeoutMillis; do { synchronized (this) { ExpiringTransportable et = myAvailableMessages.get(theAckId); if (et == null) { cycleIfNeeded(false); } else { in = et.transportable; } } sleepIfNeeded(); } while (in == null && System.currentTimeMillis() < until); return in; }
/** * @see ca.uhn.hl7v2.protocol.Processor#receive(java.lang.String, long) */ public Transportable receive(String theAckId, long theTimeoutMillis) throws HL7Exception { if (!isReserved(theAckId)) { reserve(theAckId, theTimeoutMillis); } Transportable in = null; long until = System.currentTimeMillis() + theTimeoutMillis; do { synchronized (this) { ExpiringTransportable et = myAvailableMessages.get(theAckId); if (et == null) { cycleIfNeeded(false); } else { in = et.transportable; } } sleepIfNeeded(); } while (in == null && System.currentTimeMillis() < until); return in; }
ExpiringTransportable et = myAcceptAcks.remove(controlId); if (et == null) { cycleIfNeeded(true); } else { response = et.transportable;
ExpiringTransportable et = myAcceptAcks.remove(controlId); if (et == null) { cycleIfNeeded(true); } else { response = et.transportable;