ScreensResourceProviderFactory.java
2.17 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.granite.rest.ApiResourceProvider
* com.adobe.granite.rest.ApiResourceProviderFactory
* org.apache.felix.scr.annotations.Component
* org.apache.felix.scr.annotations.Properties
* org.apache.felix.scr.annotations.Property
* org.apache.felix.scr.annotations.Reference
* org.apache.felix.scr.annotations.Service
*/
package com.adobe.cq.screens.impl.rest;
import com.adobe.cq.screens.device.impl.DeviceService;
import com.adobe.cq.screens.device.registration.RegistrationService;
import com.adobe.cq.screens.impl.rest.ScreensResourceProvider;
import com.adobe.granite.rest.ApiResourceProvider;
import com.adobe.granite.rest.ApiResourceProviderFactory;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Properties;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
@Component
@Service
@Properties(value={@Property(name="provider.type", value={"screens"})})
public class ScreensResourceProviderFactory
implements ApiResourceProviderFactory {
@Reference
private DeviceService deviceService;
@Reference
private RegistrationService registrationService;
public String getContextPath() {
return "screens";
}
public ApiResourceProvider getResourceProvider(String contextPath) {
return new ScreensResourceProvider(contextPath, this.deviceService, this.registrationService);
}
protected void bindDeviceService(DeviceService deviceService) {
this.deviceService = deviceService;
}
protected void unbindDeviceService(DeviceService deviceService) {
if (this.deviceService == deviceService) {
this.deviceService = null;
}
}
protected void bindRegistrationService(RegistrationService registrationService) {
this.registrationService = registrationService;
}
protected void unbindRegistrationService(RegistrationService registrationService) {
if (this.registrationService == registrationService) {
this.registrationService = null;
}
}
}