com.microsoft.azure.eventhubs.amqp.RequestResponseCloser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-eventhubs Show documentation
Show all versions of azure-eventhubs Show documentation
Client library for talking to Microsoft Azure Event Hubs.
package com.microsoft.azure.eventhubs.amqp;
import com.microsoft.azure.eventhubs.FaultTolerantObject;
public class RequestResponseCloser implements IOperation {
private FaultTolerantObject innerChannel = null;
public RequestResponseCloser() {
}
// innerChannel is not available when this object is constructed, have to set later
public void setInnerChannel(final FaultTolerantObject innerChannel) {
this.innerChannel = innerChannel;
}
@Override
public void run(IOperationResult closeOperationCallback) {
final RequestResponseChannel channelToBeClosed = this.innerChannel.unsafeGetIfOpened();
if (channelToBeClosed == null) {
closeOperationCallback.onComplete(null);
}
else {
channelToBeClosed.close(new IOperationResult() {
@Override
public void onComplete(Void result) {
closeOperationCallback.onComplete(result);
}
@Override
public void onError(Exception error) {
closeOperationCallback.onError(error);
}
});
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy