Make use of kryo more configurable

- Move away from thread local in favour of using
  kryo pooling.
- New interface StateMachineSerialisationService
  with KryoStateMachineSerialisationService.
- Try to work via constructors for instead of full blown
  configuration as it looks like this may give enough
  for users to customise.
- Relates to #437
This commit is contained in:
Janne Valkealahti
2017-11-23 13:11:39 +00:00
parent 66b93033f5
commit 6ba231af2e
6 changed files with 288 additions and 91 deletions

View File

@@ -18,6 +18,7 @@ package org.springframework.statemachine.data.jpa;
import org.springframework.statemachine.StateMachineContext;
import org.springframework.statemachine.data.RepositoryStateMachinePersist;
import org.springframework.statemachine.data.StateMachineRepository;
import org.springframework.statemachine.service.StateMachineSerialisationService;
/**
* {@code JPA} based implementation of a {@link RepositoryStateMachinePersist}.
@@ -41,6 +42,18 @@ public class JpaRepositoryStateMachinePersist<S, E> extends RepositoryStateMachi
this.jpaStateMachineRepository = jpaStateMachineRepository;
}
/**
* Instantiates a new jpa repository state machine persist.
*
* @param jpaStateMachineRepository the jpa state machine repository
* @param serialisationService the serialisation service
*/
public JpaRepositoryStateMachinePersist(JpaStateMachineRepository jpaStateMachineRepository,
StateMachineSerialisationService<S, E> serialisationService) {
super(serialisationService);
this.jpaStateMachineRepository = jpaStateMachineRepository;
}
@Override
protected StateMachineRepository<JpaRepositoryStateMachine> getRepository() {
return jpaStateMachineRepository;