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

org.hyperledger.fabric.contract.Context Maven / Gradle / Ivy

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

SPDX-License-Identifier: Apache-2.0
*/

package org.hyperledger.fabric.contract;

import org.hyperledger.fabric.shim.ChaincodeStub;

/**
 *
 * This context is available to all 'transaction functions' and provides the
 * transaction context. It also provides access to the APIs for the world state
 * using {@link #getStub()}
 * 

* Applications can implement their own versions if they wish to add * functionality. All subclasses MUST implement a constructor, for example *

 * {@code
 *
 * public MyContext extends Context {
 *
 *     public MyContext(ChaincodeStub stub) {
 *        super(stub);
 *     }
 * }
 *
 *}
 *
* */ public class Context { protected ChaincodeStub stub; /** * Constructor * @param stub Instance of the {@link ChaincodeStub} to use */ public Context(ChaincodeStub stub) { this.stub = stub; } /** * * @return ChaincodeStub instance to use */ public ChaincodeStub getStub() { return this.stub; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy