Commit Graph

555 Commits

Author SHA1 Message Date
Janne Valkealahti
ade57d6638 Add start/stop feature to DefaultStateMachineService
- Add new interface methods to StateMachineService to ease
  starting and stopping when acquiring or releasing machines.
- Relates to #432
2018-01-23 09:56:27 +00:00
Janne Valkealahti
2a53b4eee5 Fix threading issues
- In AbstractStateMachine and DefaultStateMachineExecutor
  do a little more synchronisation so that submachine is allowed
  to do its run-to-completion before parent machine can do its
  own transitions. This should fix use cases, when submachine
  starts, does its transitions and actions, parent wont try to
  do its own triggerless transtions.
- Adding some new tests and fixing one other sync issue with end state.
- Relates to #442
2018-01-23 09:56:27 +00:00
Janne Valkealahti
6ba231af2e 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
2018-01-23 09:55:26 +00:00
Janne Valkealahti
66b93033f5 Fix datajpapersist sample
- Fix sample per changed release logic
  in DefaultStateMachineService.
- Relates to #432
2018-01-23 09:55:26 +00:00
Janne Valkealahti
51412b5d03 Change persistence model structure
- Fix wrong acquire logic in DefaultStatemachineService.
- Overhaul StateMachineRuntimePersister
- Change StateMachineRuntimePersister to extend
  StateMachinePersist which should work better on
  a bean level. Also add generic type T to it and
  config where needed.
- Relates to #432
- Relates to #427
2018-01-23 09:55:26 +00:00
Janne Valkealahti
3d538f7600 Add base DefaultStateMachineService implementation
- First take on new interface StateMachineService with
  its default impl.
- Modify datajpapersist sample to use it.
- Relates to #432
2018-01-23 09:55:26 +00:00
Janne Valkealahti
c0e5a9d305 Preliminary support for Spring Data persist
- Add new repository model for storing StateMachineContext
  via a new StateMachineRepository.
- New StateMachineRuntimePersister interface to abstract needed
  functionality to do a runtime machine persistence.
- As runtime persistence, as of now, is done via interceptors, define
  JpaRepositoryStateMachinePersist and JpaPersistingStateMachineInterceptor
  to define StateMachineRuntimePersister logic.
- Add new datajpapersist sample demonstrating new concepts.
- Keep tests related to jpa as there's not redis/mongo integration
  implemented in this first iteration.
- As this is going to be WIP until features around this issues
  are completed, docs, etc are not yet added. Also, interfaces and impls
  are subject to change during a process.
- Relates to #423
- Relates to #426
- Relates to #427
2018-01-23 09:55:26 +00:00
Janne Valkealahti
f0b27cde10 Upgrade to boot 2.0.0.M7
- Fix monitoring sample for changes.
- Fixes #450
2017-11-30 09:24:44 +00:00
Janne Valkealahti
4467e58fd9 Update readme 2017-11-26 16:44:56 +00:00
Janne Valkealahti
aa40694d2a Update changelog 2017-11-16 16:11:24 +00:00
Janne Valkealahti
c2db915306 Handle null BeanFactory in StateMachineHandlerCallHelper
- Makes things less chatty if BeanFactory is null in
  StateMachineHandlerCallHelper as this is usually a case
  with manual builders outside of app context.
- Backport #412
- Relates #307
2017-11-12 16:29:52 +00:00
Janne Valkealahti
10ed7feeae Fix state holder usage
- In AbstractStateMachineFactory change used holder map
  to list so that same states don't get lost because of
  used key.
- Backport #416
- Relates #307
2017-11-12 16:28:32 +00:00
Pinguet62
fb8d534e8e Fix logging message when transition action throws exception
- Backport #413
- Relates #307
2017-11-12 16:26:12 +00:00
Janne Valkealahti
5da12bec59 Use Boot 2.0.0.M6 2017-11-10 09:09:32 +00:00
Janne Valkealahti
9c5d1fed07 Polish build
- Remove cloud deps and define curator manually
- Resolve needed versions for docs from build
  instead of defining those manually.
