/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* This source code is provided to illustrate the usage of a given feature
* or technique and has been deliberately simplified. Additional steps
* required for a production-quality application, such as security checks,
* input validation and proper error handling, might not be present in
* this sample code.
*/
public class ContextManager {
private boolean verbose;
mainClassName = "";
vmArguments = "";
commandArguments = "";
}
// Program execution defaults.
//### Should there be change listeners for these?
//### They would be needed if we expected a dialog to be
//### synchronized with command input while it was open.
return mainClassName;
}
this.mainClassName = mainClassName;
}
return processClasspathDefaults(vmArguments);
}
this.vmArguments = vmArguments;
}
return commandArguments;
}
this.commandArguments = commandArguments;
}
return remotePort;
}
this.remotePort = remotePort;
}
// Miscellaneous debugger session preferences.
public boolean getVerboseFlag() {
return verbose;
}
}
// Thread focus.
return currentThread;
}
if (t != currentThread) {
currentThread = t;
}
}
currentThread = t;
0, true);
}
public void invalidateCurrentThread() {
}
// If a view is displaying the current thread, it may
// choose to indicate which frame is current in the
// sense of the command-line UI. It may also "warp" the
// selection to that frame when changed by an 'up' or 'down'
// command. Hence, a notifier is provided.
/******
public int getCurrentFrameIndex() {
return getCurrentFrameIndex(currentThreadInfo);
}
******/
}
//### Used in StackTraceTool.
return 0;
}
if (currentFrame == null) {
return 0;
} else {
return currentFrame.intValue();
}
}
return setCurrentFrameIndex(t,count, true);
}
return setCurrentFrameIndex(t, newIndex, false);
}
if (currentThread == null) {
return 0;
} else {
}
}
private int setCurrentFrameIndex(ThreadReference t, int x, boolean relative) throws VMNotInterruptedException {
return 0;
}
} else if (newIndex < 0) {
newIndex = 0;
}
}
}
//### In fact, the value may not have changed at this point.
//### We need to signal that the user attempted to change it,
//### however, so that the selection can be "warped" to the
//### current location.
}
}
}
try {
// It is possible, though unlikely, that the VM was interrupted
// before the thread created its Java stack.
} catch (FrameIndexOutOfBoundsException e) {
return null;
}
}
}
}
//### These notifiers are fired only in response to USER-INITIATED changes
//### to the current thread and current frame. When the current thread is set automatically
//### after a breakpoint hit or step completion, no event is generated. Instead,
//### interested parties are expected to listen for the BreakpointHit and StepCompleted
//### events. This convention is unclean, and I believe that it reflects a defect in
//### in the current architecture. Unfortunately, however, we cannot guarantee the
//### order in which various listeners receive a given event, and the handlers for
//### the very same events that cause automatic changes to the current thread may also
//### need to know the current thread.
int index = 0;
if (t != null) {
}
}
index, false);
}
boolean invalidate) {
for (int i = 0; i < l.size(); i++) {
}
}
implements SessionListener, JDIListener {
// SessionListener
}
}
}
// JDIListener
}
}
}
}
/**
* Add a -classpath argument to the arguments passed to the exec'ed
* VM with the contents of CLASSPATH environment variable,
* if -classpath was not already specified.
*
* @param javaArgs the arguments to the VM being exec'd that
* potentially has a user specified -classpath argument.
* @return a javaArgs whose -classpath option has been added
*/
}
} else {
}
} else {
return javaArgs;
}
}
return path1;
} else {
}
}
}