1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.activeinstalls.internal.client; |
21 |
|
|
22 |
|
import java.util.ArrayList; |
23 |
|
import java.util.Arrays; |
24 |
|
import java.util.List; |
25 |
|
|
26 |
|
import javax.inject.Inject; |
27 |
|
import javax.inject.Named; |
28 |
|
import javax.inject.Provider; |
29 |
|
import javax.inject.Singleton; |
30 |
|
|
31 |
|
import org.xwiki.activeinstalls.ActiveInstallsConfiguration; |
32 |
|
import org.xwiki.bridge.event.ApplicationReadyEvent; |
33 |
|
import org.xwiki.component.annotation.Component; |
34 |
|
import org.xwiki.instance.InstanceIdManager; |
35 |
|
import org.xwiki.observation.EventListener; |
36 |
|
import org.xwiki.observation.event.Event; |
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
@version |
42 |
|
@since |
43 |
|
|
44 |
|
@Component |
45 |
|
@Singleton |
46 |
|
@Named("ActiveInstallsInitializerListener") |
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 3 |
Complexity Density: 0.6 |
|
47 |
|
public class ActiveInstallsInitializerListener implements EventListener |
48 |
|
{ |
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
private static final List<Event> EVENTS = new ArrayList<Event>(Arrays.asList(new ApplicationReadyEvent())); |
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
@link |
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
@Inject |
63 |
|
private Provider<PingSender> pingSenderProvider; |
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
@Inject |
69 |
|
private ActiveInstallsConfiguration configuration; |
70 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
71 |
1 |
@Override... |
72 |
|
public List<Event> getEvents() |
73 |
|
{ |
74 |
1 |
return EVENTS; |
75 |
|
} |
76 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
77 |
4 |
@Override... |
78 |
|
public String getName() |
79 |
|
{ |
80 |
4 |
return "ActiveInstallsInitializerListener"; |
81 |
|
} |
82 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
83 |
1 |
@Override... |
84 |
|
public void onEvent(Event event, Object source, Object data) |
85 |
|
{ |
86 |
|
|
87 |
1 |
Thread pingThread = new Thread(new ActiveInstallsPingThread(this.configuration, this.pingSenderProvider.get())); |
88 |
1 |
pingThread.setName("Active Installs Ping Thread"); |
89 |
1 |
pingThread.start(); |
90 |
|
} |
91 |
|
} |