org.hyperledger.fabric.contract.ContextFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fabric-chaincode-shim Show documentation
Show all versions of fabric-chaincode-shim Show documentation
Hyperledger Fabric Java Chaincode Shim
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package org.hyperledger.fabric.contract;
import org.hyperledger.fabric.shim.ChaincodeStub;
/**
* Factory to create {@link Context} from {@link ChaincodeStub} by wrapping stub
* with dynamic proxy.
*/
public class ContextFactory {
private static ContextFactory cf;
static synchronized public ContextFactory getInstance() {
if (cf == null) {
cf = new ContextFactory();
}
return cf;
}
public Context createContext(final ChaincodeStub stub) {
Context newContext = new Context(stub);
return newContext;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy