X Tutup
Skip to content

Commit b3574e5

Browse files
committed
iluwatar#143 Improve example code and add class diagram
1 parent acd7070 commit b3574e5

File tree

3 files changed

+305
-4
lines changed

3 files changed

+305
-4
lines changed
44.8 KB
Loading
Lines changed: 304 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,304 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<class-diagram version="1.1.8" icons="true" automaticImage="PNG" always-add-relationships="false" generalizations="true"
3+
realizations="true" associations="true" dependencies="false" nesting-relationships="true">
4+
<class id="1" language="java" name="org.apache.camel.builder.RouteBuilder" project="message-channel"
5+
file="C:/Users/ilkka/.m2/repository/org/apache/camel/camel-core/2.15.3/camel-core-2.15.3.jar" binary="true"
6+
corner="BOTTOM_RIGHT">
7+
<position height="59" width="150" x="1016" y="445"/>
8+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
9+
sort-features="false" accessors="true" visibility="true">
10+
<attributes public="false" package="false" protected="false" private="false" static="true"/>
11+
<operations public="false" package="false" protected="false" private="false" static="true"/>
12+
</display>
13+
</class>
14+
<interface id="2" language="java" name="org.apache.camel.CamelContext" project="message-channel"
15+
file="C:/Users/ilkka/.m2/repository/org/apache/camel/camel-core/2.15.3/camel-core-2.15.3.jar" binary="true"
16+
corner="BOTTOM_RIGHT">
17+
<position height="60" width="124" x="852" y="445"/>
18+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
19+
sort-features="false" accessors="true" visibility="true">
20+
<attributes public="false" package="false" protected="false" private="false" static="true"/>
21+
<operations public="false" package="false" protected="false" private="false" static="true"/>
22+
</display>
23+
</interface>
24+
<class id="3" language="java" name="org.apache.camel.model.RouteDefinition" project="message-channel"
25+
file="C:/Users/ilkka/.m2/repository/org/apache/camel/camel-core/2.15.3/camel-core-2.15.3.jar" binary="true"
26+
corner="BOTTOM_RIGHT">
27+
<position height="60" width="147" x="324" y="236"/>
28+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
29+
sort-features="false" accessors="true" visibility="true">
30+
<attributes public="false" package="false" protected="false" private="false" static="true"/>
31+
<operations public="false" package="false" protected="false" private="false" static="true"/>
32+
</display>
33+
</class>
34+
<class id="4" language="java" name="org.apache.camel.model.ProcessorDefinition" project="message-channel"
35+
file="C:/Users/ilkka/.m2/repository/org/apache/camel/camel-core/2.15.3/camel-core-2.15.3.jar" binary="true"
36+
corner="BOTTOM_RIGHT">
37+
<position height="59" width="215" x="246" y="336"/>
38+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
39+
sort-features="false" accessors="true" visibility="true">
40+
<attributes public="false" package="false" protected="false" private="false" static="true"/>
41+
<operations public="false" package="false" protected="false" private="false" static="true"/>
42+
</display>
43+
</class>
44+
<class id="5" language="java" name="org.apache.camel.model.OptionalIdentifiedDefinition" project="message-channel"
45+
file="C:/Users/ilkka/.m2/repository/org/apache/camel/camel-core/2.15.3/camel-core-2.15.3.jar" binary="true"
46+
corner="BOTTOM_RIGHT">
47+
<position height="59" width="243" x="41" y="236"/>
48+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
49+
sort-features="false" accessors="true" visibility="true">
50+
<attributes public="false" package="false" protected="false" private="false" static="true"/>
51+
<operations public="false" package="false" protected="false" private="false" static="true"/>
52+
</display>
53+
</class>
54+
<interface id="6" language="java" name="org.apache.camel.NamedNode" project="message-channel"
55+
file="C:/Users/ilkka/.m2/repository/org/apache/camel/camel-core/2.15.3/camel-core-2.15.3.jar" binary="true"
56+
corner="BOTTOM_RIGHT">
57+
<position height="60" width="120" x="41" y="336"/>
58+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
59+
sort-features="false" accessors="true" visibility="true">
60+
<attributes public="false" package="false" protected="false" private="false" static="true"/>
61+
<operations public="false" package="false" protected="false" private="false" static="true"/>
62+
</display>
63+
</interface>
64+
<interface id="7" language="java" name="org.apache.camel.model.Block" project="message-channel"
65+
file="C:/Users/ilkka/.m2/repository/org/apache/camel/camel-core/2.15.3/camel-core-2.15.3.jar" binary="true"
66+
corner="BOTTOM_RIGHT">
67+
<position height="60" width="147" x="246" y="445"/>
68+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
69+
sort-features="false" accessors="true" visibility="true">
70+
<attributes public="false" package="false" protected="false" private="false" static="true"/>
71+
<operations public="false" package="false" protected="false" private="false" static="true"/>
72+
</display>
73+
</interface>
74+
<interface id="8" language="java" name="org.apache.camel.RoutesBuilder" project="message-channel"
75+
file="C:/Users/ilkka/.m2/repository/org/apache/camel/camel-core/2.15.3/camel-core-2.15.3.jar" binary="true"
76+
corner="BOTTOM_RIGHT">
77+
<position height="60" width="127" x="1016" y="545"/>
78+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
79+
sort-features="false" accessors="true" visibility="true">
80+
<attributes public="false" package="false" protected="false" private="false" static="true"/>
81+
<operations public="false" package="false" protected="false" private="false" static="true"/>
82+
</display>
83+
</interface>
84+
<class id="9" language="java" name="org.apache.camel.builder.BuilderSupport" project="message-channel"
85+
file="C:/Users/ilkka/.m2/repository/org/apache/camel/camel-core/2.15.3/camel-core-2.15.3.jar" binary="true"
86+
corner="BOTTOM_RIGHT">
87+
<position height="59" width="150" x="1184" y="336"/>
88+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
89+
sort-features="false" accessors="true" visibility="true">
90+
<attributes public="false" package="false" protected="false" private="false" static="true"/>
91+
<operations public="false" package="false" protected="false" private="false" static="true"/>
92+
</display>
93+
</class>
94+
<interface id="10" language="java" name="org.apache.camel.SuspendableService" project="message-channel"
95+
file="C:/Users/ilkka/.m2/repository/org/apache/camel/camel-core/2.15.3/camel-core-2.15.3.jar" binary="true"
96+
corner="BOTTOM_RIGHT">
97+
<position height="60" width="172" x="752" y="336"/>
98+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
99+
sort-features="false" accessors="true" visibility="true">
100+
<attributes public="false" package="false" protected="false" private="false" static="true"/>
101+
<operations public="false" package="false" protected="false" private="false" static="true"/>
102+
</display>
103+
</interface>
104+
<interface id="11" language="java" name="org.apache.camel.Service" project="message-channel"
105+
file="C:/Users/ilkka/.m2/repository/org/apache/camel/camel-core/2.15.3/camel-core-2.15.3.jar" binary="true"
106+
corner="BOTTOM_RIGHT">
107+
<position height="60" width="120" x="611" y="236"/>
108+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
109+
sort-features="false" accessors="true" visibility="true">
110+
<attributes public="false" package="false" protected="false" private="false" static="true"/>
111+
<operations public="false" package="false" protected="false" private="false" static="true"/>
112+
</display>
113+
</interface>
114+
<interface id="12" language="java" name="org.apache.camel.RuntimeConfiguration" project="message-channel"
115+
file="C:/Users/ilkka/.m2/repository/org/apache/camel/camel-core/2.15.3/camel-core-2.15.3.jar" binary="true"
116+
corner="BOTTOM_RIGHT">
117+
<position height="60" width="180" x="964" y="336"/>
118+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
119+
sort-features="false" accessors="true" visibility="true">
120+
<attributes public="false" package="false" protected="false" private="false" static="true"/>
121+
<operations public="false" package="false" protected="false" private="false" static="true"/>
122+
</display>
123+
</interface>
124+
<class id="13" language="java" name="org.apache.camel.impl.DefaultCamelContext" project="message-channel"
125+
file="C:/Users/ilkka/.m2/repository/org/apache/camel/camel-core/2.15.3/camel-core-2.15.3.jar" binary="true"
126+
corner="BOTTOM_RIGHT">
127+
<position height="60" width="175" x="752" y="136"/>
128+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
129+
sort-features="false" accessors="true" visibility="true">
130+
<attributes public="false" package="false" protected="false" private="false" static="true"/>
131+
<operations public="false" package="false" protected="false" private="false" static="true"/>
132+
</display>
133+
</class>
134+
<class id="14" language="java" name="org.apache.camel.support.ServiceSupport" project="message-channel"
135+
file="C:/Users/ilkka/.m2/repository/org/apache/camel/camel-core/2.15.3/camel-core-2.15.3.jar" binary="true"
136+
corner="BOTTOM_RIGHT">
137+
<position height="59" width="154" x="492" y="37"/>
138+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
139+
sort-features="false" accessors="true" visibility="true">
140+
<attributes public="false" package="false" protected="false" private="false" static="true"/>
141+
<operations public="false" package="false" protected="false" private="false" static="true"/>
142+
</display>
143+
</class>
144+
<interface id="15" language="java" name="org.apache.camel.StatefulService" project="message-channel"
145+
file="C:/Users/ilkka/.m2/repository/org/apache/camel/camel-core/2.15.3/camel-core-2.15.3.jar" binary="true"
146+
corner="BOTTOM_RIGHT">
147+
<position height="60" width="134" x="532" y="445"/>
148+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
149+
sort-features="false" accessors="true" visibility="true">
150+
<attributes public="false" package="false" protected="false" private="false" static="true"/>
151+
<operations public="false" package="false" protected="false" private="false" static="true"/>
152+
</display>
153+
</interface>
154+
<interface id="16" language="java" name="org.apache.camel.ShutdownableService" project="message-channel"
155+
file="C:/Users/ilkka/.m2/repository/org/apache/camel/camel-core/2.15.3/camel-core-2.15.3.jar" binary="true"
156+
corner="BOTTOM_RIGHT">
157+
<position height="60" width="180" x="532" y="336"/>
158+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
159+
sort-features="false" accessors="true" visibility="true">
160+
<attributes public="false" package="false" protected="false" private="false" static="true"/>
161+
<operations public="false" package="false" protected="false" private="false" static="true"/>
162+
</display>
163+
</interface>
164+
<interface id="17" language="java" name="org.apache.camel.model.ModelCamelContext" project="message-channel"
165+
file="C:/Users/ilkka/.m2/repository/org/apache/camel/camel-core/2.15.3/camel-core-2.15.3.jar" binary="true"
166+
corner="BOTTOM_RIGHT">
167+
<position height="60" width="168" x="1187" y="545"/>
168+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
169+
sort-features="false" accessors="true" visibility="true">
170+
<attributes public="false" package="false" protected="false" private="false" static="true"/>
171+
<operations public="false" package="false" protected="false" private="false" static="true"/>
172+
</display>
173+
</interface>
174+
<association id="18">
175+
<bendpoint x="1196" y="445"/>
176+
<end type="SOURCE" refId="9" navigable="false">
177+
<attribute id="19" name="context"/>
178+
<multiplicity id="20" minimum="0" maximum="1"/>
179+
</end>
180+
<end type="TARGET" refId="17" navigable="true"/>
181+
<display labels="true" multiplicity="true"/>
182+
</association>
183+
<association id="21">
184+
<end type="SOURCE" refId="3" navigable="false">
185+
<attribute id="22" name="outputs"/>
186+
<multiplicity id="23" minimum="0" maximum="2147483647"/>
187+
</end>
188+
<end type="TARGET" refId="4" navigable="true"/>
189+
<display labels="true" multiplicity="true"/>
190+
</association>
191+
<association id="24">
192+
<end type="SOURCE" refId="13" navigable="false">
193+
<attribute id="25" name="servicesToClose"/>
194+
<multiplicity id="26" minimum="0" maximum="2147483647"/>
195+
</end>
196+
<end type="TARGET" refId="11" navigable="true"/>
197+
<display labels="true" multiplicity="true"/>
198+
</association>
199+
<generalization id="27">
200+
<end type="SOURCE" refId="3"/>
201+
<end type="TARGET" refId="4"/>
202+
</generalization>
203+
<generalization id="28">
204+
<end type="SOURCE" refId="15"/>
205+
<end type="TARGET" refId="10"/>
206+
</generalization>
207+
<generalization id="29">
208+
<end type="SOURCE" refId="16"/>
209+
<end type="TARGET" refId="11"/>
210+
</generalization>
211+
<generalization id="30">
212+
<end type="SOURCE" refId="2"/>
213+
<end type="TARGET" refId="12"/>
214+
</generalization>
215+
<generalization id="31">
216+
<end type="SOURCE" refId="13"/>
217+
<end type="TARGET" refId="14"/>
218+
</generalization>
219+
<generalization id="32">
220+
<end type="SOURCE" refId="17"/>
221+
<end type="TARGET" refId="2"/>
222+
</generalization>
223+
<generalization id="33">
224+
<end type="SOURCE" refId="1"/>
225+
<end type="TARGET" refId="9"/>
226+
</generalization>
227+
<association id="34">
228+
<end type="SOURCE" refId="4" navigable="false">
229+
<attribute id="35" name="blocks"/>
230+
<multiplicity id="36" minimum="0" maximum="2147483647"/>
231+
</end>
232+
<end type="TARGET" refId="7" navigable="true"/>
233+
<display labels="true" multiplicity="true"/>
234+
</association>
235+
<realization id="37">
236+
<bendpoint x="761" y="236"/>
237+
<end type="SOURCE" refId="13"/>
238+
<end type="TARGET" refId="10"/>
239+
</realization>
240+
<generalization id="38">
241+
<end type="SOURCE" refId="2"/>
242+
<end type="TARGET" refId="10"/>
243+
</generalization>
244+
<realization id="39">
245+
<bendpoint x="1364" y="236"/>
246+
<bendpoint x="1364" y="336"/>
247+
<bendpoint x="1364" y="445"/>
248+
<end type="SOURCE" refId="13"/>
249+
<end type="TARGET" refId="17"/>
250+
</realization>
251+
<generalization id="40">
252+
<end type="SOURCE" refId="4"/>
253+
<end type="TARGET" refId="5"/>
254+
</generalization>
255+
<realization id="41">
256+
<end type="SOURCE" refId="4"/>
257+
<end type="TARGET" refId="7"/>
258+
</realization>
259+
<generalization id="42">
260+
<end type="SOURCE" refId="15"/>
261+
<end type="TARGET" refId="16"/>
262+
</generalization>
263+
<association id="43">
264+
<end type="SOURCE" refId="13" navigable="false">
265+
<attribute id="44" name="routeDefinitions"/>
266+
<multiplicity id="45" minimum="0" maximum="2147483647"/>
267+
</end>
268+
<end type="TARGET" refId="3" navigable="true"/>
269+
<display labels="true" multiplicity="true"/>
270+
</association>
271+
<realization id="46">
272+
<end type="SOURCE" refId="1"/>
273+
<end type="TARGET" refId="8"/>
274+
</realization>
275+
<generalization id="47">
276+
<end type="SOURCE" refId="10"/>
277+
<end type="TARGET" refId="11"/>
278+
</generalization>
279+
<realization id="48">
280+
<bendpoint x="501" y="136"/>
281+
<bendpoint x="501" y="236"/>
282+
<bendpoint x="501" y="336"/>
283+
<end type="SOURCE" refId="14"/>
284+
<end type="TARGET" refId="15"/>
285+
</realization>
286+
<association id="49">
287+
<end type="SOURCE" refId="4" navigable="false">
288+
<attribute id="50" name="parent"/>
289+
<multiplicity id="51" minimum="0" maximum="1"/>
290+
</end>
291+
<end type="TARGET" refId="4" navigable="true"/>
292+
<display labels="true" multiplicity="true"/>
293+
</association>
294+
<realization id="52">
295+
<end type="SOURCE" refId="5"/>
296+
<end type="TARGET" refId="6"/>
297+
</realization>
298+
<classifier-display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
299+
sort-features="false" accessors="true" visibility="true">
300+
<attributes public="false" package="false" protected="false" private="false" static="true"/>
301+
<operations public="false" package="false" protected="false" private="false" static="true"/>
302+
</classifier-display>
303+
<association-display labels="true" multiplicity="true"/>
304+
</class-diagram>

message-channel/src/main/java/com/iluwatar/message/channel/App.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.iluwatar.message.channel;
22

33
import org.apache.camel.CamelContext;
4-
import org.apache.camel.ProducerTemplate;
54
import org.apache.camel.builder.RouteBuilder;
65
import org.apache.camel.impl.DefaultCamelContext;
76

@@ -19,9 +18,7 @@ public void configure() throws Exception {
1918
});
2019

2120
context.start();
22-
ProducerTemplate template = context.createProducerTemplate();
23-
template.sendBody("direct:greetings", "jou man");
24-
Thread.sleep(1000);
21+
context.getRoutes().stream().forEach((r) -> System.out.println(r));
2522
context.stop();
2623
}
2724
}

0 commit comments

Comments
 (0)
X Tutup