Skip to content

Commit 1a017dc

Browse files
committed
Remove dependency to Spring Shell
This commit updates the samples to use Java's standard CLI utilities instead of Spring Shell. Resolves #1184
1 parent 5170c0e commit 1a017dc

File tree

71 files changed

+724
-2015
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+724
-2015
lines changed

docs/src/reference/asciidoc/getting-started.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies outside of Spring Framework within its core system.
1717

1818
Other optional parts (such as <<sm-distributed>>) have dependencies on
1919
Zookeeper, while <<statemachine-examples>> has dependencies
20-
on `spring-shell` and `spring-boot`, which pull other dependencies
20+
on `spring-boot`, which pull other dependencies
2121
beyond the framework itself. Also, the optional security and data access features have
2222
dependencies to on Spring Security and Spring Data modules.
2323

docs/src/reference/asciidoc/sm-examples-cdplayer.adoc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -231,52 +231,52 @@ The following example shows how this state machine actually works.
231231
====
232232
[source,text]
233233
----
234-
sm>sm start
234+
sm>start
235235
Entry state IDLE
236236
Entry state CLOSED
237237
State machine started
238238
239-
sm>cd lcd
239+
sm>lcd
240240
No CD
241241
242-
sm>cd library
242+
sm>list
243243
0: Greatest Hits
244244
0: Bohemian Rhapsody 05:56
245245
1: Another One Bites the Dust 03:36
246246
1: Greatest Hits II
247247
0: A Kind of Magic 04:22
248248
1: Under Pressure 04:08
249249
250-
sm>cd eject
250+
sm>eject
251251
Exit state CLOSED
252252
Entry state OPEN
253253
254-
sm>cd load 0
254+
sm>load 0
255255
Loading cd Greatest Hits
256256
257-
sm>cd play
257+
sm>play
258258
Exit state OPEN
259259
Entry state CLOSED
260260
Exit state CLOSED
261261
Exit state IDLE
262262
Entry state BUSY
263263
Entry state PLAYING
264264
265-
sm>cd lcd
265+
sm>lcd
266266
Greatest Hits Bohemian Rhapsody 00:03
267267
268-
sm>cd forward
268+
sm>forward
269269
270-
sm>cd lcd
270+
sm>lcd
271271
Greatest Hits Another One Bites the Dust 00:04
272272
273-
sm>cd stop
273+
sm>stop
274274
Exit state PLAYING
275275
Exit state BUSY
276276
Entry state IDLE
277277
Entry state CLOSED
278278
279-
sm>cd lcd
279+
sm>lcd
280280
Greatest Hits
281281
----
282282
====

docs/src/reference/asciidoc/sm-examples-persist.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,27 +44,27 @@ The following example shows the state machine's output:
4444
====
4545
[source,text]
4646
----
47-
sm>persist db
47+
sm>list
4848
Order [id=1, state=PLACED]
4949
Order [id=2, state=PROCESSING]
5050
Order [id=3, state=SENT]
5151
Order [id=4, state=DELIVERED]
5252
53-
sm>persist process 1
53+
sm>process 1
5454
Exit state PLACED
5555
Entry state PROCESSING
5656
57-
sm>persist db
57+
sm>list
5858
Order [id=2, state=PROCESSING]
5959
Order [id=3, state=SENT]
6060
Order [id=4, state=DELIVERED]
6161
Order [id=1, state=PROCESSING]
6262
63-
sm>persist deliver 3
63+
sm>deliver 3
6464
Exit state SENT
6565
Entry state DELIVERED
6666
67-
sm>persist db
67+
sm>list
6868
Order [id=2, state=PROCESSING]
6969
Order [id=4, state=DELIVERED]
7070
Order [id=1, state=PROCESSING]

