ActivationCallbackFactory.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
65
66
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* javax.jcr.Node
* javax.jcr.Session
* org.apache.felix.scr.annotations.Activate
* org.apache.felix.scr.annotations.Component
* org.apache.felix.scr.annotations.Deactivate
* org.apache.felix.scr.annotations.Reference
* org.apache.felix.scr.annotations.Service
*/
package com.adobe.aemfd.watchfolder.factory;
import com.adobe.aemfd.watchfolder.spi.ActivationCallback;
import com.adobe.aemfd.watchfolder.workflow.WorkflowLauncherHandler;
import java.util.ArrayList;
import java.util.List;
import javax.jcr.Node;
import javax.jcr.Session;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Deactivate;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
@Component(immediate=1)
@Service(value={ActivationCallbackFactory.class})
public class ActivationCallbackFactory {
@Reference
private WorkflowLauncherHandler workflowLauncherHandler;
private List<ActivationCallback> callbacks = new ArrayList<ActivationCallback>();
@Activate
public void activate() {
this.callbacks.add(this.workflowLauncherHandler);
}
@Deactivate
public void deactivate() {
this.callbacks.clear();
}
public void onLocalConfigNodeAdd(String watchFolderId, Node configNode) throws Exception {
for (ActivationCallback c : this.callbacks) {
c.onLocalConfigNodeAdd(watchFolderId, configNode);
}
}
public void onLocalConfigNodeDelete(Session session, String watchFolderId) throws Exception {
for (ActivationCallback c : this.callbacks) {
c.onLocalConfigNodeDelete(session, watchFolderId);
}
}
protected void bindWorkflowLauncherHandler(WorkflowLauncherHandler workflowLauncherHandler) {
this.workflowLauncherHandler = workflowLauncherHandler;
}
protected void unbindWorkflowLauncherHandler(WorkflowLauncherHandler workflowLauncherHandler) {
if (this.workflowLauncherHandler == workflowLauncherHandler) {
this.workflowLauncherHandler = null;
}
}
}