Skip to content

Commit 351acb5

Browse files
[FAB-13794] New Annotations
Change-Id: I76a8258633b990746aae3026ffb009e0d3375160 Signed-off-by: gennady <[email protected]>
1 parent 3e13a57 commit 351acb5

File tree

6 files changed

+112
-1
lines changed

6 files changed

+112
-1
lines changed

fabric-chaincode-shim/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ plugins {
1313

1414
dependencies {
1515
compile project(':fabric-chaincode-protos')
16-
compile 'io.netty:netty-tcnative-boringssl-static:2.0.15.Final'
16+
compile 'io.netty:netty-tcnative-boringssl-static:2.0.7.Final'
17+
compile 'io.swagger.core.v3:swagger-annotations:2.0.0'
1718
compile 'org.bouncycastle:bcpkix-jdk15on:1.60'
1819
compile 'org.bouncycastle:bcprov-jdk15on:1.60'
1920
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
Copyright IBM Corp., DTCC All Rights Reserved.
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
*/
6+
package org.hyperledger.fabric.contract.annotation;
7+
8+
import java.lang.annotation.ElementType;
9+
import java.lang.annotation.Retention;
10+
import java.lang.annotation.Target;
11+
12+
import static java.lang.annotation.RetentionPolicy.RUNTIME;
13+
14+
/**
15+
* Class level annotation indicating this class represents one of the complex types that
16+
* can be returned or passed to the transaction functions
17+
*/
18+
@Retention(RUNTIME)
19+
@Target(ElementType.TYPE)
20+
public @interface DataType {
21+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
Copyright IBM Corp., DTCC All Rights Reserved.
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
*/
6+
package org.hyperledger.fabric.contract.annotation;
7+
8+
import java.lang.annotation.ElementType;
9+
import java.lang.annotation.Retention;
10+
import java.lang.annotation.Target;
11+
12+
import static java.lang.annotation.RetentionPolicy.RUNTIME;
13+
14+
/**
15+
* Class level annotation that defines the contract that is the default contract,
16+
* and as such invoke of the transaction functions does not need to be qualified by the contract name
17+
*/
18+
@Retention(RUNTIME)
19+
@Target(ElementType.TYPE)
20+
public @interface Default {
21+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
Copyright IBM Corp., DTCC All Rights Reserved.
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
package org.hyperledger.fabric.contract.annotation;
8+
9+
import java.lang.annotation.Retention;
10+
import java.lang.annotation.Target;
11+
12+
import static java.lang.annotation.ElementType.METHOD;
13+
import static java.lang.annotation.RetentionPolicy.RUNTIME;
14+
15+
/**
16+
* Method level annotation indicating the function to be a called during contract instantiation
17+
*/
18+
@Retention(RUNTIME)
19+
@Target(METHOD)
20+
public @interface Init {
21+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
Copyright IBM Corp., DTCC All Rights Reserved.
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
*/
6+
package org.hyperledger.fabric.contract.annotation;
7+
8+
import java.lang.annotation.ElementType;
9+
import java.lang.annotation.Retention;
10+
import java.lang.annotation.Target;
11+
12+
import static java.lang.annotation.RetentionPolicy.RUNTIME;
13+
14+
/**
15+
* Property level annotation defining a property of the class (identified by {@link @DataType})
16+
*/
17+
@Retention(RUNTIME)
18+
@Target(ElementType.METHOD)
19+
public @interface Property {
20+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
Copyright IBM Corp., DTCC All Rights Reserved.
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
package org.hyperledger.fabric.contract.annotation;
8+
9+
import java.lang.annotation.Retention;
10+
import java.lang.annotation.Target;
11+
12+
import static java.lang.annotation.ElementType.METHOD;
13+
import static java.lang.annotation.RetentionPolicy.RUNTIME;
14+
15+
/**
16+
* Method level annotation indicating the function to be a callable transaction function
17+
*/
18+
@Retention(RUNTIME)
19+
@Target(METHOD)
20+
public @interface Transaction {
21+
/**
22+
* true indicates that this function is intended to be called with the 'submit' semantics<p>
23+
* false indicates that this is intended to be called with the evaluate semantics
24+
* @return
25+
*/
26+
boolean submit() default true;
27+
}

0 commit comments

Comments
 (0)