Skip to content

Commit 6216a24

Browse files
committed
COLDBOX-1402 #resolve
delay method in coldbox scheduled task is not being
1 parent b7ca5b4 commit 6216a24

2 files changed

Lines changed: 148 additions & 8 deletions

File tree

java-usage-report.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# ColdBox System Folder — Java Class Usage Report
2+
3+
> Generated: 2025-06-18
4+
> Scope: `/system/` directory
5+
> Total `createObject("java", ...)` calls: **99**
6+
> Unique Java classes used: **37**
7+
8+
---
9+
10+
## 1. `java.lang` — Core Language
11+
12+
| Class | Files |
13+
|---|---|
14+
| `java.lang.System` | `AbstractAppender.cfc`, `AsyncManager.cfc`, `ConsoleAppender.cfc`, `Env.cfc`, `Executor.cfc`, `Mixer.cfc`, `CFMLEngine.cfc` |
15+
| `java.lang.StringBuilder` | `HTMLHelper.cfc`, `XMLConverter.cfc`, `InterceptorBuffer.cfc`, `ExceptionBean.cfc`, `Renderer.cfc`, `Mixer.cfc` |
16+
| `java.lang.String` | `RemotingUtil.cfc` |
17+
| `java.lang.Thread` | `Executor.cfc`, `Scheduler.cfc`, `ScheduledTask.cfc`, `Util.cfc` |
18+
| `java.lang.Runtime` | `CacheBoxProvider.cfc`, `ReportHandler.cfc` |
19+
| `java.lang.RuntimeException` | `Future.cfc` |
20+
21+
## 2. `java.util` — Collections & Utilities
22+
23+
| Class | Files |
24+
|---|---|
25+
| `java.util.concurrent.ConcurrentHashMap` | `Injector.cfc`, `Singleton.cfc`, `ConcurrentStore.cfc`, `ConcurrentSoftReferenceStore.cfc`, `ObjectPopulator.cfc`, `Mixer.cfc` |
26+
| `java.util.Collections` | `EventPool.cfc`, `ConcurrentStore.cfc` |
27+
| `java.util.LinkedHashMap` | `EventPool.cfc` |
28+
| `java.util.UUID` | `DBAppender.cfc`, `ScopeAppender.cfc`, `CacheBoxProvider.cfc`, `InterceptorState.cfc` |
29+
| `java.util.TreeMap` | `EventURLFacade.cfc` |
30+
| `java.util.concurrent.Executors` | `ExecutorBuilder.cfc` |
31+
| `java.util.concurrent.ForkJoinPool` | `ExecutorBuilder.cfc` |
32+
| `java.util.concurrent.LinkedBlockingQueue` | `Executor.cfc` |
33+
| `java.util.concurrent.TimeUnit` | `TimeUnit.cfc` |
34+
| `java.util.concurrent.CompletableFuture` | `Future.cfc` |
35+
| `java.util.concurrent.FutureTask` | `FutureTask.cfc` |
36+
| `java.util.stream.IntStream` | `AsyncManager.cfc` |
37+
38+
## 3. `java.time` — Date/Time API
39+
40+
| Class | Files |
41+
|---|---|
42+
| `java.time.ZoneOffset` | `DateTimeHelper.cfc` |
43+
| `java.time.ZoneId` | `DateTimeHelper.cfc`, `Scheduler.cfc`, `ScheduledTask.cfc` |
44+
| `java.time.temporal.ChronoField` | `DateTimeHelper.cfc` |
45+
| `java.time.temporal.ChronoUnit` | `DateTimeHelper.cfc` |
46+
| `java.time.temporal.TemporalAdjusters` | `DateTimeHelper.cfc` |
47+
| `java.time.DayOfWeek` | `DateTimeHelper.cfc` |
48+
| `java.time.LocalDateTime` | `DateTimeHelper.cfc` |
49+
| `java.time.Duration` | `Duration.cfc` |
50+
| `java.time.Period` | `Period.cfc` |
51+
52+
## 4. `java.net` — Networking
53+
54+
| Class | Files |
55+
|---|---|
56+
| `java.net.InetAddress` | `BugReport.cfm`, `Whoops.cfm`, `Util.cfc` |
57+
| `java.net.Socket` | `SocketAppender.cfc` |
58+
| `java.net.URI` | `RequestContext.cfc` |
59+
60+
## 5. `java.io` — I/O
61+
62+
| Class | Files |
63+
|---|---|
64+
| `java.io.ByteArrayOutputStream` | `ObjectMarshaller.cfc` |
65+
| `java.io.ObjectOutputStream` | `ObjectMarshaller.cfc` |
66+
| `java.io.ByteArrayInputStream` | `ObjectMarshaller.cfc` |
67+
| `java.io.ObjectInputStream` | `ObjectMarshaller.cfc` |
68+
| `java.io.PrintWriter` | `SocketAppender.cfc` |
69+
70+
## 6. `java.lang.ref` — Reference Types
71+
72+
| Class | Files |
73+
|---|---|
74+
| `java.lang.ref.ReferenceQueue` | `ConcurrentSoftReferenceStore.cfc` |
75+
| `java.lang.ref.SoftReference` | `ConcurrentSoftReferenceStore.cfc` |
76+
77+
## 7. `org.hibernate` — ORM
78+
79+
| Class | Files |
80+
|---|---|
81+
| `org.hibernate.Version` | `Util.cfc` |
82+
83+
---
84+
85+
## 8. Files by `createObject` Call Count
86+
87+
| File | Count |
88+
|---|---|
89+
| `HTMLHelper.cfc` | 18 |
90+
| `Builder.cfc` | 4 |
91+
| `Executor.cfc` | 4 |
92+
| `XMLConverter.cfc` | 5 |
93+
| `ObjectMarshaller.cfc` | 4 |
94+
| `DateTimeHelper.cfc` | 7 |
95+
| `Scheduler.cfc` | 3 |
96+
| `Future.cfc` | 2 |
97+
| `ConcurrentStore.cfc` | 2 |
98+
| `ConcurrentSoftReferenceStore.cfc` | 3 |
99+
| `Mixer.cfc` | 4 |
100+
| `Injector.cfc` | 2 |
101+
| `ExecutorBuilder.cfc` | 3 |
102+
| `SocketAppender.cfc` | 2 |
103+
| `ScheduledTask.cfc` | 2 |
104+
| `AsyncManager.cfc` | 2 |
105+
| `Util.cfc` | 3 |
106+
| `EventPool.cfc` | 2 |
107+
| `CacheBoxProvider.cfc` | 2 |
108+
| `ReportHandler.cfc` | 1 |
109+
| `ExceptionBean.cfc` | 2 |
110+
| `RequestContext.cfc` | 1 |
111+
| `ObjectPopulator.cfc` | 1 |
112+
| `EventURLFacade.cfc` | 1 |
113+
| `InterceptorState.cfc` | 1 |
114+
| `DBAppender.cfc` | 1 |
115+
| `ScopeAppender.cfc` | 1 |
116+
| `ConsoleAppender.cfc` | 2 |
117+
| `Singleton.cfc` | 1 |
118+
| `TimeUnit.cfc` | 1 |
119+
| `Duration.cfc` | 1 |
120+
| `Period.cfc` | 1 |
121+
| `FutureTask.cfc` | 1 |
122+
| `Env.cfc` | 1 |
123+
| `CFMLEngine.cfc` | 1 |
124+
| `RemotingUtil.cfc` | 1 |
125+
| `BugReport.cfm` | 1 |
126+
| `Whoops.cfm` | 1 |
127+
| `Renderer.cfc` | 1 |
128+
| `InterceptorBuffer.cfc` | 1 |
129+
130+
---
131+
132+
## Key Takeaways
133+
134+
1. **`java.lang.StringBuilder`** is the most-used class (20+ calls across 6 files) — used heavily for string concatenation in HTML helpers and converters.
135+
2. **`java.util.concurrent.ConcurrentHashMap`** is the most-used concurrent collection (6 files) — core to caching, DI scopes, and event pooling.
136+
3. **`java.lang.System`** is used for stdout/stderr access, property retrieval, and thread interruption (7 files).
137+
4. **`java.time.*`** classes (9 unique classes) are used extensively in the async/time subsystem for modern date/time handling.
138+
5. **`HTMLHelper.cfc`** is the single file with the most Java interop calls (18) — all `StringBuilder` for HTML generation.
139+
6. **Serialization** (`ObjectMarshaller.cfc`) uses 4 distinct `java.io` classes for binary serialization.
140+
7. **Caching stores** (`ConcurrentStore`, `ConcurrentSoftReferenceStore`) rely on `ConcurrentHashMap` and `SoftReference` for eviction policies.

