private static void dissect(final PublicationMessageFlyweight msg, final StringBuilder builder) { builder .append(msg.channel()) .append(' ') .append(msg.streamId()) .append(" [") .append(msg.clientId()) .append(':') .append(msg.correlationId()) .append(']'); }
public void addPublication(final long correlationId, final boolean isExclusive) { final int streamId = publicationMsgFlyweight.streamId(); final long clientId = publicationMsgFlyweight.clientId(); final String channel = publicationMsgFlyweight.channel(); if (channel.startsWith(IPC_CHANNEL)) { conductor.onAddIpcPublication(channel, streamId, correlationId, clientId, isExclusive); } else { conductor.onAddNetworkPublication(channel, streamId, correlationId, clientId, isExclusive); } }
public long addPublication(final String channel, final int streamId) { final long correlationId = toDriverCommandBuffer.nextCorrelationId(); publicationMessage.correlationId(correlationId); publicationMessage .streamId(streamId) .channel(channel); if (!toDriverCommandBuffer.write(ADD_PUBLICATION, buffer, 0, publicationMessage.length())) { throw new AeronException("could not write add publication command"); } return correlationId; }
public long addExclusivePublication(final String channel, final int streamId) { final long correlationId = toDriverCommandBuffer.nextCorrelationId(); publicationMessage.correlationId(correlationId); publicationMessage .streamId(streamId) .channel(channel); if (!toDriverCommandBuffer.write(ADD_EXCLUSIVE_PUBLICATION, buffer, 0, publicationMessage.length())) { throw new AeronException("could not write add exclusive publication command"); } return correlationId; }
private void threadSendsChannelMessage(final Runnable sendMessage, final int expectedMsgTypeId) { sendMessage.run(); assertReadsOneMessage( (msgTypeId, buffer, index, length) -> { final PublicationMessageFlyweight publicationMessage = new PublicationMessageFlyweight(); publicationMessage.wrap(buffer, index); assertThat(msgTypeId, is(expectedMsgTypeId)); assertThat(publicationMessage.channel(), is(CHANNEL)); assertThat(publicationMessage.streamId(), is(STREAM_ID)); } ); }
private static void dissect(final PublicationMessageFlyweight msg, final StringBuilder builder) { builder .append(msg.channel()) .append(' ') .append(msg.streamId()) .append(" [") .append(msg.clientId()) .append(':') .append(msg.correlationId()) .append(']'); }
public void addPublication(final long correlationId, final boolean isExclusive) { final int streamId = publicationMsgFlyweight.streamId(); final long clientId = publicationMsgFlyweight.clientId(); final String channel = publicationMsgFlyweight.channel(); if (channel.startsWith(IPC_CHANNEL)) { conductor.onAddIpcPublication(channel, streamId, correlationId, clientId, isExclusive); } else { conductor.onAddNetworkPublication(channel, streamId, correlationId, clientId, isExclusive); } }
public void addPublication(final long correlationId, final boolean isExclusive) { final int streamId = publicationMsgFlyweight.streamId(); final long clientId = publicationMsgFlyweight.clientId(); final String channel = publicationMsgFlyweight.channel(); if (channel.startsWith(IPC_CHANNEL)) { conductor.onAddIpcPublication(channel, streamId, correlationId, clientId, isExclusive); } else { conductor.onAddNetworkPublication(channel, streamId, correlationId, clientId, isExclusive); } }
public long addPublication(final String channel, final int streamId) { final long correlationId = toDriverCommandBuffer.nextCorrelationId(); publicationMessage.correlationId(correlationId); publicationMessage .streamId(streamId) .channel(channel); if (!toDriverCommandBuffer.write(ADD_PUBLICATION, buffer, 0, publicationMessage.length())) { throw new AeronException("could not write add publication command"); } return correlationId; }
public long addExclusivePublication(final String channel, final int streamId) { final long correlationId = toDriverCommandBuffer.nextCorrelationId(); publicationMessage.correlationId(correlationId); publicationMessage .streamId(streamId) .channel(channel); if (!toDriverCommandBuffer.write(ADD_EXCLUSIVE_PUBLICATION, buffer, 0, publicationMessage.length())) { throw new AeronException("could not write add exclusive publication command"); } return correlationId; }
public long addPublication(final String channel, final int streamId) { final long correlationId = toDriverCommandBuffer.nextCorrelationId(); publicationMessage.correlationId(correlationId); publicationMessage .streamId(streamId) .channel(channel); if (!toDriverCommandBuffer.write(ADD_PUBLICATION, buffer, 0, publicationMessage.length())) { throw new AeronException("could not write add publication command"); } return correlationId; }
public long addExclusivePublication(final String channel, final int streamId) { final long correlationId = toDriverCommandBuffer.nextCorrelationId(); publicationMessage.correlationId(correlationId); publicationMessage .streamId(streamId) .channel(channel); if (!toDriverCommandBuffer.write(ADD_EXCLUSIVE_PUBLICATION, buffer, 0, publicationMessage.length())) { throw new AeronException("could not write add exclusive publication command"); } return correlationId; }