本文整理汇总了Java中com.sun.jdi.ThreadGroupReference类的典型用法代码示例。如果您正苦于以下问题:Java ThreadGroupReference类的具体用法?Java ThreadGroupReference怎么用?Java ThreadGroupReference使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ThreadGroupReference类属于com.sun.jdi包,在下文中一共展示了ThreadGroupReference类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getThreadsCache
import com.sun.jdi.ThreadGroupReference; //导入依赖的package包/类
public ThreadsCache getThreadsCache() {
synchronized (threadsCollectorLock) {
if (threadsCache == null) {
threadsCache = new ThreadsCache(this);
threadsCache.addPropertyChangeListener(new PropertyChangeListener() {
// Re-fire the changes
@Override
public void propertyChange(PropertyChangeEvent evt) {
String propertyName = evt.getPropertyName();
if (ThreadsCache.PROP_THREAD_STARTED.equals(propertyName)) {
firePropertyChange(PROP_THREAD_STARTED, null, getThread((ThreadReference) evt.getNewValue()));
}
if (ThreadsCache.PROP_THREAD_DIED.equals(propertyName)) {
firePropertyChange(PROP_THREAD_DIED, getThread((ThreadReference) evt.getOldValue()), null);
}
if (ThreadsCache.PROP_GROUP_ADDED.equals(propertyName)) {
firePropertyChange(PROP_THREAD_GROUP_ADDED, null, getThreadGroup((ThreadGroupReference) evt.getNewValue()));
}
}
});
}
return threadsCache;
}
}
示例2: createTranslation
import com.sun.jdi.ThreadGroupReference; //导入依赖的package包/类
/**
* Creates a new translated node for given original one.
*
* @param o a node to be translated
* @return a new translated node
*/
private Object createTranslation (Object o) {
switch (translationID) {
case THREAD_ID:
if (o instanceof ThreadReference) {
return new JPDAThreadImpl ((ThreadReference) o, debugger);
} else if (o instanceof ThreadGroupReference) {
return new JPDAThreadGroupImpl ((ThreadGroupReference) o, debugger);
} else {
return null;
}
case LOCALS_ID:
if (o instanceof ArrayType) {
return new JPDAArrayTypeImpl(debugger, (ArrayType) o);
}
if (o instanceof ReferenceType) {
return new JPDAClassTypeImpl(debugger, (ReferenceType) o);
}
default:
throw new IllegalStateException(""+o);
}
}
示例3: initGroups
import com.sun.jdi.ThreadGroupReference; //导入依赖的package包/类
private void initGroups(ThreadGroupReference group) {
try {
List<ThreadGroupReference> groups = new ArrayList(ThreadGroupReferenceWrapper.threadGroups0(group));
List<ThreadReference> threads = new ArrayList(ThreadGroupReferenceWrapper.threads0(group));
filterThreads(threads);
groupMap.put(group, groups);
threadMap.put(group, threads);
for (ThreadGroupReference g : groups) {
initGroups(g);
}
} catch (ObjectCollectedException e) {
}
}
示例4: topLevelThreadGroups
import com.sun.jdi.ThreadGroupReference; //导入依赖的package包/类
List<ThreadGroupReference> topLevelThreadGroups() {
List<ThreadGroupReference> groups = null;
try {
Cache local = getCache();
if (local != null) {
groups = local.groups;
}
if (groups == null) {
groups = Arrays.asList(
(ThreadGroupReference[])JDWP.VirtualMachine.TopLevelThreadGroups.
process(vm).groups);
if (local != null) {
local.groups = groups;
if ((vm.traceFlags & VirtualMachine.TRACE_OBJREFS) != 0) {
vm.printTrace(
"Caching top level thread groups (count = " +
groups.size() + ") while VM suspended");
}
}
}
} catch (JDWPException exc) {
throw exc.toJDIException();
}
return groups;
}
示例5: wrap
import com.sun.jdi.ThreadGroupReference; //导入依赖的package包/类
public static F3ObjectReference wrap(F3VirtualMachine f3vm, ObjectReference ref) {
if (ref == null) {
return null;
} else if (ref instanceof ArrayReference) {
return f3vm.arrayReference((ArrayReference)ref);
} else if (ref instanceof StringReference) {
return f3vm.stringReference((StringReference)ref);
} else if (ref instanceof ThreadReference) {
return f3vm.threadReference((ThreadReference)ref);
} else if (ref instanceof ThreadGroupReference) {
return f3vm.threadGroupReference((ThreadGroupReference)ref);
} else if (ref instanceof ClassLoaderReference) {
return f3vm.classLoaderReference((ClassLoaderReference)ref);
} else if (ref instanceof ClassObjectReference) {
return f3vm.classObjectReference((ClassObjectReference)ref);
} else {
return f3vm.objectReference(ref);
}
}
示例6: getTopLevelThreadGroups
import com.sun.jdi.ThreadGroupReference; //导入依赖的package包/类
public JPDAThreadGroup[] getTopLevelThreadGroups() {
ThreadsCache tc = getThreadsCache();
if (tc == null) {
return new JPDAThreadGroup[0];
}
List<ThreadGroupReference> groupList = tc.getTopLevelThreadGroups();
JPDAThreadGroup[] groups = new JPDAThreadGroup[groupList.size()];
for (int i = 0; i < groups.length; i++) {
groups[i] = getThreadGroup((ThreadGroupReference) groupList.get(i));
}
return groups;
}
示例7: getThreadGroups
import com.sun.jdi.ThreadGroupReference; //导入依赖的package包/类
public JPDAThreadGroupImpl[] getThreadGroups () {
ThreadsCache tc = debugger.getThreadsCache();
if (tc == null) {
return new JPDAThreadGroupImpl[0];
}
List<ThreadGroupReference> l = tc.getGroups(tgr);
int i, k = l.size ();
JPDAThreadGroupImpl[] ts = new JPDAThreadGroupImpl[k];
for (i = 0; i < k; i++) {
ts [i] = (JPDAThreadGroupImpl) debugger.getThreadGroup(l.get (i));
}
return ts;
}
示例8: notifyToBeResumed
import com.sun.jdi.ThreadGroupReference; //导入依赖的package包/类
void notifyToBeResumed(ThreadsCache tc) {
List<ThreadReference> threads = tc.getThreads(tgr);
for (ThreadReference threadRef : threads) {
JPDAThreadImpl thread = debugger.getThread(threadRef);
thread.notifyToBeResumed();
}
List<ThreadGroupReference> groups = tc.getGroups(tgr);
for (ThreadGroupReference groupRef : groups) {
JPDAThreadGroupImpl group = (JPDAThreadGroupImpl) debugger.getThreadGroup(groupRef);
group.notifyToBeResumed(tc);
}
}
示例9: notifySuspended
import com.sun.jdi.ThreadGroupReference; //导入依赖的package包/类
void notifySuspended(ThreadsCache tc) {
List<ThreadReference> threads = tc.getThreads(tgr);
for (ThreadReference threadRef : threads) {
JPDAThreadImpl thread = debugger.getThread(threadRef);
thread.notifySuspended();
}
List<ThreadGroupReference> groups = tc.getGroups(tgr);
for (ThreadGroupReference groupRef : groups) {
JPDAThreadGroupImpl group = (JPDAThreadGroupImpl) debugger.getThreadGroup(groupRef);
group.notifySuspended(tc);
}
}
示例10: push
import com.sun.jdi.ThreadGroupReference; //导入依赖的package包/类
/**
* The invariant in this class is that the top iterator
* on the stack has more elements. If the stack is
* empty, there is no top. This method assures
* this invariant.
*/
private void push(List<ThreadGroupReference> tgl) {
stack.push(tgl.iterator());
while (!stack.isEmpty() && !top().hasNext()) {
stack.pop();
}
}
示例11: find
import com.sun.jdi.ThreadGroupReference; //导入依赖的package包/类
static ThreadGroupReference find(String name) {
ThreadGroupIterator tgi = new ThreadGroupIterator();
while (tgi.hasNext()) {
ThreadGroupReference tg = tgi.nextThreadGroup();
if (tg.name().equals(name)) {
return tg;
}
}
return null;
}
示例12: group
import com.sun.jdi.ThreadGroupReference; //导入依赖的package包/类
static ThreadGroupReference group() {
if (group == null) {
// Current thread group defaults to the first top level
// thread group.
setThreadGroup(Env.vm().topLevelThreadGroups().get(0));
}
return group;
}
示例13: threadGroup
import com.sun.jdi.ThreadGroupReference; //导入依赖的package包/类
public ThreadGroupReference threadGroup() {
/*
* Thread group can't change, so it's cached once and for all.
*/
if (threadGroup == null) {
try {
threadGroup = JDWP.ThreadReference.ThreadGroup.
process(vm, this).group;
} catch (JDWPException exc) {
throw exc.toJDIException();
}
}
return threadGroup;
}
示例14: name
import com.sun.jdi.ThreadGroupReference; //导入依赖的package包/类
public String name() {
if (name == null) {
// Does not need synchronization, since worst-case
// static info is fetched twice (Thread group name
// cannot change)
try {
name = JDWP.ThreadGroupReference.Name.
process(vm, this).groupName;
} catch (JDWPException exc) {
throw exc.toJDIException();
}
}
return name;
}
示例15: parent
import com.sun.jdi.ThreadGroupReference; //导入依赖的package包/类
public ThreadGroupReference parent() {
if (!triedParent) {
// Does not need synchronization, since worst-case
// static info is fetched twice (Thread group parent cannot
// change)
try {
parent = JDWP.ThreadGroupReference.Parent.
process(vm, this).parentGroup;
triedParent = true;
} catch (JDWPException exc) {
throw exc.toJDIException();
}
}
return parent;
}