system/web/tasks/ColdBoxScheduledTask.cfc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -365,26 +365,26 @@ component extends="coldbox.system.async.tasks.ScheduledTask" accessors="true" {
365365
*/
366366
private function adjustDelayToAlignWith( required targetTime ){
367367
try {
368-
var dateTimeHelper = new coldbox.system.async.time.DateTimeHelper();
369-
var now = dateTimeHelper.now( this.getTimezone().getId() );
370-
var chronoUnit = getChronoUnit( getTimeUnit() );
368+
var dateTimeHelper = new coldbox.system.async.time.DateTimeHelper()
369+
var now = dateTimeHelper.now( this.getTimezone().getId() )
370+
var chronoUnit = getChronoUnit( getTimeUnit() )
371371

372372
// Calculate the delay in our timeUnit
373-
var delayAmount = now.until( arguments.targetTime, chronoUnit );
373+
var delayAmount = now.until( arguments.targetTime, chronoUnit )
374374

375375
// If the target is in the past, set minimal delay
376376
if ( delayAmount <= 0 ) {
377-
delayAmount = 1;
377+
delayAmount = 1
378378
}
379379

380380
// Update the task's delay
381-
delay( delayAmount, getTimeUnit(), true );
381+
this.delay( delayAmount, getTimeUnit(), true )
382382

383383
variables.log.debug(
384384
"Task (#getName()#): Adjusted initial delay to #delayAmount# #getTimeUnit()# to align with cluster schedule"
385-
);
385+
)
386386
} catch ( any e ) {
387-
variables.log.error( "Error adjusting delay for task (#getName()#): #e.message#", e );
387+
variables.log.error( "Error adjusting delay for task (#getName()#): #e.message#", e )
388388
}
389389
}
390390

0 commit comments

Comments
 (0)