use of org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement in project felix by apache.
the class ThreadDump method call.
@IgnoreJRERequirement
public String call() throws Exception {
ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
StringBuffer b = new StringBuffer("Thread dump\n");
ThreadInfo[] infos = threadMXBean.dumpAllThreads(threadMXBean.isObjectMonitorUsageSupported(), threadMXBean.isSynchronizerUsageSupported());
for (int i = 0; i < infos.length; i++) {
ThreadInfo ti = infos[i];
b.append("\n\nThreadId: ").append(ti.getThreadId()).append(" : name: ").append(ti.getThreadName()).append(" State: ").append(ti.getThreadState());
b.append("\n LockInfo: ").append(ti.getLockInfo()).append(" LockOwnerId: ").append(ti.getLockOwnerId()).append(" LockOwnerName: ").append(ti.getLockOwnerName());
StackTraceElement[] stackTrace = ti.getStackTrace();
for (int j = 0; j < stackTrace.length; j++) {
b.append("\n ").append(stackTrace[j]);
}
}
return b.toString();
}
use of org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement in project support-core-plugin by jenkinsci.
the class FileDescriptorLimit method getOpenFileDescriptorCount.
/**
* * Using OperatingSystemMXBean, we can obtain the total number of open file descriptors.
*/
// UnixOperatingSystemMXBean
@IgnoreJRERequirement
private static void getOpenFileDescriptorCount(PrintWriter writer) {
try {
OperatingSystemMXBean operatingSystemMXBean = ManagementFactory.getOperatingSystemMXBean();
if (operatingSystemMXBean instanceof UnixOperatingSystemMXBean) {
UnixOperatingSystemMXBean unixOperatingSystemMXBean = (UnixOperatingSystemMXBean) operatingSystemMXBean;
writer.println("Open File Descriptor Count: " + unixOperatingSystemMXBean.getOpenFileDescriptorCount());
} else {
writer.println("Wrong bean: " + operatingSystemMXBean);
}
} catch (LinkageError e) {
writer.println("Unable to get the total number of open file descriptors using OperatingSystemMXBean");
}
}
use of org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement in project grpc-java by grpc.
the class JndiResourceResolverTest method jndiResolverWorks.
@IgnoreJRERequirement
@Test
public void jndiResolverWorks() throws Exception {
Assume.assumeNoException(new JndiResourceResolverFactory().unavailabilityCause());
RecordFetcher recordFetcher = new JndiRecordFetcher();
try {
recordFetcher.getAllRecords("SRV", "dns:///localhost");
} catch (javax.naming.CommunicationException e) {
Assume.assumeNoException(e);
} catch (javax.naming.NameNotFoundException e) {
Assume.assumeNoException(e);
}
}
Aggregations