Skip to content

Commit

Permalink
Merge pull request #3528 from jooby-project/camel4
Browse files Browse the repository at this point in the history
camel 4: upgrade camel 3 module to 4
  • Loading branch information
jknack committed Sep 15, 2024
2 parents 6ee3281 + ce40101 commit 454c132
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 28 deletions.
21 changes: 0 additions & 21 deletions modules/jooby-camel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>jooby-camel</artifactId>

<properties>
<Module-Name>io.jooby.camel</Module-Name>
</properties>

<dependencies>
<dependency>
<groupId>com.github.spotbugs</groupId>
Expand Down Expand Up @@ -58,21 +54,4 @@
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>${Module-Name}</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@

import org.apache.camel.CamelContext;
import org.apache.camel.CamelContextAware;
import org.apache.camel.ExtendedCamelContext;
import org.apache.camel.impl.engine.DefaultInjector;
import org.apache.camel.spi.CamelBeanPostProcessor;
import org.apache.camel.spi.Injector;
import org.apache.camel.support.PluginHelper;

import io.jooby.Registry;
import io.jooby.ServiceKey;
import io.jooby.SneakyThrows;
import io.jooby.exception.RegistryException;

public class JoobyInjector implements Injector {
private DefaultInjector defaultInjector;
private Registry registry;
private final DefaultInjector defaultInjector;
private final Registry registry;
private final CamelContext camel;
private final CamelBeanPostProcessor postProcessor;

public JoobyInjector(CamelContext camel, Registry registry) {
this.registry = registry;
this.camel = camel;
this.postProcessor = camel.adapt(ExtendedCamelContext.class).getBeanPostProcessor();
this.postProcessor = PluginHelper.getBeanPostProcessor(camel);
this.defaultInjector = new DefaultInjector(camel);
}

Expand All @@ -41,6 +41,11 @@ public <T> T newInstance(Class<T> type, String factoryMethod) {
return defaultInjector.newInstance(type, factoryMethod);
}

@Override
public <T> T newInstance(Class<T> type, Class<?> factoryClass, String factoryMethod) {
return defaultInjector.newInstance(type, factoryClass, factoryMethod);
}

@Override
public <T> T newInstance(Class<T> type, boolean postProcessBean) {
T instance = require(ServiceKey.key(type));
Expand Down
15 changes: 15 additions & 0 deletions modules/jooby-camel/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module io.jooby.camel {
exports io.jooby.camel;

requires io.jooby;
requires typesafe.config;
requires jakarta.inject;
requires static com.github.spotbugs.annotations;
requires camel.core.model;
requires camel.core.engine;
requires camel.base;
requires camel.base.engine;
requires camel.api;
requires camel.support;
requires camel.main;
}
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
<cron-utils.version>9.2.1</cron-utils.version>
<bucket4j-core.version>8.0.1</bucket4j-core.version>
<aws-java-sdk.version>1.12.771</aws-java-sdk.version>
<camel.version>3.22.2</camel.version>
<camel.version>4.7.0</camel.version>
<jasypt.version>1.9.3</jasypt.version>

<commons-io.version>2.16.1</commons-io.version>
Expand Down Expand Up @@ -390,7 +390,7 @@
<artifactId>jooby-jte</artifactId>
<version>${jooby.version}</version>
</dependency>

<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-pebble</artifactId>
Expand Down Expand Up @@ -677,7 +677,7 @@
<artifactId>jackson-datatype-hibernate5</artifactId>
<version>${jackson.version}</version>
</dependency>

<!-- avaje-inject -->
<dependency>
<groupId>io.avaje</groupId>
Expand Down

0 comments on commit 454c132

Please sign in to comment.