Skip to content

Commit ad4ee67

Browse files
committed
Merge branch 'feature-engine-compatibility-upgrade' into release-3.0.0
2 parents 956b170 + 9a84018 commit ad4ee67

17 files changed

Lines changed: 400 additions & 107 deletions

File tree

.github/workflows/ci.yml

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
name: Auto test, build and publish
2+
on:
3+
push:
4+
pull_request:
5+
jobs:
6+
javabuild:
7+
name: Java build
8+
runs-on: ubuntu-latest
9+
if: "!contains(github.event.head_commit.message, '[twgit] Init') && github.ref != 'refs/heads/stable'"
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
- name: Setup Java
16+
uses: actions/setup-java@v5
17+
with:
18+
distribution: 'temurin'
19+
java-version: '21'
20+
- name: Maven build
21+
run: |
22+
build/javabuild.sh
23+
- name: Upload Java Artifacts
24+
uses: actions/upload-artifact@v4
25+
with:
26+
name: cfconcurrent-java-artifacts
27+
path: luceelib/*.jar
28+
29+
runtests:
30+
name: Run tests
31+
needs: javabuild
32+
runs-on: ubuntu-latest
33+
if: "!contains(github.event.head_commit.message, '[twgit] Init') && github.ref != 'refs/heads/stable'"
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
include:
38+
- cfengine: "lucee@5.4"
39+
jdkVersion: "11"
40+
experimental: false
41+
- cfengine: "lucee@6.2"
42+
jdkVersion: "21"
43+
experimental: false
44+
- cfengine: "lucee@7.0"
45+
jdkVersion: "24"
46+
experimental: false
47+
- cfengine: "boxlang@stable"
48+
jdkVersion: "24"
49+
experimental: true
50+
- cfengine: "adobe@2018"
51+
jdkVersion: "11"
52+
experimental: false
53+
- cfengine: "adobe@2023"
54+
jdkVersion: "21"
55+
experimental: false
56+
- cfengine: "adobe@2025"
57+
jdkVersion: "24"
58+
experimental: false
59+
continue-on-error: ${{ matrix.experimental }}
60+
steps:
61+
- name: Checkout code
62+
uses: actions/checkout@v4
63+
with:
64+
fetch-depth: 0
65+
66+
- name: Download Java Artifacts
67+
uses: actions/download-artifact@v4
68+
with:
69+
name: cfconcurrent-java-artifacts
70+
path: luceelib
71+
72+
- name: Setup Java
73+
uses: actions/setup-java@v4
74+
with:
75+
distribution: "temurin"
76+
java-version: ${{ matrix.jdkVersion }}
77+
78+
- name: Setup CommandBox CLI
79+
uses: Ortus-Solutions/setup-commandbox@v2.0.1
80+
81+
- name: Install dependencies
82+
run: |
83+
cd build/tests && box install --force --verbose
84+
85+
- name: Start ${{ matrix.cfengine }} Server
86+
run: |
87+
# Startup the Server
88+
box server start directory="${GITHUB_WORKSPACE}/build/tests" serverConfigFile="${GITHUB_WORKSPACE}/build/tests/server-cfconcurrenttests.json" cfengine="${{ matrix.cfengine }}" --noSaveSettings --debug
89+
# Test site build up
90+
curl http://127.0.0.1:6789
91+
92+
- name: Run tests
93+
run: |
94+
cd build/tests/
95+
mkdir -p results
96+
exitcode=0
97+
box testbox run --verbose outputFile=results/test-results outputFormats=json,antjunit
98+
99+
- name: Upload Test Results Artifacts
100+
if: always()
101+
uses: actions/upload-artifact@v4
102+
with:
103+
name: cfconcurrent-test-results-${{ matrix.cfengine }}-jdk${{ matrix.jdkVersion }}
104+
path: |
105+
tests/results/*
106+
107+
- name: Publish Test Results
108+
uses: EnricoMi/publish-unit-test-result-action@v2
109+
with:
110+
files: build/tests/results/*.xml
111+
112+
publish:
113+
name: Publish
114+
needs: runtests
115+
runs-on: ubuntu-latest
116+
if: "success() && github.event_name != 'pull_request' && ( startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/release-' ) )"
117+
steps:
118+
- name: Checkout code
119+
uses: actions/checkout@v4
120+
with:
121+
fetch-depth: 0
122+
123+
- name: Download Java Artifacts
124+
uses: actions/download-artifact@v4
125+
with:
126+
name: cfconcurrent-java-artifacts
127+
path: luceelib
128+
129+
- name: Generate release version number
130+
id: versiongen
131+
uses: pixl8/github-action-twgit-release-version-generator@v3
132+
133+
- name: Inject version into box json
134+
if: "env.PUBLISH == 'true'"
135+
uses: dominicwatson/github-action-envsubst@v1
136+
with:
137+
files: box.json
138+
patterns: $VERSION_NUMBER
139+
env:
140+
VERSION_NUMBER: ${{ steps.versiongen.outputs.semver_release_string }}
141+
142+
- name: Zip project
143+
if: "env.PUBLISH == 'true'"
144+
145+
run: zip -rq $ZIP_FILE * --exclude=".*" --exclude="\.git/*" --exclude="\.github/*" --exclude="\build/*""
146+
shell: bash
147+
env:
148+
ZIP_FILE: ${{ steps.versiongen.outputs.semver_release_number }}.zip
149+
150+
- name: Create Release
151+
if: "env.PUBLISH == 'true'"
152+
id: create_release
153+
uses: actions/create-release@v1
154+
env:
155+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
156+
with:
157+
tag_name: ${{ steps.versiongen.outputs.semver_release_string }}
158+
release_name: Release ${{ steps.versiongen.outputs.semver_release_string }}
159+
draft: false
160+
prerelease: ${{ steps.versiongen.outputs.semver_release_is_snapshot }}
161+
162+
- name: Upload Release Asset
163+
if: "env.PUBLISH == 'true'"
164+
id: upload
165+
uses: actions/upload-release-asset@v1
166+
env:
167+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
168+
with:
169+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
170+
asset_path: ${{ steps.versiongen.outputs.semver_release_number }}.zip
171+
asset_name: ${{ steps.versiongen.outputs.semver_release_number }}.zip
172+
asset_content_type: application/zip
173+
174+
- name: Inject download location
175+
if: "env.PUBLISH == 'true'"
176+
uses: DominicWatson/github-action-envsubst@stable
177+
with:
178+
files: box.json
179+
env:
180+
DOWNLOAD_URL: ${{ steps.upload.outputs.browser_download_url }}
181+
182+
- name: Publish to forgebox
183+
if: "env.PUBLISH == 'true'"
184+
uses: pixl8/github-action-box-publish@v3
185+
with:
186+
forgebox_user: ${{ secrets.FORGEBOX_USER }}
187+
forgebox_pass: ${{ secrets.FORGEBOX_PASS }}

.travis.yml

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

AbstractExecutorService.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ component output="false" accessors="true"{
164164
if( NOT structIsEmpty( getThisStorageScope() ) ){
165165
var scope = getThisStorageScope();
166166
for( var executor in scope ){
167-
writeLog("Waiting #timeout# #timeUnit# for tasks to complete and then shutting down executor named #executor#");
167+
writeLog("Waiting #timeout# #timeUnit.toString()# for tasks to complete and then shutting down executor named #executor#");
168168
scope[executor].shutDown();
169169
var stopped = scope[executor].awaitTermination( timeout, timeUnit );
170170
if(NOT stopped){

ExecutorCompletionService.cfc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ component extends="AbstractExecutorService" accessors="true" output="false"{
7575

7676
private function scheduleCompletionTask(){
7777
logMessage("Starting to schedule completion task");
78-
if( structKeyExists( variables, "completionQueueProcessService") AND NOT isSimpleValue(variables.completionQueueProcessTask) ){
79-
logMessage( "scheduling completion task at rate of #completionQueueProcessFrequency# #comletionQueueProcessTimeUnit#" );
78+
if( structKeyExists( variables, "completionQueueProcessService") AND NOT isSimpleValue(completionQueueProcessTask) AND NOT IsNull( completionQueueProcessService ) ){
79+
logMessage( "scheduling completion task at rate of #completionQueueProcessFrequency# #comletionQueueProcessTimeUnit.toString()#" );
8080
completionQueueProcessTask.setExecutorCompletionService( getExecutorCompletionService() );
8181
return completionQueueProcessService.scheduleAtFixedRate( completionQueueProcessTaskID, completionQueueProcessTask, completionQueueProcessFrequency, completionQueueProcessFrequency, comletionQueueProcessTimeUnit);
8282
}

ObjectFactory.cfc

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ component output="false" accessors="true"{
22

33
property name="cfcDynamicProxy";
44

5-
callableInterfaces = ["java.util.concurrent.Callable"];
6-
runnableInterfaces = ["java.lang.Runnable"];
5+
callableInterfaces = ["java.util.concurrent.Callable"];
6+
runnableInterfaces = ["java.lang.Runnable"];
77
threadFactoryInterfaces = ["java.util.concurrent.ThreadFactory"];
8-
timeUnit = createTimeUnit();
8+
timeUnit = createTimeUnit();
99

1010
//conveniences... we work a lot with timeunit so let's make it a bit easier
1111
this.nanoseconds = timeUnit.NANOSECONDS;
@@ -165,6 +165,24 @@ component output="false" accessors="true"{
165165
}
166166

167167
private array function _getLuceeLib() {
168-
return DirectoryList( GetDirectoryFromPath( GetCurrentTemplatePath() ) & "/luceelib", false, "path", "*.jar" );
168+
var basePath = GetDirectoryFromPath( GetCurrentTemplatePath() ) & "/luceelib/";
169+
if ( _isJakarta() ) {
170+
return [ basePath & "cfconcurrent-jakarta.jar" ];
171+
}
172+
173+
return [ basePath & "cfconcurrent.jar" ];
174+
}
175+
176+
private boolean function _isJakarta() {
177+
if ( !StructKeyExists( variables, "isJakarta" ) ) {
178+
try {
179+
createObject( "java", "jakarta.servlet.ServletException" );
180+
variables.isJakarta = true;
181+
} catch( any e ) {
182+
variables.isJakarta = false;
183+
}
184+
}
185+
186+
return variables.isJakarta;
169187
}
170188
}

box.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name":"CFConcurrent",
33
"type":"projects",
4-
"version":"VERSION_NUMBER",
5-
"location":"https://s3.eu-west-2.amazonaws.com/pixl8-public-packages/cfconcurrent/DOWNLOAD_LOCATION",
4+
"version":"$VERSION_NUMBER",
5+
"location":"$DOWNLOAD_URL",
66
"author":"Marc Esher",
77
"homepage":"https://github.com/pixl8/cfconcurrent",
88
"documentation":"https://github.com/pixl8/cfconcurrent/wiki",

build/java-src-jakarta/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
target
2+
artifacts

build/java-src-jakarta/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Lucee Runnable Helper - Jakarta build
2+
3+
A jakarta compatible build for Lucee 7 and Lucee 6 when using a Jakarta based servlet container.

build/java-src-jakarta/pom.xml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>org.pixl8</groupId>
4+
<artifactId>cfconcurrent</artifactId>
5+
<packaging>jar</packaging>
6+
<version>3.0.0-jakarta</version>
7+
<name>Lucee Runnable</name>
8+
<url>http://maven.apache.org</url>
9+
<dependencies>
10+
<dependency>
11+
<groupId>org.lucee</groupId>
12+
<artifactId>lucee</artifactId>
13+
<version>7.0.1.100</version>
14+
<scope>provided</scope>
15+
</dependency>
16+
<dependency>
17+
<groupId>jakarta.servlet.jsp</groupId>
18+
<artifactId>jakarta.servlet.jsp-api</artifactId>
19+
<version>4.0.0</version>
20+
<scope>provided</scope>
21+
</dependency>
22+
</dependencies>
23+
24+
<build>
25+
<plugins>
26+
<plugin>
27+
<groupId>org.apache.maven.plugins</groupId>
28+
<artifactId>maven-compiler-plugin</artifactId>
29+
<version>3.0</version>
30+
<configuration>
31+
<source>21</source>
32+
<target>21</target>
33+
<includes>
34+
<include>org/pixl8/cfconcurrent/*.java</include>
35+
</includes>
36+
</configuration>
37+
</plugin>
38+
<plugin>
39+
<artifactId>maven-assembly-plugin</artifactId>
40+
<executions>
41+
<execution>
42+
<phase>package</phase>
43+
<goals>
44+
<goal>single</goal>
45+
</goals>
46+
</execution>
47+
</executions>
48+
<configuration>
49+
<descriptorRefs>
50+
<descriptorRef>jar-with-dependencies</descriptorRef>
51+
</descriptorRefs>
52+
</configuration>
53+
</plugin>
54+
</plugins>
55+
</build>
56+
</project>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package org.pixl8.cfconcurrent;
2+
3+
import jakarta.servlet.ServletException;
4+
import lucee.runtime.exp.PageException;
5+
import lucee.runtime.Component;
6+
import lucee.runtime.listener.ApplicationContext;
7+
import java.util.concurrent.Callable;
8+
9+
public class LuceeCallable implements Callable {
10+
private LuceeCfcProxy proxy;
11+
12+
// CONSTRUCTOR
13+
public LuceeCallable( Component callableCfc, String contextRoot, ApplicationContext appContext, String host ) throws PageException, ServletException {
14+
this.proxy = new LuceeCfcProxy( callableCfc, contextRoot, appContext, host );
15+
}
16+
17+
// THE RUNNABLE BIT
18+
@Override
19+
public Object call() throws Exception {
20+
return proxy.callMethod( "call" );
21+
}
22+
23+
}

0 commit comments

Comments
 (0)