- Fixes #421
2017-11-05 20:10:55 +00:00
Janne Valkealahti
17c9223103 Fix event processing threading
- Add one extra step to schedule event processing to
  recude risks that machine doesn't do full
  run-to-completion.
- Fixes #419
2017-11-05 17:09:44 +00:00
Janne Valkealahti
39f1e6e7ca Fix changes in micrometer
- Fixes #410
2017-11-04 11:26:45 +00:00
Janne Valkealahti
be57d1a42e Polish
- Remove unused imports.
- Fix some deprecations in boot 2.x
2017-10-29 16:36:53 +00:00
Janne Valkealahti
9a4f48708e Fix combatibility with boot 2.x
- Change test runtime deps for RedisRule not to fail.
- Fix metrics tests to align changes in boot's
  new micrometrics.
- Fixes #410
- Fixes #418
2017-10-29 15:55:24 +00:00
Hazim
43121435f9 Fix method description typo
Fixed typing mistake in the method description
2017-10-10 20:53:18 +05:00
Janne Valkealahti
29303eb5f4 Fixes to actuator metrics
- Quick fix to get something out from
  new boot 2.x metrics.
- Change source to java 8 compat
- Add new micrometer deps to build
- Docs and further changes will get done
  when new boot metric system completes.
- Fixes #410
2017-09-15 16:01:44 +01:00
Janne Valkealahti
5035a08e1b Fix actuator usage
- On monitoring sample, enable actuators
- Fix test for changed trace output.
- Fixes #408
2017-09-10 10:11:41 +01:00
Janne Valkealahti
a838f8a0c2 Upgrade build to gradle 4.1
- Fixes #407
2017-08-20 09:42:48 +01:00
Janne Valkealahti
6fc08b5f01 Clear machine id with null context restore
- As passing in null context don't have any
  meaning other than doing reset with pre-defined
  behaviour which currently just resets back to
  initial state and clears extended state variables.
  Now Also clearing machine id back to null which is
  anyway a default value.
- Backport #381
- Relates #307
2017-07-09 08:43:56 +01:00
Janne Valkealahti
0753f712f0 Change machine lifecycle with restore
- Fixing machine lifecycle logic when machine
  is restored which effectively should not touch
  any lifecycle methods as start/stop is
  user level action.
- Remove start/stop from restore and attempt to
  do same when root machine is started. This also
  needed some further changes as some functionality
  for restore was essentially broken
- Backport #386
- Relates #307
2017-07-09 08:43:10 +01:00
Janne Valkealahti
6b636bef2d Add recursive context build
- Fix AbstractStateMachinePersister to handle
  recursive machines and regions.
- Backport #391
- Relates #307
2017-07-09 08:42:44 +01:00
Janne Valkealahti
f268999400 Fix OnExtendedStateChanged with key
- Fix case where method was annotated with
  @OnExtendedStateChanged(key = "V1"), V1 was
  changed which didn't result call to that method.
- Backport #387
- Relates #307
2017-07-09 08:42:11 +01:00
Janne Valkealahti
1e60b7abfa Add support for multiple end states with javaconfig
- Add missing support for defining more than one
  end states and as it's just missing from javaconfig.
- Backport #368
- Relates #307
2017-07-09 08:41:30 +01:00
Janne Valkealahti
526c05e0f9 @WithStateMachine may register too many processors
- Change processor registration so that if @WithStateMachine is
  used with 'id', 'name' is skipped because it defaults to 'stateMachine'
  and would cause extra registration.
- Relates #307
- Backport #370
2017-07-09 08:40:08 +01:00
Janne Valkealahti
f4979411f2 Fix build for spring-context
- Now using spring-context dependency manually
  as framework changed it to optional.
- Fixes #396
2017-07-09 08:34:16 +01:00
Janne Valkealahti
673894b0d6 Update build status images 2017-06-29 14:38:35 +01:00
Janne Valkealahti
258716099d Fix session deps
- Change from spring-session to spring-session-core
  and remove use of ExpiringSession.
