use of org.wso2.transport.http.netty.message.ResponseHandle in project ballerina by ballerina-lang.
the class GetResponse method execute.
@Override
public void execute(Context context, CallableUnitCallback callback) {
DataContext dataContext = new DataContext(context, callback);
BStruct handleStruct = ((BStruct) context.getRefArgument(1));
ResponseHandle responseHandle = (ResponseHandle) handleStruct.getNativeData(HttpConstants.TRANSPORT_HANDLE);
if (responseHandle == null) {
throw new BallerinaException("invalid http handle");
}
BStruct bConnector = (BStruct) context.getRefArgument(0);
HttpClientConnector clientConnector = (HttpClientConnector) bConnector.getNativeData(HttpConstants.HTTP_CLIENT);
clientConnector.getResponse(responseHandle).setHttpConnectorListener(new ResponseListener(dataContext));
}
use of org.wso2.transport.http.netty.message.ResponseHandle in project ballerina by ballerina-lang.
the class HasPromise method execute.
@Override
public void execute(Context context, CallableUnitCallback callback) {
BStruct handleStruct = ((BStruct) context.getRefArgument(1));
ResponseHandle responseHandle = (ResponseHandle) handleStruct.getNativeData(HttpConstants.TRANSPORT_HANDLE);
if (responseHandle == null) {
throw new BallerinaException("invalid http handle");
}
BStruct bConnector = (BStruct) context.getRefArgument(0);
HttpClientConnector clientConnector = (HttpClientConnector) bConnector.getNativeData(HttpConstants.HTTP_CLIENT);
clientConnector.hasPushPromise(responseHandle).setPromiseAvailabilityListener(new PromiseAvailabilityCheckListener(context, callback));
}
use of org.wso2.transport.http.netty.message.ResponseHandle in project ballerina by ballerina-lang.
the class GetNextPromise method execute.
@Override
public void execute(Context context, CallableUnitCallback callback) {
DataContext dataContext = new DataContext(context, callback);
BStruct handleStruct = ((BStruct) context.getRefArgument(1));
ResponseHandle responseHandle = (ResponseHandle) handleStruct.getNativeData(HttpConstants.TRANSPORT_HANDLE);
if (responseHandle == null) {
throw new BallerinaException("invalid http handle");
}
BStruct bConnector = (BStruct) context.getRefArgument(0);
HttpClientConnector clientConnector = (HttpClientConnector) bConnector.getNativeData(HttpConstants.HTTP_CLIENT);
clientConnector.getNextPushPromise(responseHandle).setPushPromiseListener(new PromiseListener(dataContext));
}
Aggregations