use of org.apache.qpid.server.protocol.v1_0.framing.TransportFrame in project qpid-broker-j by apache.
the class Interaction method sendPerformativeAndChainFuture.
private void sendPerformativeAndChainFuture(final FrameBody frameBody, final UnsignedShort channel) throws Exception {
final TransportFrame transportFrame;
try (QpidByteBuffer payload = frameBody instanceof Transfer ? ((Transfer) frameBody).getPayload() : null) {
final QpidByteBuffer duplicate;
if (payload == null) {
duplicate = null;
} else {
duplicate = payload.duplicate();
}
transportFrame = new TransportFrame(channel.shortValue(), frameBody, duplicate);
ListenableFuture<Void> listenableFuture = sendPerformativeAndChainFuture(transportFrame);
if (frameBody instanceof Transfer) {
listenableFuture.addListener(() -> ((Transfer) frameBody).dispose(), MoreExecutors.directExecutor());
}
if (duplicate != null) {
listenableFuture.addListener(() -> duplicate.dispose(), MoreExecutors.directExecutor());
}
}
}
use of org.apache.qpid.server.protocol.v1_0.framing.TransportFrame in project qpid-broker-j by apache.
the class Interaction method sendPerformativeAndChainFuture.
private void sendPerformativeAndChainFuture(final SaslFrameBody frameBody) throws Exception {
SASLFrame transportFrame = new SASLFrame(frameBody);
sendPerformativeAndChainFuture(transportFrame);
}
Aggregations