-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #241 from valtech/feature/240-java21-support
Feature/240 java21 support
- Loading branch information
Showing
7 changed files
with
80 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
cloud.startup.hook/src/main/java/de/valtech/aecu/startuphook/AecuStartupJobConsumer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package de.valtech.aecu.startuphook; | ||
|
||
import org.osgi.service.component.annotations.Component; | ||
import org.osgi.service.component.annotations.Reference; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import de.valtech.aecu.api.service.AecuException; | ||
import de.valtech.aecu.api.service.AecuService; | ||
import de.valtech.aecu.api.service.HistoryEntry; | ||
|
||
import org.apache.sling.event.jobs.Job; | ||
import org.apache.sling.event.jobs.consumer.JobConsumer; | ||
|
||
|
||
@Component(service=JobConsumer.class, property= { | ||
JobConsumer.PROPERTY_TOPICS + "=" + AecuStartupJobConsumer.JOB_TOPIC | ||
}) | ||
public class AecuStartupJobConsumer implements JobConsumer { | ||
|
||
protected static final String JOB_TOPIC = "de/valtech/aecu/cloud/AecuStartupJobTopic"; | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(AecuStartupJobConsumer.class); | ||
|
||
@Reference | ||
private AecuService aecuService; | ||
|
||
|
||
public JobResult process(final Job job) { | ||
try { | ||
LOGGER.info("AECU migration started"); | ||
HistoryEntry result = aecuService.executeWithInstallHookHistory(AecuService.AECU_APPS_PATH_PREFIX); | ||
LOGGER.info("AECU migration finished with result "+result.getResult()); | ||
return JobResult.OK; | ||
} catch (AecuException ae) { | ||
LOGGER.error("Error while executing AECU migration", ae); | ||
// Do not retry job, hence status CANCEL (=failed permanently) and not FAILED (=can be retried) | ||
return JobResult.CANCEL; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
.../config/org.apache.sling.event.jobs.QueueConfiguration~aecu-startup-hook-job-consumer.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" | ||
jcr:primaryType="sling:OsgiConfig" | ||
|
||
queue.name="AECU Cloud Startup Job Queue" | ||
queue.priority="NORM" | ||
queue.topics="de/valtech/aecu/cloud/AecuStartupJobTopic" | ||
queue.type="ORDERED" | ||
queue.keepJobs="true" | ||
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters