use of com.ibm.j9ddr.vm29.view.dtfj.java.corrupt.AddCorruptionToListListener in project openj9 by eclipse.
the class DTFJJavaRuntime method scanReferences.
private void scanReferences() {
references = new LinkedList<Object>();
AddCorruptionToListListener corruptionListener = new AddCorruptionToListListener(references);
register(corruptionListener);
try {
RootScanner scanner = new DTFJRootScanner();
/* We don't report stack slots here */
scanner.setScanStackSlots(false);
scanner.scanAllSlots();
} catch (Throwable t) {
CorruptData cd = J9DDRDTFJUtils.handleAsCorruptData(DTFJContext.getProcess(), t);
references.add(cd);
}
unregister(corruptionListener);
}
use of com.ibm.j9ddr.vm29.view.dtfj.java.corrupt.AddCorruptionToListListener in project openj9 by eclipse.
the class DTFJJavaRuntime method getJavaClassLoaders.
@SuppressWarnings("rawtypes")
public Iterator getJavaClassLoaders() {
if (classLoaders != null) {
// return cached set of class loaders
return classLoaders.iterator();
}
classLoaders = new LinkedList<Object>();
GCClassLoaderIterator classLoaderIterator;
try {
classLoaderIterator = GCClassLoaderIterator.from();
} catch (Throwable t) {
CorruptData cd = J9DDRDTFJUtils.handleAsCorruptData(DTFJContext.getProcess(), t);
classLoaders.add(cd);
return classLoaders.iterator();
}
AddCorruptionToListListener corruptionListener = new AddCorruptionToListListener(classLoaders);
register(corruptionListener);
try {
while (!corruptionListener.fatalCorruption() && classLoaderIterator.hasNext()) {
J9ClassLoaderPointer next = classLoaderIterator.next();
if (next != null) {
classLoaders.add(new DTFJJavaClassloader(next));
}
}
} catch (Throwable t) {
CorruptData cd = J9DDRDTFJUtils.handleAsCorruptData(DTFJContext.getProcess(), t);
classLoaders.add(cd);
}
unregister(corruptionListener);
return classLoaders.iterator();
}
use of com.ibm.j9ddr.vm29.view.dtfj.java.corrupt.AddCorruptionToListListener in project openj9 by eclipse.
the class DTFJJavaRuntime method getThreads.
@SuppressWarnings("rawtypes")
public Iterator getThreads() {
GCVMThreadListIterator threadIterator;
try {
threadIterator = GCVMThreadListIterator.from();
} catch (Throwable t) {
CorruptData cd = J9DDRDTFJUtils.handleAsCorruptData(DTFJContext.getProcess(), t);
return corruptIterator(cd);
}
List<Object> toIterate = new LinkedList<Object>();
AddCorruptionToListListener listener = new AddCorruptionToListListener(toIterate);
register(listener);
try {
while (threadIterator.hasNext() && !listener.fatalCorruption()) {
J9VMThreadPointer next = threadIterator.next();
if (next != null) {
toIterate.add(new DTFJJavaThread(next));
}
}
} catch (Throwable t) {
CorruptData cd = J9DDRDTFJUtils.handleAsCorruptData(DTFJContext.getProcess(), t);
toIterate.add(cd);
}
unregister(listener);
return toIterate.iterator();
}
Aggregations