Bootstrapper.java
1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* org.apache.felix.scr.annotations.Component
* org.apache.felix.scr.annotations.Reference
* org.apache.felix.scr.annotations.Service
* org.apache.sling.settings.SlingSettingsService
* org.osgi.service.component.ComponentContext
*/
package com.adobe.aem.formsndocuments.bootstrap;
import com.adobe.aem.formsndocuments.util.SettingsHolder;
import java.util.Set;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
import org.apache.sling.settings.SlingSettingsService;
import org.osgi.service.component.ComponentContext;
@Component(immediate=1)
@Service(value={Bootstrapper.class})
public class Bootstrapper {
@Reference(referenceInterface=SlingSettingsService.class)
private SlingSettingsService slingSettingsService;
protected void activate(ComponentContext componentContext) {
if (SettingsHolder.getInstance().getLcInstance() == null) {
SettingsHolder.getInstance().setLcInstance(this.slingSettingsService.getRunModes().contains("livecycle"));
}
if (SettingsHolder.getInstance().isAuthorInstance() == null) {
SettingsHolder.getInstance().setAuthorInstance(this.slingSettingsService.getRunModes().contains("author"));
}
}
protected void deactivate(ComponentContext componentContext) {
}
protected void bindSlingSettingsService(SlingSettingsService slingSettingsService) {
this.slingSettingsService = slingSettingsService;
}
protected void unbindSlingSettingsService(SlingSettingsService slingSettingsService) {
if (this.slingSettingsService == slingSettingsService) {
this.slingSettingsService = null;
}
}
}