AssetResourceProviderFactory.java
1.71 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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.granite.comments.CommentManager
* 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.granite.rest.assets.impl;
import com.adobe.granite.comments.CommentManager;
import com.adobe.granite.rest.ApiResourceProvider;
import com.adobe.granite.rest.ApiResourceProviderFactory;
import com.adobe.granite.rest.assets.impl.AssetResourceProvider;
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={"assets"})})
public class AssetResourceProviderFactory
implements ApiResourceProviderFactory {
@Reference
private CommentManager commentManager;
public String getContextPath() {
return "assets";
}
public ApiResourceProvider getResourceProvider(String contextPath) {
return new AssetResourceProvider(contextPath, this.commentManager);
}
protected void bindCommentManager(CommentManager commentManager) {
this.commentManager = commentManager;
}
protected void unbindCommentManager(CommentManager commentManager) {
if (this.commentManager == commentManager) {
this.commentManager = null;
}
}
}