/*
* 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 interface is used to create and remove Breakpoints, Watchpoints,
* etc.
* It include implementations of all the request interfaces..
*/
// Warnings from List filters and List[] requestLists is hard to fix.
// Remove SuppressWarning when we fix the warnings from List filters
// and List[] requestLists. The generic array is not supported.
@SuppressWarnings("unchecked")
implements EventRequestManager
{
switch(jdwpPolicy) {
return EventRequest.SUSPEND_ALL;
return EventRequest.SUSPEND_EVENT_THREAD;
return EventRequest.SUSPEND_NONE;
default:
}
}
switch(jdiPolicy) {
case EventRequest.SUSPEND_ALL:
case EventRequest.SUSPEND_NONE:
default:
}
}
/*
* Override superclass back to default equality
*/
return this == obj;
}
public int hashCode() {
return System.identityHashCode(this);
}
int id;
/*
* This list is not protected by a synchronized wrapper. All
* access/modification should be protected by synchronizing on
* the enclosing instance of EventRequestImpl.
*/
boolean isEnabled = false;
boolean deleted = false;
EventRequestImpl() {
super(EventRequestManagerImpl.this.vm);
}
/*
* Override superclass back to default equality
*/
return this == obj;
}
public int hashCode() {
return System.identityHashCode(this);
}
abstract int eventCmd();
return new InvalidRequestStateException(toString());
}
return deleted? " (deleted)" :
}
/**
* @return all the event request of this kind
*/
}
/**
* delete the event request
*/
void delete() {
if (!deleted) {
requestList().remove(this);
disable(); /* must do BEFORE delete */
deleted = true;
}
}
public boolean isEnabled() {
return isEnabled;
}
public void enable() {
setEnabled(true);
}
public void disable() {
setEnabled(false);
}
if (deleted) {
throw invalidState();
} else {
if (isEnabled) {
clear();
} else {
set();
}
}
}
}
throw invalidState();
}
if (count < 1) {
throw new IllegalArgumentException("count is less than one");
}
}
throw invalidState();
}
}
public int suspendPolicy() {
return JDWPtoJDISuspendPolicy(suspendPolicy);
}
/**
* set (enable) the event request
*/
synchronized void set() {
try {
} catch (JDWPException exc) {
throw exc.toJDIException();
}
isEnabled = true;
}
synchronized void clear() {
try {
} catch (JDWPException exc) {
throw exc.toJDIException();
}
isEnabled = false;
}
/**
* @return a small Map
* @see #putProperty
* @see #getProperty
*/
if (clientProperties == null) {
}
return clientProperties;
}
/**
* Returns the value of the property with the specified key. Only
* properties added with <code>putProperty</code> will return
* a non-null value.
*
* @return the value of this property or null
* @see #putProperty
*/
if (clientProperties == null) {
return null;
} else {
}
}
/**
*
* @see #getProperty
*/
} else {
}
}
}
throw invalidState();
}
}
}
abstract class ClassVisibleEventRequestImpl
extends ThreadVisibleEventRequestImpl {
throw invalidState();
}
}
throw invalidState();
}
if (classPattern == null) {
throw new NullPointerException();
}
.create(classPattern));
}
throw invalidState();
}
if (classPattern == null) {
throw new NullPointerException();
}
.create(classPattern));
}
throw invalidState();
}
if (!vm.canUseInstanceFilters()) {
throw new UnsupportedOperationException(
"target does not support instance filters");
}
}
}
implements BreakpointRequest {
requestList().add(this);
}
return location;
}
int eventCmd() {
}
}
}
implements ClassPrepareRequest {
requestList().add(this);
}
int eventCmd() {
}
throw invalidState();
}
if (!vm.canUseSourceNameFilters()) {
throw new UnsupportedOperationException(
"target does not support source name filters");
}
if (sourceNamePattern == null) {
throw new NullPointerException();
}
}
return "class prepare request " + state();
}
}
implements ClassUnloadRequest {
requestList().add(this);
}
int eventCmd() {
}
return "class unload request " + state();
}
}
implements ExceptionRequest {
boolean caught = true;
boolean uncaught = true;
boolean notifyCaught, boolean notifyUncaught) {
{
} else {
}
}
requestList().add(this);
}
return exception;
}
public boolean notifyCaught() {
return caught;
}
public boolean notifyUncaught() {
return uncaught;
}
int eventCmd() {
}
}
}
implements MethodEntryRequest {
requestList().add(this);
}
int eventCmd() {
}
return "method entry request " + state();
}
}
implements MethodExitRequest {
if (methodExitEventCmd == 0) {
/*
* If we can get return values, then we always get them.
* Thus, for JDI MethodExitRequests, we always use the
* same JDWP EventKind. Here we decide which to use and
* save it so that it will be used for all future
* MethodExitRequests.
*
* This call to canGetMethodReturnValues can't
* be done in the EventRequestManager ctor because that is too early.
*/
if (vm.canGetMethodReturnValues()) {
} else {
}
}
requestList().add(this);
}
int eventCmd() {
}
return "method exit request " + state();
}
}
implements MonitorContendedEnterRequest {
requestList().add(this);
}
int eventCmd() {
}
return "monitor contended enter request " + state();
}
}
implements MonitorContendedEnteredRequest {
requestList().add(this);
}
int eventCmd() {
}
return "monitor contended entered request " + state();
}
}
implements MonitorWaitRequest {
requestList().add(this);
}
int eventCmd() {
}
return "monitor wait request " + state();
}
}
implements MonitorWaitedRequest {
requestList().add(this);
}
int eventCmd() {
}
return "monitor waited request " + state();
}
}
implements StepRequest {
int size;
int depth;
/*
* Translate size and depth to corresponding JDWP values.
*/
int jdwpSize;
switch (size) {
case STEP_MIN:
break;
case STEP_LINE:
break;
default:
throw new IllegalArgumentException("Invalid step size");
}
int jdwpDepth;
switch (depth) {
case STEP_INTO:
break;
case STEP_OVER:
break;
case STEP_OUT:
break;
default:
throw new IllegalArgumentException("Invalid step depth");
}
/*
* Make sure this isn't a duplicate
*/
if ((request != this) &&
throw new DuplicateRequestException(
"Only one step request allowed per thread");
}
}
requestList().add(this);
}
public int depth() {
return depth;
}
public int size() {
return size;
}
return thread;
}
int eventCmd() {
}
}
}
implements ThreadDeathRequest {
requestList().add(this);
}
int eventCmd() {
}
return "thread death request " + state();
}
}
implements ThreadStartRequest {
requestList().add(this);
}
int eventCmd() {
}
return "thread start request " + state();
}
}
implements WatchpointRequest {
}
return field;
}
}
implements AccessWatchpointRequest {
super(field);
requestList().add(this);
}
int eventCmd() {
}
}
}
implements ModificationWatchpointRequest {
super(field);
requestList().add(this);
}
int eventCmd() {
}
}
}
implements VMDeathRequest {
requestList().add(this);
}
int eventCmd() {
}
return "VM death request " + state();
}
}
/**
* Constructor.
*/
super(vm);
int highest = 0;
int val;
try {
} catch (IllegalAccessException exc) {
}
}
}
for (int i=0; i <= highest; i++) {
requestLists[i] = new ArrayList();
}
}
return new ClassPrepareRequestImpl();
}
return new ClassUnloadRequestImpl();
}
boolean notifyCaught,
boolean notifyUncaught) {
}
}
return new ThreadDeathRequestImpl();
}
return new ThreadStartRequestImpl();
}
return new MethodEntryRequestImpl();
}
return new MethodExitRequestImpl();
}
if (!vm.canRequestMonitorEvents()) {
throw new UnsupportedOperationException(
"target VM does not support requesting Monitor events");
}
return new MonitorContendedEnterRequestImpl();
}
if (!vm.canRequestMonitorEvents()) {
throw new UnsupportedOperationException(
"target VM does not support requesting Monitor events");
}
return new MonitorContendedEnteredRequestImpl();
}
if (!vm.canRequestMonitorEvents()) {
throw new UnsupportedOperationException(
"target VM does not support requesting Monitor events");
}
return new MonitorWaitRequestImpl();
}
if (!vm.canRequestMonitorEvents()) {
throw new UnsupportedOperationException(
"target VM does not support requesting Monitor events");
}
return new MonitorWaitedRequestImpl();
}
throw new NativeMethodException("Cannot set breakpoints on native methods");
}
return new BreakpointRequestImpl(location);
}
public AccessWatchpointRequest
if (!vm.canWatchFieldAccess()) {
throw new UnsupportedOperationException(
"target VM does not support access watchpoints");
}
return new AccessWatchpointRequestImpl(field);
}
if (!vm.canWatchFieldModification()) {
throw new UnsupportedOperationException(
"target VM does not support modification watchpoints");
}
return new ModificationWatchpointRequestImpl(field);
}
if (!vm.canRequestVMDeathEvent()) {
throw new UnsupportedOperationException(
"target VM does not support requesting VM death events");
}
return new VMDeathRequestImpl();
}
}
// copy the eventRequests to avoid ConcurrentModificationException
}
}
public void deleteAllBreakpoints() {
try {
} catch (JDWPException exc) {
throw exc.toJDIException();
}
}
}
}
}
}
}
}
}
}
}
}
return unmodifiableRequestList(
}
}
}
}
}
}
}
return er;
}
}
return null;
}
return requestLists[eventCmd];
}
}