docs/src/reference/asciidoc/sm-examples-showcase.adoc

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,14 @@ various events are sent to it:
8383
====
8484
[source,text]
8585
----
86-
sm>sm start
86+
sm>start
8787
Init foo to 0
8888
Entry state S0
8989
Entry state S1
9090
Entry state S11
9191
State machine started
9292
93-
sm>sm event A
93+
sm>event A
9494
Event A send
9595
9696
sm>sm event C
@@ -101,20 +101,20 @@ Entry state S21
101101
Entry state S211
102102
Event C send
103103
104-
sm>sm event H
104+
sm>event H
105105
Switch foo to 1
106106
Internal transition source=S0
107107
Event H send
108108
109-
sm>sm event C
109+
sm>event C
110110
Exit state S211
111111
Exit state S21
112112
Exit state S2
113113
Entry state S1
114114
Entry state S11
115115
Event C send
116116
117-
sm>sm event A
117+
sm>event A
118118
Exit state S11
119119
Exit state S1
120120
Entry state S1
@@ -144,51 +144,51 @@ handling works:
144144
====
145145
[source,text]
146146
----
147-
sm>sm variables
147+
sm>variables
148148
No variables
149149
150-
sm>sm start
150+
sm>start
151151
Init foo to 0
152152
Entry state S0
153153
Entry state S1
154154
Entry state S11
155155
State machine started
156156
157-
sm>sm variables
157+
sm>variables
158158
foo=0
159159
160-
sm>sm event H
160+
sm>event H
161161
Internal transition source=S1
162162
Event H send
163163
164-
sm>sm variables
164+
sm>variables
165165
foo=0
166166
167-
sm>sm event C
167+
sm>event C
168168
Exit state S11
169169
Exit state S1
170170
Entry state S2
171171
Entry state S21
172172
Entry state S211
173173
Event C send
174174
175-
sm>sm variables
175+
sm>variables
176176
foo=0
177177
178-
sm>sm event H
178+
sm>event H
179179
Switch foo to 1
180180
Internal transition source=S0
181181
Event H send
182182
183-
sm>sm variables
183+
sm>variables
184184
foo=1
185185
186-
sm>sm event H
186+
sm>event H
187187
Switch foo to 0
188188
Internal transition source=S2
189189
Event H send
190190
191-
sm>sm variables
191+
sm>variables
192192
foo=0
193193
----
194194
====

docs/src/reference/asciidoc/sm-examples-tasks.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ The following example shows how this state machine actually works:
102102
====
103103
[source,text]
104104
----
105-
sm>sm start
105+
sm>start
106106
State machine started
107107
Entry state READY
108108
109-
sm>tasks run
109+
sm>run
110110
Exit state READY
111111
Entry state TASKS
112112
run task on T2

docs/src/reference/asciidoc/sm-examples-turnstile.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
Turnstile is a simple device that gives you access if payment is
55
made. It is a concept that is simple to model using a state machine. In its
6-
simplest, form there are only two states: `LOCKED` and `UNLOCKED`. Two
6+
simplest form, there are only two states: `LOCKED` and `UNLOCKED`. Two
77
events, `COIN` and `PUSH` can happen, depending on whether someone
88
makes a payment or tries to go through the turnstile.
99
The following image shows the state machine:
@@ -16,7 +16,7 @@ The following listing shows the enumeration that defines the possible states:
1616
.States
1717
[source,java,indent=0]
1818
----
19-
include::samples/demo/turnstile/Application.java[tags=snippetB]
19+
include::samples/demo/turnstile/States.java[tags=snippetB]
2020
----
2121
====
2222

@@ -26,7 +26,7 @@ The following listing shows the enumeration that defines the events:
2626
.Events
2727
[source,java,indent=0]
2828
----
29-
include::samples/demo/turnstile/Application.java[tags=snippetC]
29+
include::samples/demo/turnstile/Events.java[tags=snippetC]
3030
----
3131
====
3232

@@ -36,7 +36,7 @@ The following listing shows the code that configures the state machine:
3636
.Configuration
3737
[source,java,indent=0]
3838
----
39-
include::samples/demo/turnstile/Application.java[tags=snippetA]
39+
include::samples/demo/turnstile/StateMachineConfiguration.java[tags=snippetA]
4040
----
4141
====
4242

