RetreiveImplementationsImpl.java
3.33 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
* 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.ReferenceCardinality
* org.apache.felix.scr.annotations.ReferencePolicy
* org.apache.felix.scr.annotations.References
* org.apache.felix.scr.annotations.Service
* org.slf4j.Logger
* org.slf4j.LoggerFactory
*/
package com.adobe.aemfd.watchfolder.serviceImpls;
import com.adobe.aemfd.watchfolder.service.api.ContentProcessor;
import com.adobe.aemfd.watchfolder.service.api.RetreiveImplementations;
import com.adobe.aemfd.watchfolder.workflow.api.payload.PayloadMapper;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.apache.felix.scr.annotations.ReferencePolicy;
import org.apache.felix.scr.annotations.References;
import org.apache.felix.scr.annotations.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/*
* This class specifies class file version 49.0 but uses Java 6 signatures. Assumed Java 6.
*/
@Service
@Component
@References(value={@Reference(name="ContentProcessor", cardinality=ReferenceCardinality.OPTIONAL_MULTIPLE, policy=ReferencePolicy.DYNAMIC, referenceInterface=ContentProcessor.class, bind="bindContentProcessor", unbind="unbindContentProcessor"), @Reference(name="PayloadMapper", cardinality=ReferenceCardinality.OPTIONAL_MULTIPLE, policy=ReferencePolicy.DYNAMIC, referenceInterface=PayloadMapper.class, bind="bindPayloadMapper", unbind="unbindPayloadMapper")})
public class RetreiveImplementationsImpl
implements RetreiveImplementations {
private static final Logger logger = LoggerFactory.getLogger(RetreiveImplementationsImpl.class);
protected List<ContentProcessor> contentProcessorList = new CopyOnWriteArrayList<ContentProcessor>();
protected List<PayloadMapper> payloadMapperList = new CopyOnWriteArrayList<PayloadMapper>();
public void bindContentProcessor(ContentProcessor contentProcessor) {
this.contentProcessorList.add(contentProcessor);
}
public void unbindContentProcessor(ContentProcessor contentProcessor) {
this.contentProcessorList.remove(contentProcessor);
}
public void bindPayloadMapper(PayloadMapper payloadMapper) {
this.payloadMapperList.add(payloadMapper);
}
public void unbindPayloadMapper(PayloadMapper payloadMapper) {
this.payloadMapperList.remove(payloadMapper);
}
@Override
public Map<String, Object> getContentProcessorImplsList() {
HashMap<String, Object> implMap = new HashMap<String, Object>();
for (ContentProcessor contentProcessor : this.contentProcessorList) {
implMap.put(contentProcessor.getClass().getName(), contentProcessor.getClass().getName());
}
return implMap;
}
@Override
public Map<String, Object> getPayloadMapperImplsList() {
HashMap<String, Object> implMap = new HashMap<String, Object>();
for (PayloadMapper payloadMapper : this.payloadMapperList) {
implMap.put(payloadMapper.getClass().getName(), payloadMapper.getClass().getName());
}
return implMap;
}
}