Skip to content

Commit

Permalink
Improve startup performance
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanpelikan committed Jan 29, 2024
1 parent 4b2ff66 commit ea7565b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion spring-boot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<dependency>
<groupId>io.vanillabp</groupId>
<artifactId>spring-boot-support</artifactId>
<version>1.0.7</version>
<version>1.0.8-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.camunda</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import io.vanillabp.camunda8.wiring.Camunda8TaskWiring;
import io.vanillabp.camunda8.wiring.Camunda8UserTaskHandler;
import io.vanillabp.springboot.adapter.AdapterConfigurationBase;
import io.vanillabp.springboot.adapter.SpringBeanUtil;
import io.vanillabp.springboot.adapter.SpringDataUtil;
import io.vanillabp.springboot.adapter.VanillaBpProperties;
import io.vanillabp.springboot.parameters.MethodParameter;
Expand All @@ -25,6 +26,7 @@
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.boot.autoconfigure.AutoConfigurationPackage;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Scope;
Expand Down Expand Up @@ -94,12 +96,14 @@ public Camunda8DeploymentAdapter camunda8Adapter(
@Bean
public Camunda8TaskWiring camunda8TaskWiring(
final SpringDataUtil springDataUtil,
final SpringBeanUtil springBeanUtil,
final Camunda8UserTaskHandler userTaskHandler,
final ObjectProvider<Camunda8TaskHandler> taskHandlers) {

return new Camunda8TaskWiring(
springDataUtil,
applicationContext,
springBeanUtil,
applicationName,
workerId,
userTaskHandler,
Expand Down Expand Up @@ -165,5 +169,14 @@ public <DE> Camunda8ProcessService<?> newProcessServiceImplementation(
return result;

}


@Bean
@ConditionalOnMissingBean
public SpringBeanUtil vanillabpSpringBeanUtil(
final ApplicationContext applicationContext) {

return new SpringBeanUtil(applicationContext);

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import io.vanillabp.camunda8.wiring.parameters.Camunda8MethodParameterFactory;
import io.vanillabp.camunda8.wiring.parameters.ParameterVariables;
import io.vanillabp.spi.service.WorkflowTask;
import io.vanillabp.springboot.adapter.SpringBeanUtil;
import io.vanillabp.springboot.adapter.SpringDataUtil;
import io.vanillabp.springboot.adapter.TaskWiringBase;
import io.vanillabp.springboot.parameters.MethodParameter;
Expand All @@ -23,6 +24,7 @@
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.context.ApplicationContext;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Collection;
Expand Down Expand Up @@ -57,13 +59,14 @@ public class Camunda8TaskWiring extends TaskWiringBase<Camunda8Connectable, Camu
public Camunda8TaskWiring(
final SpringDataUtil springDataUtil,
final ApplicationContext applicationContext,
final SpringBeanUtil springBeanUtil,
final String applicationName,
final String workerId,
final Camunda8UserTaskHandler userTaskHandler,
final ObjectProvider<Camunda8TaskHandler> taskHandlers,
final Collection<Camunda8ProcessService<?>> connectableServices) {

super(applicationContext, new Camunda8MethodParameterFactory());
super(applicationContext, springBeanUtil, new Camunda8MethodParameterFactory());
this.workerId = workerId;
this.applicationName = applicationName;
this.springDataUtil = springDataUtil;
Expand Down Expand Up @@ -287,7 +290,7 @@ private String getWorkflowAggregateIdPropertyName(
.stream(workflowAggregateClass.getDeclaredFields())
.filter(field -> field.getAnnotation(Id.class) != null)
.findFirst()
.map(field -> field.getName())
.map(Field::getName)
.orElse(Arrays
.stream(workflowAggregateClass.getDeclaredMethods())
.filter(method -> method.getAnnotation(Id.class) != null)
Expand Down

0 comments on commit ea7565b

Please sign in to comment.