All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hyperledger.fabric.shim.impl.ChaincodeSupportClient Maven / Gradle / Ivy

There is a newer version: 2.5.5
Show newest version
/*
Copyright IBM Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0
*/
package org.hyperledger.fabric.shim.impl;

import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import io.grpc.stub.StreamObserver;
import org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage;
import org.hyperledger.fabric.protos.peer.ChaincodeSupportGrpc;
import org.hyperledger.fabric.protos.peer.ChaincodeSupportGrpc.ChaincodeSupportStub;

import java.util.concurrent.TimeUnit;

public class ChaincodeSupportClient {

    private final ManagedChannel channel;
    private final ChaincodeSupportStub stub;

    public ChaincodeSupportClient(ManagedChannelBuilder channelBuilder) {
        this.channel = channelBuilder.build();
        this.stub = ChaincodeSupportGrpc.newStub(channel);
    }

    public void shutdown() throws InterruptedException {
        this.channel.shutdown().awaitTermination(5, TimeUnit.SECONDS);
    }

    public StreamObserver register(StreamObserver responseObserver) {
        return stub.register(responseObserver);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy