|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| package org.apache.examples; |
|
16 |
| |
|
17 |
| import org.apache.hivemind.ApplicationRuntimeException; |
|
18 |
| import org.apache.hivemind.Registry; |
|
19 |
| |
|
20 |
| public class LoggingMain |
|
21 |
| { |
|
22 |
| |
|
23 |
0
| public static void main(String[] args)
|
|
24 |
| { |
|
25 |
0
| Registry registry = ExampleUtils.buildRegistry("examples.xml");
|
|
26 |
| |
|
27 |
0
| TargetService service = (TargetService) registry.getService(TargetService.class);
|
|
28 |
| |
|
29 |
0
| System.out.println("\n*** Void method (no return value):\n");
|
|
30 |
| |
|
31 |
0
| service.voidMethod("Hello");
|
|
32 |
| |
|
33 |
0
| System.out.println("\n*** Ordinary method (returns a List):\n");
|
|
34 |
| |
|
35 |
0
| service.buildList("HiveMind", 4);
|
|
36 |
| |
|
37 |
0
| System.out.println("\n*** Exception method (throws an exception):\n");
|
|
38 |
| |
|
39 |
0
| try
|
|
40 |
| { |
|
41 |
0
| service.exceptionThrower();
|
|
42 |
| } |
|
43 |
| catch (ApplicationRuntimeException ex) |
|
44 |
| { |
|
45 |
| |
|
46 |
| } |
|
47 |
| } |
|
48 |
| } |