Skip to content

Commit 4073b10

Browse files
committed
BAEL-1423 Java Concurrency Utility with JCTools library
Addressed editor's comments
1 parent b296e9a commit 4073b10

6 files changed

Lines changed: 52 additions & 119 deletions

File tree

‎jctools/README.md‎

Lines changed: 0 additions & 11 deletions
This file was deleted.

‎jctools/pom.xml‎

Lines changed: 0 additions & 108 deletions
This file was deleted.

‎libraries/pom.xml‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,12 @@
661661
<artifactId>fugue</artifactId>
662662
<version>4.5.1</version>
663663
</dependency>
664+
665+
<dependency>
666+
<groupId>org.jctools</groupId>
667+
<artifactId>jctools-core</artifactId>
668+
<version>${jctools.version}</version>
669+
</dependency>
664670
</dependencies>
665671
<repositories>
666672
<repository>
@@ -780,6 +786,44 @@
780786
<target>1.8</target>
781787
</configuration>
782788
</plugin>
789+
790+
<!-- Borrowed from the 'jmh-java-benchmark-archetype' pom.xml -->
791+
<plugin>
792+
<groupId>org.apache.maven.plugins</groupId>
793+
<artifactId>maven-shade-plugin</artifactId>
794+
<version>2.2</version>
795+
<executions>
796+
<execution>
797+
<phase>package</phase>
798+
<goals>
799+
<goal>shade</goal>
800+
</goals>
801+
<configuration>
802+
<finalName>benchmarks</finalName>
803+
<transformers>
804+
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
805+
<mainClass>org.openjdk.jmh.Main</mainClass>
806+
</transformer>
807+
</transformers>
808+
<filters>
809+
<filter>
810+
<!--
811+
Shading signed JARs will fail without this.
812+
http://stackoverflow.com/questions/999489/invalid-signature-file-when-attempting-to-run-a-jar
813+
-->
814+
<artifact>*:*</artifact>
815+
<excludes>
816+
<exclude>META-INF/*.SF</exclude>
817+
<exclude>META-INF/*.DSA</exclude>
818+
<exclude>META-INF/*.RSA</exclude>
819+
</excludes>
820+
</filter>
821+
</filters>
822+
</configuration>
823+
</execution>
824+
</executions>
825+
</plugin>
826+
783827
</plugins>
784828
</build>
785829

@@ -850,6 +894,7 @@
850894
<async.http.client.version>2.2.0</async.http.client.version>
851895
<infinispan.version>9.1.5.Final</infinispan.version>
852896
<unirest.version>1.4.9</unirest.version>
897+
<jctools.version>2.1.2</jctools.version>
853898
</properties>
854899

855900
</project>

jctools/src/main/java/com/baeldung/jctools/MpmcBenchmark.java renamed to libraries/src/main/java/com/baeldung/jctools/MpmcBenchmark.java

File renamed without changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## How to build and run the JMH benchmark
2+
3+
Execute the following from the project's root:
4+
```bash
5+
mvn clean install
6+
java -jar ./target/benchmarks.jar MpmcBenchmark -si true
7+
```

jctools/src/test/java/com/baeldung/jctools/JCToolsUnitTest.java renamed to libraries/src/test/java/com/baeldung/jctools/JCToolsUnitTest.java

File renamed without changes.

0 commit comments

Comments
 (0)