WorkflowConsoleUtil.java
1.93 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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.granite.workflow.WorkflowException
* com.adobe.granite.workflow.WorkflowSession
* com.adobe.granite.workflow.exec.Route
* com.adobe.granite.workflow.exec.WorkItem
* org.osgi.framework.BundleContext
* org.osgi.framework.InvalidSyntaxException
* org.osgi.framework.ServiceReference
* org.osgi.service.component.ComponentContext
*/
package com.adobe.granite.workflow.console.servlet;
import com.adobe.granite.workflow.WorkflowException;
import com.adobe.granite.workflow.WorkflowSession;
import com.adobe.granite.workflow.console.servlet.LoopbackRoute;
import com.adobe.granite.workflow.exec.Route;
import com.adobe.granite.workflow.exec.WorkItem;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import org.osgi.framework.BundleContext;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
import org.osgi.service.component.ComponentContext;
/*
* This class specifies class file version 49.0 but uses Java 6 signatures. Assumed Java 6.
*/
public class WorkflowConsoleUtil {
public static List<ServiceReference> getServiceReferences(ComponentContext context, List<String> clazzes) throws InvalidSyntaxException {
ArrayList<ServiceReference> serviceReferences = new ArrayList<ServiceReference>();
for (String clazz : clazzes) {
ServiceReference[] refs = context.getBundleContext().getAllServiceReferences(clazz, null);
if (refs == null) continue;
serviceReferences.addAll(Arrays.asList(refs));
}
return serviceReferences;
}
public static void retryStep(WorkflowSession wfSession, WorkItem item) throws WorkflowException {
if (item != null) {
LoopbackRoute loopRoute = new LoopbackRoute(item);
wfSession.complete(item, (Route)loopRoute);
}
}
}