Skip to content

Commit

Permalink
#11 JavaEE 8 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
vbaidak committed Mar 12, 2020
1 parent 652556b commit 5982d25
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: java

jdk:
- openjdk8
- openjdk11

before_install:
- chmod +x gradlew
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 4.3-RELEASE

* [**#11** JavaEE 8 Update](https://github.com/Scalified/axonframework-cdi/issues/11)

# 4.2.1-RELEASE

# 4.2-RELEASE
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The Library requires Java EE container

```java
dependencies {
compile "com.scalified:axonframework-cdi:$VERSION"
implementation "com.scalified:axonframework-cdi:$VERSION"
}
```

Expand Down
4 changes: 2 additions & 2 deletions axonframework-cdi/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ dependencies {
compileOnly("org.projectlombok:lombok:${project.extra["lombokVersion"]}")
compileOnly("javax:javaee-api:${project.extra["javaeeVersion"]}")

compile("org.axonframework:axon-configuration:${project.extra["axonVersion"]}")
compile("org.apache.commons:commons-lang3:${project.extra["commonsLang3Version"]}")
api("org.axonframework:axon-configuration:${project.extra["axonVersion"]}")
api("org.apache.commons:commons-lang3:${project.extra["commonsLang3Version"]}")
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ public class AxonProperties {
* {@code true} by default
*/
@Builder.Default
private boolean autoStartEnabled = true;
boolean autoStartEnabled = true;

}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public class CdiExtension implements Extension {
/**
* {@link org.axonframework.modelling.command.Aggregate} types
*/
private List<Class<?>> aggregateTypes = new LinkedList<>();
private final List<Class<?>> aggregateTypes = new LinkedList<>();

/**
* Default {@link AggregateConfigurator} component
Expand All @@ -107,12 +107,12 @@ public class CdiExtension implements Extension {
/**
* {@link AggregateConfigurator} components
*/
private Map<Class<?>, Component> aggregateConfiguratorComponents = new HashMap<>();
private final Map<Class<?>, Component> aggregateConfiguratorComponents = new HashMap<>();

/**
* {@link org.axonframework.modelling.saga.Saga} types
*/
private List<Class<?>> sagaTypes = new LinkedList<>();
private final List<Class<?>> sagaTypes = new LinkedList<>();

/**
* Default {@link SagaConfigurator} component
Expand All @@ -122,7 +122,7 @@ public class CdiExtension implements Extension {
/**
* {@link SagaConfigurator} components
*/
private Map<Class<?>, Component> sagaConfiguratorComponents = new HashMap<>();
private final Map<Class<?>, Component> sagaConfiguratorComponents = new HashMap<>();

/**
* {@link EventProcessingConfigurator} component
Expand All @@ -132,22 +132,22 @@ public class CdiExtension implements Extension {
/**
* {@link Serializer} components
*/
private Map<String, Component> serializerComponents = new HashMap<>();
private final Map<String, Component> serializerComponents = new HashMap<>();

/**
* <b>CommandHandler</b> types
*/
private List<Type> commandHandlerTypes = new LinkedList<>();
private final List<Type> commandHandlerTypes = new LinkedList<>();

/**
* <b>EventHandler</b> types
*/
private List<Type> eventHandlerTypes = new LinkedList<>();
private final List<Type> eventHandlerTypes = new LinkedList<>();

/**
* <b>QueryHandler</b> types
*/
private List<Type> queryHandlerTypes = new LinkedList<>();
private final List<Type> queryHandlerTypes = new LinkedList<>();

/**
* {@link TransactionManager} component
Expand Down Expand Up @@ -197,37 +197,37 @@ public class CdiExtension implements Extension {
/**
* {@link CommandDispatchInterceptor} components
*/
private List<Component> commandDispatchInterceptorComponents = new LinkedList<>();
private final List<Component> commandDispatchInterceptorComponents = new LinkedList<>();

/**
* {@link EventDispatchInterceptor} components
*/
private List<Component> eventDispatchInterceptorComponents = new LinkedList<>();
private final List<Component> eventDispatchInterceptorComponents = new LinkedList<>();

/**
* {@link EventUpcaster} components
*/
private List<Component> eventUpcasterComponents = new LinkedList<>();
private final List<Component> eventUpcasterComponents = new LinkedList<>();

/**
* {@link CorrelationDataProvider} components
*/
private List<Component> correlationDataProviderComponents = new LinkedList<>();
private final List<Component> correlationDataProviderComponents = new LinkedList<>();

/**
* {@link ModuleConfiguration} components
*/
private List<Component> moduleConfigurationComponents = new LinkedList<>();
private final List<Component> moduleConfigurationComponents = new LinkedList<>();

/**
* {@link ConfigurerModule} components
*/
private List<Component> configurerModuleComponents = new LinkedList<>();
private final List<Component> configurerModuleComponents = new LinkedList<>();

/**
* <b>Custom</b> components
*/
private List<Component> customComponents = new LinkedList<>();
private final List<Component> customComponents = new LinkedList<>();

/**
* Processes the given {@link AxonProperties} annotated {@code type}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class Component {
* Component {@code type}
*/
@ToString.Include
private Type type;
private final Type type;

/**
* Component {@code producer}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,24 @@ public Aggregate<T> newInstance(Callable<T> factoryMethod) throws Exception {
return delegate().newInstance(factoryMethod);
}

/**
* Loads an aggregate from the repository. If the aggregate is not found it creates the aggregate using the
* specified
* {@code factoryMethod}.
*
* @param aggregateIdentifier The identifier of the aggregate to load
* @param factoryMethod The method to create the aggregate's root instance
* @return The aggregate root with the given identifier.
*/
@Override
public Aggregate<T> loadOrCreate(String aggregateIdentifier, Callable<T> factoryMethod) throws Exception {
try {
return load(aggregateIdentifier);
} catch (AggregateNotFoundException ignored) {
return newInstance(factoryMethod);
}
}

/**
* Send a {@link Message} to a {@link Scope} which is described by the given
* {@code scopeDescription}
Expand Down
12 changes: 4 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,13 @@

allprojects {

val lombokVersion by extra("1.18.6")
val javaeeVersion by extra("7.0")
val commonsLang3Version by extra("3.8.1")
val lombokVersion by extra("1.18.12")
val javaeeVersion by extra("8.0")
val commonsLang3Version by extra("3.9")
val axonVersion by extra("4.3")

group = "com.scalified"
version = "$axonVersion-RC1"

repositories {
mavenCentral()
}
version = "$axonVersion-RC4"

tasks.withType<JavaCompile> {
sourceCompatibility = "${JavaVersion.VERSION_1_8}"
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
29 changes: 12 additions & 17 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -154,19 +154,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

Expand All @@ -175,14 +175,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
APP_ARGS=`save "$@"`

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
6 changes: 0 additions & 6 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@
* limitations under the License.
*/

pluginManagement {
repositories {
gradlePluginPortal()
}
}

rootProject.name = "axonframework-cdi"

include("axonframework-cdi")

0 comments on commit 5982d25

Please sign in to comment.