@@ -49,7 +49,7 @@ and shows the command's output:
4949
----
5050
$ java -jar spring-statemachine-samples-turnstile-{revnumber}.jar
5151
52-
sm>sm print
52+
sm>print
5353
+----------------------------------------------------------------+
5454
| SM |
5555
+----------------------------------------------------------------+
@@ -70,15 +70,15 @@ sm>sm print
7070
| |
7171
+----------------------------------------------------------------+
7272
73-
sm>sm start
73+
sm>start
7474
State changed to LOCKED
7575
State machine started
7676
77-
sm>sm event COIN
77+
sm>event COIN
7878
State changed to UNLOCKED
7979
Event COIN send
8080
81-
sm>sm event PUSH
81+
sm>event PUSH
8282
State changed to LOCKED
8383
Event PUSH send
8484
----

docs/src/reference/asciidoc/sm-examples-washer.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,28 +57,28 @@ The following example shows how this state machine actually works:
5757
====
5858
[source,text]
5959
----
60-
sm>sm start
60+
sm>start
6161
Entry state RUNNING
6262
Entry state WASHING
6363
State machine started
6464
65-
sm>sm event RINSE
65+
sm>event RINSE
6666
Exit state WASHING
6767
Entry state RINSING
6868
Event RINSE send
6969
70-
sm>sm event DRY
70+
sm>event DRY
7171
Exit state RINSING
7272
Entry state DRYING
7373
Event DRY send
7474
75-
sm>sm event CUTPOWER
75+
sm>event CUTPOWER
7676
Exit state DRYING
7777
Exit state RUNNING
7878
Entry state POWEROFF
7979
Event CUTPOWER send
8080
81-
sm>sm event RESTOREPOWER
81+
sm>event RESTOREPOWER
8282
Exit state POWEROFF
8383
Entry state RUNNING
8484
Entry state WASHING

docs/src/reference/asciidoc/sm-examples-zookeeper.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ The following example shows what happens:
4848
.Shell1
4949
[source,text]
5050
----
51-
sm>sm start
51+
sm>start
5252
Entry state LOCKED
5353
State machine started
5454
55-
sm>sm event COIN
55+
sm>event COIN
5656
Exit state LOCKED
5757
Entry state UNLOCKED
5858
Event COIN send
5959
60-
sm>sm state
60+
sm>state
6161
UNLOCKED
6262
----
6363
====
@@ -73,10 +73,10 @@ The following example shows the state machine and its output:
7373
.Shell2
7474
[source,text]
7575
----
76-
sm>sm start
76+
sm>start
7777
State machine started
7878
79-
sm>sm state
79+
sm>state
8080
UNLOCKED
8181
----
8282
====
@@ -89,7 +89,7 @@ The following example shows the state machine command and its output:
8989
.Shell2
9090
[source,text]
9191
----
92-
sm>sm event PUSH
92+
sm>event PUSH
9393
Exit state UNLOCKED
9494
Entry state LOCKED
9595
Event PUSH send

docs/src/reference/asciidoc/sm-examples.adoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ The following listing shows how to build the samples:
5858
====
5959

6060
Every sample is located in its own directory under
61-
`spring-statemachine-samples`. The samples are based on Spring Boot and
62-
Spring Shell, and you can find the usual Boot fat jars under every sample
61+
`spring-statemachine-samples`. The samples are based on Spring Boot and you can find the usual Boot fat jars under every sample
6362
project's `build/libs` directory.
6463

6564
NOTE: The filenames for the jars to which we refer in this section are populated during a

gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
version=4.0.1-SNAPSHOT
22
springBootVersion=3.5.0-SNAPSHOT
3-
springShellVersion=3.4.1-SNAPSHOT
43

54
jakartaPersistenceVersion=3.1.0
65
kryoVersion=4.0.3

0 commit comments

Comments
 (0)