- Fixes #385
2017-06-29 14:28:20 +01:00
Fabien Chebel
2fb817f803 Fix PreStateChange interceptors being called twice for END states (#367) 2017-05-29 14:06:44 +02:00
Janne Valkealahti
8d7fe80bdb NPE on sendEvent
- Adding null check for current state
- Remove synchronization from scheduleEventQueueProcessing
  method in executor. Looks like this sync is not really needed
  and indeed may cause jvm level deadlocks if threads are used
  for execution.
- Change how some internals in
  AbstractStateMachine are synchronized
  to limit changes for deadlock.
- Relates to #307
- Backport of #359 #360
2017-05-19 07:52:31 +01:00
Janne Valkealahti
b1d708e241 Fix EventDeferTests
- Change testDeferWithSubsThreadExecutor to use
  more threads if that is a culprint for this
  failure.
- Relates to #343
2017-05-07 09:05:29 +01:00
Janne Valkealahti
3884d48fef Support actions with transition via choice/junction pseudostate
- Adding support for javaconfig/uml to define
  actions for transitions leading out from a
  choice or junction states.
- Support for action for incoming transition is
  already implemented as it is defined as normal
  transition.
- Backport #108
- Relates #307
2017-05-05 14:57:15 +01:00
Janne Valkealahti
d16e29ea45 Fix post interceptor call
- Now calling post state interceptor with
  correct/same state as pre.
- Backport #353
- Relates #307
2017-05-05 14:56:44 +01:00
Janne Valkealahti
d3b6491bbc Fix action error in anonymous transition
- Executor is following anonymous transitions in a loop
  and if there is an exception in actions with this transition,
  effectively executor ended into infinite loop.
- No bailing out from this loop if we cannot continue.
- Backport #344
- Relates #307
2017-05-05 14:55:56 +01:00
Janne Valkealahti
331dc05957 Prevent debug calls
- Polish to do checks for debug/trace logs
- Backport #329
- Relates #307
2017-05-05 14:55:00 +01:00
Janne Valkealahti
c4af0e700b StateMachineContextSerializer handles history and id
- Add missing serialisation for history map and machine id
- Fix possible NPE with extended state
- Backport #331
- Backport #333
- Relates #307
2017-05-05 14:53:51 +01:00
Janne Valkealahti
b2624ada4d Adapt to thymeleaf starter changes
- Add spring-boot-starter-web to samples using
  spring-boot-starter-thymeleaf.
- Fixes #356
2017-05-05 09:21:23 +01:00
Janne Valkealahti
15c537a1c9 Fix monitoring sample tests
- Caused by change of default boot actuator path.
- Fixes #350
2017-04-19 19:18:40 +01:00
Janne Valkealahti
168f6476f9 Adapt to logging changes
- Moving over to log4j2 for test logging.
- Need to follow what happens to commons-logging
  per SPR-14512.
- Relates to #394
2017-04-19 15:12:22 +01:00
Janne Valkealahti
78527fdaec Add logging to failing test
- Relates to #342
2017-04-19 11:11:43 +01:00
Janne Valkealahti
ea9dee4aad Fix mockito deprecation warnings
- Relates to #342
2017-04-11 20:36:55 +01:00
Janne Valkealahti
def0fce98c Use spring-integration-zookeeper
- In favour of deprecater spring-cloud-cluster
- Fixe some zookeeper deprecation issues
- Fixes #345
2017-04-11 20:20:53 +01:00
Janne Valkealahti
7cd5f3c069 Fix Assert deprecation warnings
- Fixes #346
2017-04-11 19:59:44 +01:00
Janne Valkealahti
69c0146d80 Fix eclipse classpath
- Relates to #342
2017-04-11 19:23:07 +01:00
Janne Valkealahti
d92b4e54d0 Fix CdPlayerTests
- Attempt to make these tests more reliable
- testPlayWithCdLoadedDeckOpen using wring latch count
  which may cause test failures.
- Relates to #343
2017-04-10 15:20:49 +01:00
Janne Valkealahti
cf7b9d7e24 Fix StateMachineMonitorTests
- Attempt to make these tests more reliable
- Relates to #343
2017-04-10 14:58:48 +01:00