UnsignedIntegerFixedFourWriter(final UnsignedInteger object) { super(object.intValue()); }
public UnsignedInteger unsignedIntegerValue() { return UnsignedInteger.valueOf(_seqNo); } }
public static TerminusDurability min(TerminusDurability durabilityA, TerminusDurability durabilityB) { int durabilitAValue = durabilityA != null ? durabilityA._val.intValue() : 0; int durabilityBValue = durabilityB != null ? durabilityB._val.intValue() : 0; return TerminusDurability.valueOf(new UnsignedInteger(Math.min(durabilitAValue, durabilityBValue))); } }
public void sendFlowConditional() { if(_nextIncomingId != null) { UnsignedInteger clientsCredit = _lastSentIncomingLimit.subtract(UnsignedInteger.valueOf(_nextIncomingId.intValue())); // TODO - we should use a better metric here, and/or manage session credit across the whole connection // send a flow if the window is at least half used up if (_incomingWindow.subtract(clientsCredit).compareTo(clientsCredit) >= 0) { sendFlow(); } } }
public Session_1_0(final AMQPConnection_1_0 connection, Begin begin, int sendingChannelId, int receivingChannelId, long incomingWindow) { super(connection, sendingChannelId); _sendingChannel = sendingChannelId; _sessionState = SessionState.ACTIVE; _nextIncomingId = new SequenceNumber(begin.getNextOutgoingId().intValue()); _connection = connection; _primaryDomain = getPrimaryDomain(); _incomingWindow = UnsignedInteger.valueOf(incomingWindow); AccessController.doPrivileged((new PrivilegedAction<Object>() { @Override public Object run() { _connection.getEventLogger().message(ChannelMessages.CREATE()); return null; } }), _accessControllerContext); }
public void sendFlow(final Flow flow) { if(_nextIncomingId != null) { flow.setNextIncomingId(_nextIncomingId.unsignedIntegerValue()); _lastSentIncomingLimit = _incomingWindow.add(_nextIncomingId.unsignedIntegerValue()); } flow.setIncomingWindow(_incomingWindow); flow.setNextOutgoingId(UnsignedInteger.valueOf(_nextOutgoingId.intValue())); flow.setOutgoingWindow(_outgoingWindow); send(flow); }
? _initialOutgoingId.intValue() : flow.getNextIncomingId().intValue()); if (flowNextIncomingId.compareTo(_nextOutgoingId) > 0) _remoteIncomingWindow = flowNextIncomingId.longValue() + flow.getIncomingWindow().longValue() - _nextOutgoingId.longValue(); _nextIncomingId = new SequenceNumber(flow.getNextOutgoingId().intValue()); _remoteOutgoingWindow = flow.getOutgoingWindow(); String.format("Received Flow with unknown handle %d", handle.intValue()))); end(end);
@Override public float floatValue() { return (float) longValue(); }
public static SoleConnectionDetectionPolicy valueOf(Object obj) { if (obj instanceof UnsignedInteger) { UnsignedInteger val = (UnsignedInteger) obj; if (STRONG._val.equals(val)) { return STRONG; } if (WEAK._val.equals(val)) { return WEAK; } } final String message = String.format("Cannot convert '%s' into 'sole-connection-detection-policy'", obj); throw new IllegalArgumentException(message); }
public void sendFlowConditional() { if(_lastSentCreditLimit != null) { if(_stoppedUpdated) { sendFlow(false); _stoppedUpdated = false; } else { UnsignedInteger clientsCredit = _lastSentCreditLimit.subtract(_deliveryCount.unsignedIntegerValue()); // client has used up over half their credit allowance ? boolean sendFlow = _linkCredit.subtract(clientsCredit).compareTo(clientsCredit) >= 0; if (sendFlow) { sendFlow(false); } else { getSession().sendFlowConditional(); } } } else { sendFlow(false); } }
@Override public void restoreCredit(final ServerMessage message) { _linkEndpoint.setLinkCredit(_linkEndpoint.getLinkCredit().add(UnsignedInteger.ONE)); updateNotifyWorkDesired(); }
public boolean hasCreditToSend() { boolean b = _remoteIncomingWindow > 0; boolean b1 = getOutgoingWindow() != null && getOutgoingWindow().compareTo(UnsignedInteger.ZERO) > 0; return b && b1; }
@Override public int hashCode() { int result = _address != null ? _address.hashCode() : 0; result = 31 * result + (_durable != null ? _durable.hashCode() : 0); result = 31 * result + (_expiryPolicy != null ? _expiryPolicy.hashCode() : 0); result = 31 * result + (_timeout != null ? _timeout.hashCode() : 0); result = 31 * result + (_dynamic != null ? _dynamic.hashCode() : 0); result = 31 * result + (_dynamicNodeProperties != null ? _dynamicNodeProperties.hashCode() : 0); result = 31 * result + Arrays.hashCode(_capabilities); return result; }
public static UnsignedInteger valueOf(int underlying) { if((underlying & 0xFFFFFF00) == 0) { return cachedValues[underlying]; } else { return new UnsignedInteger(underlying); } }
UnsignedIntegerFixedOneWriter(final UnsignedInteger value) { super(value.byteValue()); }