Skip to content

Commit

Permalink
Optimize READMEOM-s & update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
vsilaev committed Sep 9, 2022
1 parent 1a1cf58 commit 3d2d343
Show file tree
Hide file tree
Showing 15 changed files with 72 additions and 64 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Maven Central](https://img.shields.io/maven-central/v/net.tascalate.javaflow/net.tascalate.javaflow.parent.svg)](https://search.maven.org/artifact/net.tascalate.javaflow/net.tascalate.javaflow.parent/2.7.2/pom) [![GitHub release](https://img.shields.io/github/release/vsilaev/tascalate-javaflow.svg)](https://github.com/vsilaev/tascalate-javaflow/releases/tag/2.7.2) [![license](https://img.shields.io/github/license/vsilaev/tascalate-javaflow.svg)](http://www.apache.org/licenses/LICENSE-2.0.txt)
[![Maven Central](https://img.shields.io/maven-central/v/net.tascalate.javaflow/net.tascalate.javaflow.parent.svg)](https://search.maven.org/artifact/net.tascalate.javaflow/net.tascalate.javaflow.parent/2.7.3/pom) [![GitHub release](https://img.shields.io/github/release/vsilaev/tascalate-javaflow.svg)](https://github.com/vsilaev/tascalate-javaflow/releases/tag/2.7.3) [![license](https://img.shields.io/github/license/vsilaev/tascalate-javaflow.svg)](http://www.apache.org/licenses/LICENSE-2.0.txt)

# IMPORTANT NOTICE FOR RELEASE 2.7.2!!!
# IMPORTANT NOTICE FOR RELEASE 2.7.0!!!
- Agents & Tools projects were refactored to follow consisntent naming of classes and to avoid package name clashes
- Separate provider was extracted from `CdiProxy` to allow reuse in mutliple scenarious (not only in Java Agent)
- `net.tascalate.javaflow.provider.asm[VERSION]` artifacts are deprecated now and scheduled for removal in next release
Expand Down Expand Up @@ -34,7 +34,7 @@ You have to add the following configuration to enable build-time instrumentation
<dependency>
<groupId>net.tascalate.javaflow</groupId>
<artifactId>net.tascalate.javaflow.api</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
<!-- Add-on for Java 8 and above -->
<dependency>
Expand All @@ -59,7 +59,7 @@ You have to add the following configuration to enable build-time instrumentation
<plugin>
<groupId>net.tascalate.javaflow</groupId>
<artifactId>net.tascalate.javaflow.tools.maven</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
<executions>
<execution>
<phase>process-classes</phase>
Expand All @@ -72,7 +72,7 @@ You have to add the following configuration to enable build-time instrumentation
</plugins>
</build>
```
Note that if you are using continuations with Java 1.8 lambdas then you need to add [Tascalate JavaFlow instrumentation agent](https://github.com/vsilaev/tascalate-javaflow/releases/download/2.7.2/javaflow.instrument-continuations.jar) at run-time as command-line option, while lambda-related classes are generated by JVM on the fly and there is no other way to instrument them. If this is not an option, then you can de-sugar all lambdas with [RetroLambda](https://github.com/luontola/retrolambda) Maven plugin at build-time (RetroLambda output is supported by Tascalate JavaFlow 2.3.2 or higher).
Note that if you are using continuations with Java 1.8 lambdas then you need to add [Tascalate JavaFlow instrumentation agent](https://github.com/vsilaev/tascalate-javaflow/releases/download/2.7.3/javaflow.instrument-continuations.jar) at run-time as command-line option, while lambda-related classes are generated by JVM on the fly and there is no other way to instrument them. If this is not an option, then you can de-sugar all lambdas with [RetroLambda](https://github.com/luontola/retrolambda) Maven plugin at build-time (RetroLambda output is supported by Tascalate JavaFlow 2.3.2 or higher).

Please refer to [pom.xml](https://github.com/vsilaev/tascalate-javaflow-examples/blob/master/net.tascalate.javaflow.examples.common/pom.xml) in examples project for typical Maven configuration

Expand Down Expand Up @@ -101,7 +101,7 @@ It's possibe to instrument compiled Java classes as below:
You may download a complete [examples project setup](https://github.com/vsilaev/tascalate-javaflow-examples/releases/download/1.0.10/tascalate-javaflow-ant-project-setup1.zip) from [the latest release](https://github.com/vsilaev/tascalate-javaflow-examples/releases/tag/1.0.10) for complete configuration template. Please pay attention to <code>ant-lib</code> folder with Ant TaskDef and <code>lib</code> folders with compile-/runtime-dependencies.

# Java Instrumentation Agent (Runt-time Instrumentation)
As an alternative to compile-time bytecode instrumentation, you MAY use [Tascalate JavaFlow Instrumentation Agent](https://github.com/vsilaev/tascalate-javaflow/releases/download/2.7.2/javaflow.instrument-continuations.jar) from [the latest release](https://github.com/vsilaev/tascalate-javaflow/releases/tag/2.7.2) to enable continuations support at class-loading time. Please note, that if you are using Java 8 and creating continuable lambda functions (either anonymous or/and as method references), and you don't replace them with tools like [RetroLambda](https://github.com/luontola/retrolambda) as mentioned above, then you SHOULD use this instrumentation agent always: as long as Java run-time generates implementation of functional interfaces on the fly there is no other option to instrument them. To enable Tascalate JavaFlow Instrumentation Agent please add the following arguments to Java command line:
As an alternative to compile-time bytecode instrumentation, you MAY use [Tascalate JavaFlow Instrumentation Agent](https://github.com/vsilaev/tascalate-javaflow/releases/download/2.7.3/javaflow.instrument-continuations.jar) from [the latest release](https://github.com/vsilaev/tascalate-javaflow/releases/tag/2.7.3) to enable continuations support at class-loading time. Please note, that if you are using Java 8 and creating continuable lambda functions (either anonymous or/and as method references), and you don't replace them with tools like [RetroLambda](https://github.com/luontola/retrolambda) as mentioned above, then you SHOULD use this instrumentation agent always: as long as Java run-time generates implementation of functional interfaces on the fly there is no other option to instrument them. To enable Tascalate JavaFlow Instrumentation Agent please add the following arguments to Java command line:
```bash
java -javaagent:<path-to-jar>/javaflow.instrument-continuations.jar <rest-of arguments>
```
Expand All @@ -110,15 +110,15 @@ The agent JAR file includes all necessary dependencies and requires no additiona
Another useful application of the instrumentation agent is to apply it for debugging code within your IDE of choice. Just specify the "-javaagent" option listed above in your IDE debug/run configuration and you will be able to perform quick "debug-fix" loops without executing full project rebuild.

# Command-line tools
It's possible to use a stand-alone command-line utility [JavaFlowRewriteJar.jar](https://github.com/vsilaev/tascalate-javaflow/releases/download/2.7.2/JavaFlowRewriteJar.jar) to instrument JAR archives containing continuable classes. Please use the following command:
It's possible to use a stand-alone command-line utility [JavaFlowRewriteJar.jar](https://github.com/vsilaev/tascalate-javaflow/releases/download/2.7.3/JavaFlowRewriteJar.jar) to instrument JAR archives containing continuable classes. Please use the following command:

```bash
java -jar JavaFlowRewriteJar.jar src1.jar dst1.jar src2.jar dst2.jar...
```
Note, that the source and the destination should be different files.

# CDI Support
To work correctly in CDI environment continuable methods should be advised only by continuation-aware CDI proxies (interceptors, scope proxies, etc). Obviously, generation of these proxies is out of our control. Plus, major CDI containers (JBoss Weld and Apache OpenWebBeans) generates such proxies dynamically at run-time. Therefore if you plan to use Tascalate JavaFlow continuations with managed beans' methods then it's necessary to instrument CDI-specific proxies with [javaflow.instrument-proxies.jar](https://github.com/vsilaev/tascalate-javaflow/releases/download/2.7.2/javaflow.instrument-proxies.jar) Java Agent:
To work correctly in CDI environment continuable methods should be advised only by continuation-aware CDI proxies (interceptors, scope proxies, etc). Obviously, generation of these proxies is out of our control. Plus, major CDI containers (JBoss Weld and Apache OpenWebBeans) generates such proxies dynamically at run-time. Therefore if you plan to use Tascalate JavaFlow continuations with managed beans' methods then it's necessary to instrument CDI-specific proxies with [javaflow.instrument-proxies.jar](https://github.com/vsilaev/tascalate-javaflow/releases/download/2.7.3/javaflow.instrument-proxies.jar) Java Agent:
```bash
java -javaagent:<path-to-jar>/javaflow.instrument-proxies.jar <rest-of arguments>
```
Expand Down
4 changes: 2 additions & 2 deletions net.tascalate.javaflow.agent.common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>net.tascalate.javaflow</groupId>
<artifactId>net.tascalate.javaflow.spi</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>${project.groupId}.spi</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Expand Down
12 changes: 7 additions & 5 deletions net.tascalate.javaflow.agent.core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
<version>${tascalate.instrument.version}</version>
</dependency>
<dependency>
<groupId>net.tascalate.javaflow</groupId>
<artifactId>net.tascalate.javaflow.agent.common</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>${project.groupId}.agent.common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.tascalate.javaflow</groupId>
<artifactId>net.tascalate.javaflow.providers.core</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>${project.groupId}.providers.core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Expand Down Expand Up @@ -80,6 +80,8 @@
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>shaded</shadedClassifierName>
<createDependencyReducedPom>true</createDependencyReducedPom>
<finalName>javaflow.instrument-continuations</finalName>
<minimizeJar>true</minimizeJar>
Expand Down Expand Up @@ -109,7 +111,7 @@
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Automatic-Module-Name>net.tascalate.javaflow.agent.core.shaded</Automatic-Module-Name>
<Automatic-Module-Name>${project.artifactId}.shaded</Automatic-Module-Name>
<Multi-Release>false</Multi-Release>
</manifestEntries>
</transformer>
Expand Down
12 changes: 7 additions & 5 deletions net.tascalate.javaflow.agent.proxy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
<version>${tascalate.instrument.version}</version>
</dependency>
<dependency>
<groupId>net.tascalate.javaflow</groupId>
<artifactId>net.tascalate.javaflow.agent.common</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>${project.groupId}.agent.common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.tascalate.javaflow</groupId>
<artifactId>net.tascalate.javaflow.providers.proxy</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>${project.groupId}.providers.proxy</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Expand Down Expand Up @@ -77,6 +77,8 @@
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>shaded</shadedClassifierName>
<createDependencyReducedPom>true</createDependencyReducedPom>
<finalName>javaflow.instrument-proxies</finalName>
<minimizeJar>true</minimizeJar>
Expand All @@ -98,7 +100,7 @@
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Automatic-Module-Name>net.tascalate.javaflow.agent.proxy.shaded</Automatic-Module-Name>
<Automatic-Module-Name>${project.artifactId}.shaded</Automatic-Module-Name>
<Multi-Release>false</Multi-Release>
</manifestEntries>
</transformer>
Expand Down
6 changes: 3 additions & 3 deletions net.tascalate.javaflow.providers.asm3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

<dependencies>
<dependency>
<groupId>net.tascalate.javaflow</groupId>
<artifactId>net.tascalate.javaflow.spi</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>${project.groupId}.spi</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Expand All @@ -47,7 +47,7 @@
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>net.tascalate.javaflow.providers.asm3</Automatic-Module-Name>
<Automatic-Module-Name>${project.artifactId}</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
Expand Down
6 changes: 3 additions & 3 deletions net.tascalate.javaflow.providers.asm4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

<dependencies>
<dependency>
<groupId>net.tascalate.javaflow</groupId>
<artifactId>net.tascalate.javaflow.spi</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>${project.groupId}.spi</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Expand All @@ -47,7 +47,7 @@
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>net.tascalate.javaflow.providers.asm4</Automatic-Module-Name>
<Automatic-Module-Name>${project.artifactId}</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
Expand Down
6 changes: 3 additions & 3 deletions net.tascalate.javaflow.providers.asm5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

<dependencies>
<dependency>
<groupId>net.tascalate.javaflow</groupId>
<artifactId>net.tascalate.javaflow.spi</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>${project.groupId}.spi</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Expand All @@ -47,7 +47,7 @@
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>net.tascalate.javaflow.providers.asm5</Automatic-Module-Name>
<Automatic-Module-Name>${project.artifactId}</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
Expand Down
4 changes: 2 additions & 2 deletions net.tascalate.javaflow.providers.asmx/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

<dependencies>
<dependency>
<groupId>net.tascalate.javaflow</groupId>
<artifactId>net.tascalate.javaflow.spi</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>${project.groupId}.spi</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions net.tascalate.javaflow.providers.core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

<dependencies>
<dependency>
<groupId>net.tascalate.javaflow</groupId>
<artifactId>net.tascalate.javaflow.spi</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>${project.groupId}.spi</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Expand Down
8 changes: 4 additions & 4 deletions net.tascalate.javaflow.providers.proxy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>net.tascalate.javaflow</groupId>
<artifactId>net.tascalate.javaflow.spi</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>${project.groupId}.spi</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.tascalate.javaflow</groupId>
<artifactId>net.tascalate.javaflow.providers.core</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>${project.groupId}.providers.core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Expand Down
10 changes: 5 additions & 5 deletions net.tascalate.javaflow.tools.ant/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@

<dependencies>
<dependency>
<groupId>net.tascalate.javaflow</groupId>
<artifactId>net.tascalate.javaflow.tools.jar</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>${project.groupId}.tools.jar</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.tascalate.javaflow</groupId>
<artifactId>net.tascalate.javaflow.providers.core</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>${project.groupId}.providers.core</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
<optional>false</optional>
Expand All @@ -50,7 +50,7 @@
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>net.tascalate.javaflow.tools.ant</Automatic-Module-Name>
<Automatic-Module-Name>${project.artifactId}</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
Expand Down
24 changes: 13 additions & 11 deletions net.tascalate.javaflow.tools.gradle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,6 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>${project.artifactId}</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand All @@ -110,6 +99,8 @@
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>shaded</shadedClassifierName>
<createDependencyReducedPom>true</createDependencyReducedPom>
<finalName>javaflow.gradle-plugin</finalName>
<minimizeJar>false</minimizeJar>
<filters>
<filter>
Expand Down Expand Up @@ -143,6 +134,17 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>${project.artifactId}</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
10 changes: 6 additions & 4 deletions net.tascalate.javaflow.tools.jar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
<optional>true</optional>
</dependency>
<dependency>
<groupId>net.tascalate.javaflow</groupId>
<artifactId>net.tascalate.javaflow.spi</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>${project.groupId}.spi</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.tascalate.javaflow</groupId>
<artifactId>net.tascalate.javaflow.providers.core</artifactId>
<artifactId>${project.groupId}.providers.core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Expand Down Expand Up @@ -72,6 +72,8 @@
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>shaded</shadedClassifierName>
<createDependencyReducedPom>true</createDependencyReducedPom>
<finalName>JavaFlowRewriteJar</finalName>
<minimizeJar>false</minimizeJar>
Expand All @@ -98,7 +100,7 @@
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Multi-Release>false</Multi-Release>
<Automatic-Module-Name>net.tascalate.javaflow.tools.jar.shaded</Automatic-Module-Name>
<Automatic-Module-Name>${project.artifactId}.shaded</Automatic-Module-Name>
</manifestEntries>
</transformer>
</transformers>
Expand Down
10 changes: 5 additions & 5 deletions net.tascalate.javaflow.tools.maven/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@

<dependencies>
<dependency>
<groupId>net.tascalate.javaflow</groupId>
<artifactId>net.tascalate.javaflow.tools.jar</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>${project.groupId}.tools.jar</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.tascalate.javaflow</groupId>
<artifactId>net.tascalate.javaflow.providers.core</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>${project.groupId}.providers.core</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
<optional>false</optional>
Expand Down Expand Up @@ -110,7 +110,7 @@
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>net.tascalate.javaflow.tools.maven</Automatic-Module-Name>
<Automatic-Module-Name>${project.artifactId}</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
Expand Down
4 changes: 2 additions & 2 deletions net.tascalate.javaflow.tools.runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

<dependencies>
<dependency>
<groupId>net.tascalate.javaflow</groupId>
<artifactId>net.tascalate.javaflow.spi</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>${project.groupId}.spi</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Expand Down

0 comments on commit 3d2d343

Please sign in to comment.