IBMAttachAPIResolver.java
1.42 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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* javax.annotation.Nullable
* org.osgi.framework.BundleContext
* org.osgi.framework.ServiceRegistration
* org.slf4j.Logger
* org.slf4j.LoggerFactory
*/
package com.adobe.cq.deserfw.impl.attach;
import com.adobe.cq.deserfw.api.AttachAPIResolver;
import java.util.Dictionary;
import java.util.Hashtable;
import javax.annotation.Nullable;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class IBMAttachAPIResolver
implements AttachAPIResolver {
private static final Logger log = LoggerFactory.getLogger(AttachAPIResolver.class);
@Nullable
@Override
public Class<?> getAttachAPIClass() {
try {
return ClassLoader.getSystemClassLoader().loadClass("com.ibm.tools.attach.VirtualMachine");
}
catch (ClassNotFoundException cnfe) {
log.info("IBM Attach API not found.");
return null;
}
}
public static ServiceRegistration registerService(BundleContext ctx) {
Hashtable<String, Object> props = new Hashtable<String, Object>();
props.put("service.ranking", 90);
props.put("service.description", "AttachAPIResolver for IBM JVMs");
return ctx.registerService(AttachAPIResolver.class.getName(), (Object)new IBMAttachAPIResolver(), props);
}
}