feat(jdk8): move files to new folder to avoid resources compiled.

This commit is contained in:
2025-09-07 15:25:52 +08:00
parent 3f0047bf6f
commit 8c35cfb1c0
17415 changed files with 217 additions and 213 deletions

View File

@@ -0,0 +1,61 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*/
package com.sun.jdi.request;
import com.sun.jdi.*;
/**
* Request for notification when the contents of a field are accessed
* in the target VM.
* This event will be triggered when the specified field is accessed
* by Java<SUP><FONT SIZE="-2">TM</FONT></SUP> programming
* language code or by a
* Java Native Interface (JNI) get function (<code>Get&lt;Type&gt;Field,
* GetStatic&lt;Type&gt;Field</code>).
* Access by JDI does not trigger this event.
* When an enabled AccessWatchpointRequest is satisfied, an
* {@link com.sun.jdi.event.EventSet event set} containing an
* {@link com.sun.jdi.event.AccessWatchpointEvent AccessWatchpointEvent} will be placed
* on the {@link com.sun.jdi.event.EventQueue EventQueue}.
* The collection of existing ExceptionRequests is
* managed by the {@link EventRequestManager}
* The collection of existing
* watchpoints is
* managed by the {@link EventRequestManager}.
* <p>
* Note that the modification
* of a Field is not considered an access.
*
* @see ModificationWatchpointRequest
* @see com.sun.jdi.event.EventQueue
* @see EventRequestManager
*
* @author Robert Field
* @since 1.3
*/
@jdk.Exported
public interface AccessWatchpointRequest extends WatchpointRequest {
}

View File

@@ -0,0 +1,88 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*/
package com.sun.jdi.request;
import com.sun.jdi.*;
/**
* Identifies a {@link Location} in the target VM at which
* execution should be stopped. When an enabled BreakpointRequest is
* satisfied, an
* {@link com.sun.jdi.event.EventSet event set} containing an
* {@link com.sun.jdi.event.BreakpointEvent BreakpointEvent}
* will be placed on the
* {@link com.sun.jdi.event.EventQueue EventQueue} and
* the application is interrupted. The collection of existing breakpoints is
* managed by the {@link EventRequestManager}
*
* @see Location
* @see com.sun.jdi.event.BreakpointEvent
* @see com.sun.jdi.event.EventQueue
* @see EventRequestManager
*
* @author Robert Field
* @since 1.3
*/
@jdk.Exported
public interface BreakpointRequest extends EventRequest, Locatable {
/**
* Returns the location of the requested breakpoint.
*
* @return the {@link Location} where this breakpoint has been set.
*/
Location location();
/**
* Restricts the events generated by this request to those in
* the given thread.
* @param thread the thread to filter on.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addThreadFilter(ThreadReference thread);
/**
* Restricts the events generated by this request to those in
* which the currently executing instance is the object
* specified.
* <P>
* Not all targets support this operation.
* Use {@link VirtualMachine#canUseInstanceFilters()}
* to determine if the operation is supported.
* @since 1.4
* @param instance the object which must be the current instance
* in order to pass this filter.
* @throws java.lang.UnsupportedOperationException if
* the target virtual machine does not support this
* operation.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addInstanceFilter(ObjectReference instance);
}

View File

@@ -0,0 +1,125 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*/
package com.sun.jdi.request;
import com.sun.jdi.*;
/**
* Request for notification when a class is prepared in the target VM.
* When an enabled ClassPrepareRequest is satisfied, an
* {@link com.sun.jdi.event.EventSet event set} containing a
* {@link com.sun.jdi.event.ClassPrepareEvent ClassPrepareEvent}
* will be placed on the
* {@link com.sun.jdi.event.EventQueue EventQueue}.
* The collection of existing ClassPrepareRequests is
* managed by the {@link EventRequestManager}
* <p>
* Class preparation is defined in the Java Virtual Machine
* Specification.
*
* @see com.sun.jdi.event.ClassPrepareEvent
* @see com.sun.jdi.event.EventQueue
* @see EventRequestManager
*
* @author Robert Field
* @since 1.3
*/
@jdk.Exported
public interface ClassPrepareRequest extends EventRequest {
/**
* Restricts the events generated by this request to be the
* preparation of the given reference type and any subtypes.
* An event will be generated for any prepared reference type that can
* be safely cast to the given reference type.
*
* @param refType the reference type to filter on.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassFilter(ReferenceType refType);
/**
* Restricts the events generated by this request to the
* preparation of reference types whose name matches this restricted
* regular expression. Regular expressions are limited
* to exact matches and patterns that begin with '*' or end with '*';
* for example, "*.Foo" or "java.*".
*
* @param classPattern the pattern String to filter for.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassFilter(String classPattern);
/**
* Restricts the events generated by this request to the
* preparation of reference types whose name does <b>not</b> match
* this restricted regular expression. Regular expressions are limited
* to exact matches and patterns that begin with '*' or end with '*';
* for example, "*.Foo" or "java.*".
*
* @param classPattern the pattern String to filter against.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassExclusionFilter(String classPattern);
/**
* Restricts the events generated by this request to the
* preparation of reference types for which the restricted regular
* expression 'sourceNamePattern' matches one of the 'sourceNames' for
* the reference type being prepared.
* That is, if refType is the ReferenceType being prepared,
* then there exists at least one stratum, call it 'someStratum'
* on the list returned by
* refType.availableStrata();
*
* such that a name on the list returned by
* refType.sourceNames(someStratam)
*
* matches 'sourceNamePattern'.
* Regular expressions are limited
* to exact matches and patterns that begin with '*' or end with '*';
* for example, "*.Foo" or "java.*".
* <P>
* Not all targets support this operation.
* Use {@link VirtualMachine#canUseSourceNameFilters()}
* to determine if the operation is supported.
* @since 1.6
* @param sourceNamePattern the pattern string to filter for.
* @throws java.lang.UnsupportedOperationException if
* the target virtual machine does not support this
* operation.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addSourceNameFilter(String sourceNamePattern);
}

View File

@@ -0,0 +1,77 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*/
package com.sun.jdi.request;
import com.sun.jdi.*;
/**
* Request for notification when a class is unloaded in the target VM.
* When an enabled ClassUnloadRequest is satisfied, a
* {@link com.sun.jdi.event.EventSet event set} containing an
* {@link com.sun.jdi.event.ClassUnloadEvent ClassUnloadEvent} will
* be placed on the {@link com.sun.jdi.event.EventQueue EventQueue}.
* The collection of existing ClassUnloadRequests is
* managed by the {@link EventRequestManager}
* <p>
* Refer to the Java Virtual Machine Specification for more information
* on class unloading.
*
* @see com.sun.jdi.event.ClassUnloadEvent
* @see com.sun.jdi.event.EventQueue
* @see EventRequestManager
*
* @author Robert Field
* @since 1.3
*/
@jdk.Exported
public interface ClassUnloadRequest extends EventRequest {
/**
* Restricts the events generated by this request to the
* unloading of reference types whose name matches a restricted
* regular expression. Regular expressions are limited to exact
* matches and patterns that begin with '*' or end with '*'; for
* example, "*.Foo" or "java.*".
* @param classPattern the pattern String to filter for.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassFilter(String classPattern);
/**
* Restricts the events generated by this request to the
* unloading of reference types whose name does <b>not</b> match
* a restricted regular expression. Regular expressions are limited
* to exact matches and patterns that begin with '*' or end with '*';
* for example, "*.Foo" or "java.*".
* @param classPattern the pattern String to filter against.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassExclusionFilter(String classPattern);
}

View File

@@ -0,0 +1,45 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*/
package com.sun.jdi.request;
/**
* Thrown to indicate a duplicate event request.
*
* @author Robert Field
* @since 1.3
*/
@jdk.Exported
public class DuplicateRequestException extends RuntimeException {
private static final long serialVersionUID = -3719784920313411060L;
public DuplicateRequestException() {
super();
}
public DuplicateRequestException(String s) {
super(s);
}
}

View File

@@ -0,0 +1,211 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*/
package com.sun.jdi.request;
import com.sun.jdi.*;
/**
* Represents a request for notification of an event. Examples include
* {@link BreakpointRequest} and {@link ExceptionRequest}.
* When an event occurs for which an enabled request is present,
* an {@link com.sun.jdi.event.EventSet EventSet} will
* be placed on the {@link com.sun.jdi.event.EventQueue EventQueue}.
* The collection of existing event requests is
* managed by the {@link EventRequestManager}.
* <p>
* The number of events generated for an event request can be controlled
* through filters. Filters provide additional constraints that an event
* must satisfy before it is placed on the event queue. Multiple filters can
* be used by making multiple calls to filter addition methods such as
* {@link ExceptionRequest#addClassFilter(java.lang.String classPattern)}.
* Filters are added to an event one at a time only while the event is
* disabled. Multiple filters are applied with CUT-OFF AND, in the order
* it was added to the request. Only events that satisfy all filters are
* placed in the event queue.
* <p>
* The set of available filters is dependent on the event request,
* some examples of filters are:
* <ul>
* <li>Thread filters allow control over the thread for which events are
* generated.
* <li>Class filters allow control over the class in which the event
* occurs.
* <li>Instance filters allow control over the instance in which
* the event occurs.
* <li>Count filters allow control over the number of times an event
* is reported.
* </ul>
* Filters can dramatically improve debugger performance by reducing the
* amount of event traffic sent from the target VM to the debugger VM.
* <p>
* Any method on <code>EventRequest</code> which
* takes <code>EventRequest</code> as an parameter may throw
* {@link com.sun.jdi.VMDisconnectedException} if the target VM is
* disconnected and the {@link com.sun.jdi.event.VMDisconnectEvent} has been or is
* available to be read from the {@link com.sun.jdi.event.EventQueue}.
* <p>
* Any method on <code>EventRequest</code> which
* takes <code>EventRequest</code> as an parameter may throw
* {@link com.sun.jdi.VMOutOfMemoryException} if the target VM has run out of memory.
*
* @see com.sun.jdi.event.BreakpointEvent
* @see com.sun.jdi.event.EventQueue
* @see EventRequestManager
*
* @author Robert Field
* @since 1.3
*/
@jdk.Exported
public interface EventRequest extends Mirror {
/**
* Determines if this event request is currently enabled.
*
* @return <code>true</code> if enabled;
* <code>false</code> otherwise.
*/
boolean isEnabled();
/**
* Enables or disables this event request. While this event request is
* disabled, the event request will be ignored and the target VM
* will not be stopped if any of its threads reaches the
* event request. Disabled event requests still exist,
* and are included in event request lists such as
* {@link EventRequestManager#breakpointRequests()}.
*
* @param val <code>true</code> if the event request is to be enabled;
* <code>false</code> otherwise.
* @throws InvalidRequestStateException if this request
* has been deleted.
* @throws IllegalThreadStateException if this is a StepRequest,
* <code>val</code> is <code>true</code>, and the
* thread named in the request has died.
*/
void setEnabled(boolean val);
/**
* Same as {@link #setEnabled <CODE>setEnabled(true)</CODE>}.
* @throws InvalidRequestStateException if this request
* has been deleted.
* @throws IllegalThreadStateException if this is a StepRequest
* and the thread named in the request has died.
*/
void enable();
/**
* Same as {@link #setEnabled <CODE>setEnabled(false)</CODE>}.
* @throws InvalidRequestStateException if this request
* has been deleted.
*/
void disable();
/**
* Limit the requested event to be reported at most once after a
* given number of occurrences. The event is not reported
* the first <code>count - 1</code> times this filter is reached.
* To request a one-off event, call this method with a count of 1.
* <p>
* Once the count reaches 0, any subsequent filters in this request
* are applied. If none of those filters cause the event to be
* suppressed, the event is reported. Otherwise, the event is not
* reported. In either case subsequent events are never reported for
* this request.
*
* @param count the number of ocurrences before generating an event.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
* @throws IllegalArgumentException if <CODE>count</CODE>
* is less than one.
*/
void addCountFilter(int count);
/** Suspend no threads when the event occurs */
int SUSPEND_NONE = 0;
/** Suspend only the thread which generated the event when the event occurs */
int SUSPEND_EVENT_THREAD = 1;
/** Suspend all threads when the event occurs */
int SUSPEND_ALL = 2;
/**
* Determines the threads to suspend when the requested event occurs
* in the target VM. Use {@link #SUSPEND_ALL} to suspend all
* threads in the target VM (the default). Use {@link #SUSPEND_EVENT_THREAD}
* to suspend only the thread which generated the event. Use
* {@link #SUSPEND_NONE} to suspend no threads.
* <p>
* Thread suspensions through events have the same functionality
* as explicitly requested suspensions. See
* {@link com.sun.jdi.ThreadReference#suspend} and
* {@link com.sun.jdi.VirtualMachine#suspend} for details.
*
* @param policy the selected suspend policy.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Suspend policy may only be set in disabled requests.
* @throws IllegalArgumentException if the policy argument
* contains an illegal value.
*/
void setSuspendPolicy(int policy);
/**
* Returns a value which describes the threads to suspend when the
* requested event occurs in the target VM.
* The returned value is {@link #SUSPEND_ALL},
* {@link #SUSPEND_EVENT_THREAD}, or {@link #SUSPEND_NONE}.
*
* @return the current suspend mode for this request
*/
int suspendPolicy();
/**
* Add an arbitrary key/value "property" to this request.
* The property can be used by a client of the JDI to
* associate application information with the request;
* These client-set properties are not used internally
* by the JDI.
* <p>
* The <code>get/putProperty</code> methods provide access to
* a small per-instance map. This is <b>not</b> to be confused
* with {@link java.util.Properties}.
* <p>
* If value is null this method will remove the property.
*
* @see #getProperty
*/
void putProperty(Object key, Object value);
/**
* Returns the value of the property with the specified key. Only
* properties added with {@link #putProperty} will return
* a non-null value.
*
* @return the value of this property or null
* @see #putProperty
*/
Object getProperty(Object key);
}

View File

@@ -0,0 +1,545 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*/
package com.sun.jdi.request;
import com.sun.jdi.*;
import java.util.List;
/**
* Manages the creation and deletion of {@link EventRequest}s. A single
* implementor of this interface exists in a particuar VM and
* is accessed through {@link VirtualMachine#eventRequestManager()}
*
* @see EventRequest
* @see com.sun.jdi.event.Event
* @see BreakpointRequest
* @see com.sun.jdi.event.BreakpointEvent
* @see VirtualMachine
*
* @author Robert Field
* @since 1.3
*/
@jdk.Exported
public interface EventRequestManager extends Mirror {
/**
* Creates a new disabled {@link ClassPrepareRequest}.
* The new event request is added to the list managed by this
* EventRequestManager. Use {@link EventRequest#enable()} to
* activate this event request.
*
* @return the created {@link ClassPrepareRequest}
*/
ClassPrepareRequest createClassPrepareRequest();
/**
* Creates a new disabled {@link ClassUnloadRequest}.
* The new event request is added to the list managed by this
* EventRequestManager. Use {@link EventRequest#enable()} to
* activate this event request.
*
* @return the created {@link ClassUnloadRequest}
*/
ClassUnloadRequest createClassUnloadRequest();
/**
* Creates a new disabled {@link ThreadStartRequest}.
* The new event request is added to the list managed by this
* EventRequestManager. Use {@link EventRequest#enable()} to
* activate this event request.
*
* @return the created {@link ThreadStartRequest}
*/
ThreadStartRequest createThreadStartRequest();
/**
* Creates a new disabled {@link ThreadDeathRequest}.
* The new event request is added to the list managed by this
* EventRequestManager. Use {@link EventRequest#enable()} to
* activate this event request.
*
* @return the created {@link ThreadDeathRequest}
*/
ThreadDeathRequest createThreadDeathRequest();
/**
* Creates a new disabled {@link ExceptionRequest}.
* The new event request is added to the list managed by this
* EventRequestManager. Use {@link EventRequest#enable()} to
* activate this event request.
* <P>
* A specific exception type and its subclasses can be selected
* for exception events. Caught exceptions, uncaught exceptions,
* or both can be selected. Note, however, that
* at the time an exception is thrown, it is not always
* possible to determine whether it is truly caught. See
* {@link com.sun.jdi.event.ExceptionEvent#catchLocation} for
* details.
* @param refType If non-null, specifies that exceptions which are
* instances of refType will be reported. Note: this
* will include instances of sub-types. If null,
* all instances will be reported
* @param notifyCaught If true, caught exceptions will be reported.
* @param notifyUncaught If true, uncaught exceptions will be reported.
*
* @return the created {@link ExceptionRequest}
*/
ExceptionRequest createExceptionRequest(ReferenceType refType,
boolean notifyCaught,
boolean notifyUncaught);
/**
* Creates a new disabled {@link MethodEntryRequest}.
* The new event request is added to the list managed by this
* EventRequestManager. Use {@link EventRequest#enable()} to
* activate this event request.
*
* @return the created {@link MethodEntryRequest}
*/
MethodEntryRequest createMethodEntryRequest();
/**
* Creates a new disabled {@link MethodExitRequest}.
* The new event request is added to the list managed by this
* EventRequestManager. Use {@link EventRequest#enable()} to
* activate this event request.
*
* @return the created {@link MethodExitRequest}
*/
MethodExitRequest createMethodExitRequest();
/**
* Creates a new disabled {@link MonitorContendedEnterRequest}.
* The new event request is added to the list managed by this
* EventRequestManager. Use {@link EventRequest#enable()} to
* activate this event request.
*
* Not all target virtual machines support this operation.
* Use {@link VirtualMachine#canRequestMonitorEvents()}
* to determine if the operation is supported.
*
* @return the created {@link MonitorContendedEnterRequest}
* @throws java.lang.UnsupportedOperationException if
* the target VM does not support this
* operation.
*
* @since 1.6
*/
MonitorContendedEnterRequest createMonitorContendedEnterRequest();
/**
* Creates a new disabled {@link MonitorContendedEnteredRequest}.
* The new event request is added to the list managed by this
* EventRequestManager. Use {@link EventRequest#enable()} to
* activate this event request.
*
* Not all target virtual machines support this operation.
* Use {@link VirtualMachine#canRequestMonitorEvents()}
* to determine if the operation is supported.
*
* @return the created {@link MonitorContendedEnteredRequest}
* @throws java.lang.UnsupportedOperationException if
* the target VM does not support this
* operation.
*
* @since 1.6
*/
MonitorContendedEnteredRequest createMonitorContendedEnteredRequest();
/**
* Creates a new disabled {@link MonitorWaitRequest}.
* The new event request is added to the list managed by this
* EventRequestManager. Use {@link EventRequest#enable()} to
* activate this event request.
*
* Not all target virtual machines support this operation.
* Use {@link VirtualMachine#canRequestMonitorEvents()}
* to determine if the operation is supported.
*
* @return the created {@link MonitorWaitRequest}
* @throws java.lang.UnsupportedOperationException if
* the target VM does not support this
* operation.
*
* @since 1.6
*/
MonitorWaitRequest createMonitorWaitRequest();
/**
* Creates a new disabled {@link MonitorWaitedRequest}.
* The new event request is added to the list managed by this
* EventRequestManager. Use {@link EventRequest#enable()} to
* activate this event request.
*
* Not all target virtual machines support this operation.
* Use {@link VirtualMachine#canRequestMonitorEvents()}
* to determine if the operation is supported.
*
* @return the created {@link MonitorWaitedRequest}
* @throws java.lang.UnsupportedOperationException if
* the target VM does not support this
* operation.
*
* @since 1.6
*/
MonitorWaitedRequest createMonitorWaitedRequest();
/**
* Creates a new disabled {@link StepRequest}.
* The new event request is added to the list managed by this
* EventRequestManager. Use {@link EventRequest#enable()} to
* activate this event request.
* <p>
* The returned request will control stepping only in the specified
* <code>thread</code>; all other threads will be unaffected.
* A <code>size</code>value of {@link com.sun.jdi.request.StepRequest#STEP_MIN} will generate a
* step event each time the code index changes. It represents the
* smallest step size available and often maps to the instruction
* level.
* A <code>size</code> value of {@link com.sun.jdi.request.StepRequest#STEP_LINE} will generate a
* step event each time the source line changes unless line number information is not available,
* in which case a STEP_MIN will be done instead. For example, no line number information is
* available during the execution of a method that has been rendered obsolete by
* by a {@link com.sun.jdi.VirtualMachine#redefineClasses} operation.
* A <code>depth</code> value of {@link com.sun.jdi.request.StepRequest#STEP_INTO} will generate
* step events in any called methods. A <code>depth</code> value
* of {@link com.sun.jdi.request.StepRequest#STEP_OVER} restricts step events to the current frame
* or caller frames. A <code>depth</code> value of {@link com.sun.jdi.request.StepRequest#STEP_OUT}
* restricts step events to caller frames only. All depth
* restrictions are relative to the call stack immediately before the
* step takes place.
* <p>
* Only one pending step request is allowed per thread.
* <p>
* Note that a typical debugger will want to cancel stepping
* after the first step is detected. Thus a next line method
* would do the following:
* <code>
* <pre>
* EventRequestManager mgr = myVM.{@link VirtualMachine#eventRequestManager eventRequestManager}();
* StepRequest request = mgr.createStepRequest(myThread,
* StepRequest.{@link StepRequest#STEP_LINE STEP_LINE},
* StepRequest.{@link StepRequest#STEP_OVER STEP_OVER});
* request.{@link EventRequest#addCountFilter addCountFilter}(1); // next step only
* request.enable();
* myVM.{@link VirtualMachine#resume resume}();
* </pre>
* </code>
*
* @param thread the thread in which to step
* @param depth the step depth
* @param size the step size
* @return the created {@link StepRequest}
* @throws DuplicateRequestException if there is already a pending
* step request for the specified thread.
* @throws IllegalArgumentException if the size or depth arguments
* contain illegal values.
*/
StepRequest createStepRequest(ThreadReference thread,
int size,
int depth);
/**
* Creates a new disabled {@link BreakpointRequest}.
* The given {@link Location} must have a valid
* (that is, non-negative) code index. The new
* breakpoint is added to the list managed by this
* EventRequestManager. Multiple breakpoints at the
* same location are permitted. Use {@link EventRequest#enable()} to
* activate this event request.
*
* @param location the location of the new breakpoint.
* @return the created {@link BreakpointRequest}
* @throws NativeMethodException if location is within a native method.
*/
BreakpointRequest createBreakpointRequest(Location location);
/**
* Creates a new disabled watchpoint which watches accesses to the
* specified field. The new
* watchpoint is added to the list managed by this
* EventRequestManager. Multiple watchpoints on the
* same field are permitted.
* Use {@link EventRequest#enable()} to
* activate this event request.
* <P>
* Not all target virtual machines support this operation.
* Use {@link VirtualMachine#canWatchFieldAccess()}
* to determine if the operation is supported.
*
* @param field the field to watch
* @return the created watchpoint
* @throws java.lang.UnsupportedOperationException if
* the target virtual machine does not support this
* operation.
*/
AccessWatchpointRequest createAccessWatchpointRequest(Field field);
/**
* Creates a new disabled watchpoint which watches accesses to the
* specified field. The new
* watchpoint is added to the list managed by this
* EventRequestManager. Multiple watchpoints on the
* same field are permitted.
* Use {@link EventRequest#enable()} to
* activate this event request.
* <P>
* Not all target virtual machines support this operation.
* Use {@link VirtualMachine#canWatchFieldModification()}
* to determine if the operation is supported.
*
* @param field the field to watch
* @return the created watchpoint
* @throws java.lang.UnsupportedOperationException if
* the target virtual machine does not support this
* operation.
*/
ModificationWatchpointRequest createModificationWatchpointRequest(Field field);
/**
* Creates a new disabled {@link VMDeathRequest}.
* The new request is added to the list managed by this
* EventRequestManager.
* Use {@link EventRequest#enable()} to
* activate this event request.
* <P>
* This request (if enabled) will cause a
* {@link com.sun.jdi.event.VMDeathEvent}
* to be sent on termination of the target VM.
* <P>
* A VMDeathRequest with a suspend policy of
* {@link EventRequest#SUSPEND_ALL SUSPEND_ALL}
* can be used to assure processing of incoming
* {@link EventRequest#SUSPEND_NONE SUSPEND_NONE} or
* {@link EventRequest#SUSPEND_EVENT_THREAD SUSPEND_EVENT_THREAD}
* events before VM death. If all event processing is being
* done in the same thread as event sets are being read,
* enabling the request is all that is needed since the VM
* will be suspended until the {@link com.sun.jdi.event.EventSet}
* containing the {@link com.sun.jdi.event.VMDeathEvent}
* is resumed.
* <P>
* Not all target virtual machines support this operation.
* Use {@link VirtualMachine#canRequestVMDeathEvent()}
* to determine if the operation is supported.
*
* @return the created request
* @throws java.lang.UnsupportedOperationException if
* the target VM does not support this
* operation.
*
* @since 1.4
*/
VMDeathRequest createVMDeathRequest();
/**
* Removes an eventRequest. The eventRequest is disabled and
* the removed from the requests managed by this
* EventRequestManager. Once the eventRequest is deleted, no
* operations (for example, {@link EventRequest#setEnabled})
* are permitted - attempts to do so will generally cause an
* {@link InvalidRequestStateException}.
* No other eventRequests are effected.
* <P>
* Because this method changes the underlying lists of event
* requests, attempting to directly delete from a list returned
* by a request accessor (e.g. below):
* <PRE>
* Iterator iter = requestManager.stepRequests().iterator();
* while (iter.hasNext()) {
* requestManager.deleteEventRequest(iter.next());
* }
* </PRE>
* may cause a {@link java.util.ConcurrentModificationException}.
* Instead use
* {@link #deleteEventRequests(List) deleteEventRequests(List)}
* or copy the list before iterating.
*
* @param eventRequest the eventRequest to remove
*/
void deleteEventRequest(EventRequest eventRequest);
/**
* Removes a list of {@link EventRequest}s.
*
* @see #deleteEventRequest(EventRequest)
*
* @param eventRequests the list of eventRequests to remove
*/
void deleteEventRequests(List<? extends EventRequest> eventRequests);
/**
* Remove all breakpoints managed by this EventRequestManager.
*
* @see #deleteEventRequest(EventRequest)
*/
void deleteAllBreakpoints();
/**
* Return an unmodifiable list of the enabled and disabled step requests.
* This list is a live view of these requests and thus changes as requests
* are added and deleted.
* @return the all {@link StepRequest} objects.
*/
List<StepRequest> stepRequests();
/**
* Return an unmodifiable list of the enabled and disabled class prepare requests.
* This list is a live view of these requests and thus changes as requests
* are added and deleted.
* @return the all {@link ClassPrepareRequest} objects.
*/
List<ClassPrepareRequest> classPrepareRequests();
/**
* Return an unmodifiable list of the enabled and disabled class unload requests.
* This list is a live view of these requests and thus changes as requests
* are added and deleted.
* @return the all {@link ClassUnloadRequest} objects.
*/
List<ClassUnloadRequest> classUnloadRequests();
/**
* Return an unmodifiable list of the enabled and disabled thread start requests.
* This list is a live view of these requests and thus changes as requests
* are added and deleted.
* @return the all {@link ThreadStartRequest} objects.
*/
List<ThreadStartRequest> threadStartRequests();
/**
* Return an unmodifiable list of the enabled and disabled thread death requests.
* This list is a live view of these requests and thus changes as requests
* are added and deleted.
* @return the all {@link ThreadDeathRequest} objects.
*/
List<ThreadDeathRequest> threadDeathRequests();
/**
* Return an unmodifiable list of the enabled and disabled exception requests.
* This list is a live view of these requests and thus changes as requests
* are added and deleted.
* @return the all {@link ExceptionRequest} objects.
*/
List<ExceptionRequest> exceptionRequests();
/**
* Return an unmodifiable list of the enabled and disabled breakpoint requests.
* This list is a live view of these requests and thus changes as requests
* are added and deleted.
* @return the list of all {@link BreakpointRequest} objects.
*/
List<BreakpointRequest> breakpointRequests();
/**
* Return an unmodifiable list of the enabled and disabled access
* watchpoint requests.
* This list is a live view of these requests and thus changes as requests
* are added and deleted.
* @return the all {@link AccessWatchpointRequest} objects.
*/
List<AccessWatchpointRequest> accessWatchpointRequests();
/**
* Return an unmodifiable list of the enabled and disabled modification
* watchpoint requests.
* This list is a live view of these requests and thus changes as requests
* are added and deleted.
* @return the all {@link ModificationWatchpointRequest} objects.
*/
List<ModificationWatchpointRequest> modificationWatchpointRequests();
/**
* Return an unmodifiable list of the enabled and disabled method entry requests.
* This list is a live view of these requests and thus changes as requests
* are added and deleted.
* @return the list of all {@link MethodEntryRequest} objects.
*/
List<MethodEntryRequest> methodEntryRequests();
/**
* Return an unmodifiable list of the enabled and disabled method exit requests.
* This list is a live view of these requests and thus changes as requests
* are added and deleted.
* @return the list of all {@link MethodExitRequest} objects.
*/
List<MethodExitRequest> methodExitRequests();
/**
* Return an unmodifiable list of the enabled and disabled monitor contended enter requests.
* This list is a live view of these requests and thus changes as requests
* are added and deleted.
* @return the list of all {@link MonitorContendedEnterRequest} objects.
*
* @since 1.6
*/
List<MonitorContendedEnterRequest> monitorContendedEnterRequests();
/**
* Return an unmodifiable list of the enabled and disabled monitor contended entered requests.
* This list is a live view of these requests and thus changes as requests
* are added and deleted.
* @return the list of all {@link MonitorContendedEnteredRequest} objects.
*
* @since 1.6
*/
List<MonitorContendedEnteredRequest> monitorContendedEnteredRequests();
/**
* Return an unmodifiable list of the enabled and disabled monitor wait requests.
* This list is a live view of these requests and thus changes as requests
* are added and deleted.
* @return the list of all {@link MonitorWaitRequest} objects.
*
* @since 1.6
*/
List<MonitorWaitRequest> monitorWaitRequests();
/**
* Return an unmodifiable list of the enabled and disabled monitor waited requests.
* This list is a live view of these requests and thus changes as requests
* are added and deleted.
* @return the list of all {@link MonitorWaitedRequest} objects.
*
* @since 1.6
*/
List<MonitorWaitedRequest> monitorWaitedRequests();
/**
* Return an unmodifiable list of the enabled and disabled VM death requests.
* This list is a live view of these requests and thus changes as requests
* are added and deleted.
* Note: the unsolicited VMDeathEvent does not have a
* corresponding request.
* @return the list of all {@link VMDeathRequest} objects.
*
* @since 1.4
*/
List<VMDeathRequest> vmDeathRequests();
}

View File

@@ -0,0 +1,156 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*/
package com.sun.jdi.request;
import com.sun.jdi.*;
/**
* Request for notification when an exception occurs in the target VM.
* When an enabled ExceptionRequest is satisfied, an
* {@link com.sun.jdi.event.EventSet event set} containing an
* {@link com.sun.jdi.event.ExceptionEvent ExceptionEvent} will be placed
* on the {@link com.sun.jdi.event.EventQueue EventQueue}.
* The collection of existing ExceptionRequests is
* managed by the {@link EventRequestManager}
*
* @see com.sun.jdi.event.ExceptionEvent
* @see com.sun.jdi.event.EventQueue
* @see EventRequestManager
*
* @author Robert Field
* @since 1.3
*/
@jdk.Exported
public interface ExceptionRequest extends EventRequest {
/**
* Returns exception type for which exception events are requested.
* @return
* The exception (and its subclasses) requested
* with {@link EventRequestManager#createExceptionRequest}, or
* null if, as by default, all exceptions are requested.
*/
ReferenceType exception();
/**
* Returns whether caught exceptions of the requested type
* will generate events when they are thrown.
* <p>
* Note that at the time an exception is thrown, it is not always
* possible to determine whether it is truly caught. See
* {@link com.sun.jdi.event.ExceptionEvent#catchLocation} for
* details.
* @return
* boolean true if caught exceptions will be reported, false
* otherwise.
*/
boolean notifyCaught();
/**
* Returns whether uncaught exceptions of the requested type
* will generate events when they are thrown.
* <p>
* Note that at the time an exception is thrown, it is not always
* possible to determine whether it is truly uncaught. See
* {@link com.sun.jdi.event.ExceptionEvent#catchLocation} for
* details.
* @return
* boolean true if caught exceptions will be reported, false
* otherwise.
*/
boolean notifyUncaught();
/**
* Restricts the events generated by this request to those in
* the given thread.
* @param thread the thread to filter on.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addThreadFilter(ThreadReference thread);
/**
* Restricts the events generated by this request to those whose
* location is in the given reference type or any of its subtypes.
* An event will be generated for any location in a reference type
* that can be safely cast to the given reference type.
*
* @param refType the reference type to filter on.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassFilter(ReferenceType refType);
/**
* Restricts the events generated by this request to those
* whose location is in a class whose name matches a restricted
* regular expression. Regular expressions are limited
* to exact matches and patterns that begin with '*' or end with '*';
* for example, "*.Foo" or "java.*".
*
* @param classPattern the pattern String to filter for.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassFilter(String classPattern);
/**
* Restricts the events generated by this request to those
* whose location is in a class whose name does <b>not</b> match a
* restricted regular expression. Regular expressions are limited
* to exact matches and patterns that begin with '*' or end with '*';
* for example, "*.Foo" or "java.*".
*
* @param classPattern the pattern String to filter against.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassExclusionFilter(String classPattern);
/**
* Restricts the events generated by this request to those in
* which the currently executing instance ("this") is the object
* specified.
* <P>
* Not all targets support this operation.
* Use {@link VirtualMachine#canUseInstanceFilters()}
* to determine if the operation is supported.
* @since 1.4
* @param instance the object which must be the current instance
* in order to pass this filter.
* @throws java.lang.UnsupportedOperationException if
* the target virtual machine does not support this
* operation.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addInstanceFilter(ObjectReference instance);
}

View File

@@ -0,0 +1,50 @@
/*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*/
package com.sun.jdi.request;
/**
* Thrown to indicate that the requested event cannot be modified
* because it is enabled. Filters can be added only to disabled
* event requests.
* Also thrown if an operation is attempted on a deleted request.
* See {@link EventRequestManager#deleteEventRequest(EventRequest)}
*
* @author Robert Field
* @since 1.3
*/
@jdk.Exported
public class InvalidRequestStateException extends RuntimeException {
private static final long serialVersionUID = -3774632428543322148L;
public InvalidRequestStateException()
{
super();
}
public InvalidRequestStateException(String s)
{
super(s);
}
}

View File

@@ -0,0 +1,117 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*/
package com.sun.jdi.request;
import com.sun.jdi.*;
/**
* Request for notification when a method is invoked in the target VM.
* When an enabled MethodEntryRequest is satisfied, an
* {@link com.sun.jdi.event.EventSet event set} containing a
* {@link com.sun.jdi.event.MethodEntryEvent MethodEntryEvent}
* will be placed on the
* {@link com.sun.jdi.event.EventQueue EventQueue}.
* The collection of existing MethodEntryRequests is
* managed by the {@link EventRequestManager}
*
* @see com.sun.jdi.event.MethodEntryEvent
* @see com.sun.jdi.event.EventQueue
* @see EventRequestManager
*
* @author Robert Field
* @since 1.3
*/
@jdk.Exported
public interface MethodEntryRequest extends EventRequest {
/**
* Restricts the events generated by this request to those in
* the given thread.
* @param thread the thread to filter on.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addThreadFilter(ThreadReference thread);
/**
* Restricts the events generated by this request to those whose
* method is in the given reference type or any of its subtypes.
* An event will be generated for any location in a reference type
* that can be safely cast to the given reference type.
*
* @param refType the reference type to filter on.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassFilter(ReferenceType refType);
/**
* Restricts the events generated by this request to those
* whose method is in a class whose name matches this restricted
* regular expression. Regular expressions are limited
* to exact matches and patterns that begin with '*' or end with '*';
* for example, "*.Foo" or "java.*".
*
* @param classPattern the pattern String to filter for.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassFilter(String classPattern);
/**
* Restricts the events generated by this request to those
* whose method is in a class whose name does <b>not</b> match this restricted
* regular expression, e.g. "java.*" or "*.Foo".
* @param classPattern the pattern String to filter against.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassExclusionFilter(String classPattern);
/**
* Restricts the events generated by this request to those in
* which the currently executing instance ("this") is the object
* specified.
* <P>
* Not all targets support this operation.
* Use {@link VirtualMachine#canUseInstanceFilters()}
* to determine if the operation is supported.
* @since 1.4
* @param instance the object which must be the current instance
* in order to pass this filter.
* @throws java.lang.UnsupportedOperationException if
* the target virtual machine does not support this
* operation.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addInstanceFilter(ObjectReference instance);
}

View File

@@ -0,0 +1,120 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*/
package com.sun.jdi.request;
import com.sun.jdi.*;
/**
* Request for notification when a method returns in the target VM.
* When an enabled MethodExitRequest is hit, an
* {@link com.sun.jdi.event.EventSet event set} containing a
* {@link com.sun.jdi.event.MethodExitEvent MethodExitEvent}
* will be placed on the
* {@link com.sun.jdi.event.EventQueue EventQueue}.
* The collection of existing MethodExitRequests is
* managed by the {@link EventRequestManager}
*
* @see com.sun.jdi.event.MethodExitEvent
* @see com.sun.jdi.event.EventQueue
* @see EventRequestManager
*
* @author Robert Field
* @since 1.3
*/
@jdk.Exported
public interface MethodExitRequest extends EventRequest {
/**
* Restricts the events generated by this request to those in
* the given thread.
* @param thread the thread to filter on.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addThreadFilter(ThreadReference thread);
/**
* Restricts the events generated by this request to those whose
* method is in the given reference type or any of its subtypes.
* An event will be generated for any location in a reference type
* that can be safely cast to the given reference type.
*
* @param refType the reference type to filter on.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassFilter(ReferenceType refType);
/**
* Restricts the events generated by this request to those
* whose method is in a class whose name matches a restricted
* regular expression. Regular expressions are limited
* to exact matches and patterns that begin with '*' or end with '*';
* for example, "*.Foo" or "java.*".
*
* @param classPattern the pattern String to filter for.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassFilter(String classPattern);
/**
* Restricts the events generated by this request to those
* whose method is in a class whose name does <b>not</b> match this
* restricted regular expression. Regular expressions are limited
* to exact matches and patterns that begin with '*' or end with '*';
* for example, "*.Foo" or "java.*".
*
* @param classPattern the pattern String to filter against.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassExclusionFilter(String classPattern);
/**
* Restricts the events generated by this request to those in
* which the currently executing instance ("this") is the object
* specified.
* <P>
* Not all targets support this operation.
* Use {@link VirtualMachine#canUseInstanceFilters()}
* to determine if the operation is supported.
* @since 1.4
* @param instance the object which must be the current instance
* in order to pass this filter.
* @throws java.lang.UnsupportedOperationException if
* the target virtual machine does not support this
* operation.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addInstanceFilter(ObjectReference instance);
}

View File

@@ -0,0 +1,60 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*/
package com.sun.jdi.request;
import com.sun.jdi.*;
/**
* Request for notification when a field is set.
* This event will be triggered when a value is assigned to the specified
* field with a Java<SUP><FONT SIZE="-2">TM</FONT></SUP> programming
* language statement (assignment, increment, etc) or by a
* Java Native Interface (JNI) set function (<code>Set&lt;Type&gt;Field,
* SetStatic&lt;Type&gt;Field</code>).
* Setting a field to a value which is the same as the previous value
* still triggers this event.
* Modification by JDI does not trigger this event.
* When an enabled
* ModificationWatchpointRequest is satisfied, an
* {@link com.sun.jdi.event.EventSet event set} containing a
* {@link com.sun.jdi.event.ModificationWatchpointEvent ModificationWatchpointEvent}
* will be placed on
* the {@link com.sun.jdi.event.EventQueue EventQueue}.
* The collection of existing
* watchpoints is
* managed by the {@link EventRequestManager}.
*
* @see com.sun.jdi.event.ModificationWatchpointEvent
* @see AccessWatchpointRequest
* @see com.sun.jdi.event.EventQueue
* @see EventRequestManager
*
* @author Robert Field
* @since 1.3
*/
@jdk.Exported
public interface ModificationWatchpointRequest extends WatchpointRequest {
}

View File

@@ -0,0 +1,117 @@
/*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*/
package com.sun.jdi.request;
import com.sun.jdi.*;
/**
* Request for notification of a thread in the target VM
* attempting to enter a monitor already acquired by another thread.
* When an enabled MonitorContededEnterRequest is satisfied, an
* {@link com.sun.jdi.event.EventSet event set} containing a
* {@link com.sun.jdi.event.MonitorContendedEnterEvent MonitorContendedEnterEvent}
* will be placed on the
* {@link com.sun.jdi.event.EventQueue EventQueue}.
* The collection of existing MonitorContendedEnterEvents is
* managed by the {@link EventRequestManager}
*
* @see com.sun.jdi.event.MonitorContendedEnterEvent
* @see com.sun.jdi.event.EventQueue
* @see EventRequestManager
*
* @author Swamy Venkataramanappa
* @since 1.6
*/
@jdk.Exported
public interface MonitorContendedEnterRequest extends EventRequest {
/**
* Restricts the events generated by this request to those in
* the given thread.
* @param thread the thread to filter on.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addThreadFilter(ThreadReference thread);
/**
* Restricts the events generated by this request to those whose
* method is in the given reference type or any of its subtypes.
* An event will be generated for any location in a reference type
* that can be safely cast to the given reference type.
*
* @param refType the reference type to filter on.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassFilter(ReferenceType refType);
/**
* Restricts the events generated by this request to those
* whose method is in a class whose name matches this restricted
* regular expression. Regular expressions are limited
* to exact matches and patterns that begin with '*' or end with '*';
* for example, "*.Foo" or "java.*".
*
* @param classPattern the pattern String to filter for.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassFilter(String classPattern);
/**
* Restricts the events generated by this request to those
* whose method is in a class whose name does <b>not</b> match this restricted
* regular expression, e.g. "java.*" or "*.Foo".
* @param classPattern the pattern String to filter against.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassExclusionFilter(String classPattern);
/**
* Restricts the events generated by this request to those in
* which the currently executing instance ("this") is the object
* specified.
* <P>
* Not all targets support this operation.
* Use {@link VirtualMachine#canUseInstanceFilters()}
* to determine if the operation is supported.
* @param instance the object which must be the current instance
* in order to pass this filter.
* @throws java.lang.UnsupportedOperationException if
* the target virtual machine does not support this
* operation.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addInstanceFilter(ObjectReference instance);
}

View File

@@ -0,0 +1,117 @@
/*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*/
package com.sun.jdi.request;
import com.sun.jdi.*;
/**
* Request for notification of a thread in the target VM entering a monitor
* after waiting for it to be released by another thread.
* When an enabled MonitorContededEnteredRequest is satisfied, an
* {@link com.sun.jdi.event.EventSet event set} containing a
* {@link com.sun.jdi.event.MonitorContendedEnteredEvent MonitorContendedEnteredEvent}
* will be placed on the
* {@link com.sun.jdi.event.EventQueue EventQueue}.
* The collection of existing MonitorContendedEnteredEvents is
* managed by the {@link EventRequestManager}
*
* @see com.sun.jdi.event.MonitorContendedEnteredEvent
* @see com.sun.jdi.event.EventQueue
* @see EventRequestManager
*
* @author Swamy Venkataramanappa
* @since 1.6
*/
@jdk.Exported
public interface MonitorContendedEnteredRequest extends EventRequest {
/**
* Restricts the events generated by this request to those in
* the given thread.
* @param thread the thread to filter on.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addThreadFilter(ThreadReference thread);
/**
* Restricts the events generated by this request to those whose
* method is in the given reference type or any of its subtypes.
* An event will be generated for any location in a reference type
* that can be safely cast to the given reference type.
*
* @param refType the reference type to filter on.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassFilter(ReferenceType refType);
/**
* Restricts the events generated by this request to those
* whose method is in a class whose name matches this restricted
* regular expression. Regular expressions are limited
* to exact matches and patterns that begin with '*' or end with '*';
* for example, "*.Foo" or "java.*".
*
* @param classPattern the pattern String to filter for.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassFilter(String classPattern);
/**
* Restricts the events generated by this request to those
* whose method is in a class whose name does <b>not</b> match this restricted
* regular expression, e.g. "java.*" or "*.Foo".
* @param classPattern the pattern String to filter against.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassExclusionFilter(String classPattern);
/**
* Restricts the events generated by this request to those in
* which the currently executing instance ("this") is the object
* specified.
* <P>
* Not all targets support this operation.
* Use {@link VirtualMachine#canUseInstanceFilters()}
* to determine if the operation is supported.
* @param instance the object which must be the current instance
* in order to pass this filter.
* @throws java.lang.UnsupportedOperationException if
* the target virtual machine does not support this
* operation.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addInstanceFilter(ObjectReference instance);
}

View File

@@ -0,0 +1,116 @@
/*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*/
package com.sun.jdi.request;
import com.sun.jdi.*;
/**
* Request for notification when a thread in the target VM is about to
* wait on a monitor object. That is, a thread is entering Object.wait().
* When an enabled MonitorWaitRequest is satisfied, an
* {@link com.sun.jdi.event.EventSet event set} containing a
* {@link com.sun.jdi.event.MonitorWaitEvent MonitorWaitEvent}
* will be placed on the
* {@link com.sun.jdi.event.EventQueue EventQueue}.
* The collection of existing MonitorWaitEvents is
* managed by the {@link EventRequestManager}
*
* @see com.sun.jdi.event.MonitorWaitEvent
* @see com.sun.jdi.event.EventQueue
* @see EventRequestManager
*
* @author Swamy Venkataramanappa
* @since 1.6
*/
@jdk.Exported
public interface MonitorWaitRequest extends EventRequest {
/**
* Restricts the events generated by this request to those in
* the given thread.
* @param thread the thread to filter on.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addThreadFilter(ThreadReference thread);
/**
* Restricts the events generated by this request to those whose
* monitor object is of the given reference type or any of
* its subtypes.
*
* @param refType the reference type to filter on.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassFilter(ReferenceType refType);
/**
* Restricts the events generated by this request to those
* in which the name of the class of the monitor object matches this restricted
* regular expression. Regular expressions are limited
* to exact matches and patterns that begin with '*' or end with '*';
* for example, "*.Foo" or "java.*".
*
* @param classPattern the pattern String to filter for.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassFilter(String classPattern);
/**
* Restricts the events generated by this request to those
* in which the name of the class of the monitor object does <b>not</b>match this restricted
* regular expression, e.g. "java.*" or "*.Foo".
* @param classPattern the pattern String to filter against.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassExclusionFilter(String classPattern);
/**
* Restricts the events generated by this request to those in
* which the currently executing instance ("this") is the object
* specified.
* <P>
* Not all targets support this operation.
* Use {@link VirtualMachine#canUseInstanceFilters()}
* to determine if the operation is supported.
* @param instance the object which must be the current instance
* in order to pass this filter.
* @throws java.lang.UnsupportedOperationException if
* the target virtual machine does not support this
* operation.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addInstanceFilter(ObjectReference instance);
}

View File

@@ -0,0 +1,116 @@
/*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*/
package com.sun.jdi.request;
import com.sun.jdi.*;
/**
* Request for notification when a thread in the target VM has finished waiting on
* a monitor object. That is, a thread is leaving Object.wait(). "
* When an enabled MonitorWaitedRequest is satisfied, an
* {@link com.sun.jdi.event.EventSet event set} containing a
* {@link com.sun.jdi.event.MonitorWaitedEvent MonitorWaitedEvent}
* will be placed on the
* {@link com.sun.jdi.event.EventQueue EventQueue}.
* The collection of existing MonitorWaitedEvents is
* managed by the {@link EventRequestManager}
*
* @see com.sun.jdi.event.MonitorWaitedEvent
* @see com.sun.jdi.event.EventQueue
* @see EventRequestManager
*
* @author Swamy Venkataramanappa
* @since 1.6
*/
@jdk.Exported
public interface MonitorWaitedRequest extends EventRequest {
/**
* Restricts the events generated by this request to those in
* the given thread.
* @param thread the thread to filter on.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addThreadFilter(ThreadReference thread);
/**
* Restricts the events generated by this request to those whose
* monitor object is of the given reference type or any of
* its subtypes.
*
* @param refType the reference type to filter on.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassFilter(ReferenceType refType);
/**
* Restricts the events generated by this request to those
* in which the name of the class of the monitor object matches this restricted
* regular expression. Regular expressions are limited
* to exact matches and patterns that begin with '*' or end with '*';
* for example, "*.Foo" or "java.*".
*
* @param classPattern the pattern String to filter for.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassFilter(String classPattern);
/**
* Restricts the events generated by this request to those
* in which the name of the class of the monitor object does <b>not</b>match this restricted
* regular expression, e.g. "java.*" or "*.Foo".
* @param classPattern the pattern String to filter against.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassExclusionFilter(String classPattern);
/**
* Restricts the events generated by this request to those in
* which the currently executing instance ("this") is the object
* specified.
* <P>
* Not all targets support this operation.
* Use {@link VirtualMachine#canUseInstanceFilters()}
* to determine if the operation is supported.
* @param instance the object which must be the current instance
* in order to pass this filter.
* @throws java.lang.UnsupportedOperationException if
* the target virtual machine does not support this
* operation.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addInstanceFilter(ObjectReference instance);
}

View File

@@ -0,0 +1,136 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*/
package com.sun.jdi.request;
import com.sun.jdi.*;
/**
* Request for notification when a step occurs in the target VM.
* When an enabled StepRequest is satisfied, an
* {@link com.sun.jdi.event.EventSet event set} containing a
* {@link com.sun.jdi.event.StepEvent StepEvent} will be placed on the
* {@link com.sun.jdi.event.EventQueue EventQueue}.
* The collection of existing StepRequests is
* managed by the {@link EventRequestManager}
*
* @see com.sun.jdi.event.StepEvent
* @see com.sun.jdi.event.EventQueue
* @see EventRequestManager
*
* @author Robert Field
* @since 1.3
*/
@jdk.Exported
public interface StepRequest extends EventRequest {
/** Step into any newly pushed frames */
int STEP_INTO = 1;
/** Step over any newly pushed frames */
int STEP_OVER = 2;
/** Step out of the current frame */
int STEP_OUT = 3;
/** Step to the next available location */
int STEP_MIN = -1;
/** Step to the next location on a different line */
int STEP_LINE = -2;
/**
* @return the thread on which the step event is being requested.
*/
ThreadReference thread();
/**
* @return the step size
*/
int size();
/**
* @return the step depth
*/
int depth();
/**
* Restricts the events generated by this request to those whose
* location is in the given reference type or any of its subtypes.
* An event will be generated for any location in a reference type
* that can be safely cast to the given reference type.
*
* @param refType the reference type to filter on.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassFilter(ReferenceType refType);
/**
* Restricts the events generated by this request to those
* whose location is in a class whose name matches a restricted
* regular expression. Regular expressions are limited
* to exact matches and patterns that begin with '*' or end with '*';
* for example, "*.Foo" or "java.*".
*
* @param classPattern the pattern String to filter for.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassFilter(String classPattern);
/**
* Restricts the events generated by this request to those
* whose location is in a class whose name does <b>not</b> match a
* restricted regular expression. Regular expressions are limited
* to exact matches and patterns that begin with '*' or end with '*';
* for example, "*.Foo" or "java.*".
*
* @param classPattern the pattern String to filter against.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassExclusionFilter(String classPattern);
/**
* Restricts the events generated by this request to those in
* which the currently executing instance ("this") is the object
* specified.
* <P>
* Not all targets support this operation.
* Use {@link VirtualMachine#canUseInstanceFilters()}
* to determine if the operation is supported.
* @since 1.4
* @param instance the object which must be the current instance
* in order to pass this filter.
* @throws java.lang.UnsupportedOperationException if
* the target virtual machine does not support this
* operation.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addInstanceFilter(ObjectReference instance);
}

View File

@@ -0,0 +1,59 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*/
package com.sun.jdi.request;
import com.sun.jdi.*;
/**
* Request for notification when a thread terminates in the target VM.
* When an enabled ThreadDeathRequest is satisfied, an
* {@link com.sun.jdi.event.EventSet event set} containing a
* {@link com.sun.jdi.event.ThreadDeathEvent ThreadDeathEvent}
* will be placed on the
* {@link com.sun.jdi.event.EventQueue EventQueue}.
* The collection of existing ThreadDeathRequests is
* managed by the {@link EventRequestManager}
*
* @see com.sun.jdi.event.ThreadDeathEvent
* @see com.sun.jdi.event.EventQueue
* @see EventRequestManager
*
* @author Robert Field
* @since 1.3
*/
@jdk.Exported
public interface ThreadDeathRequest extends EventRequest {
/**
* Restricts the events generated by this request to those in
* the given thread.
* @param thread the thread to filter on.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addThreadFilter(ThreadReference thread);
}

View File

@@ -0,0 +1,59 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*/
package com.sun.jdi.request;
import com.sun.jdi.*;
/**
* Request for notification when a thread starts execution in the target VM.
* When an enabled ThreadStartRequest is hit, an
* {@link com.sun.jdi.event.EventSet event set} containing a
* {@link com.sun.jdi.event.ThreadStartEvent ThreadStartEvent}
* will be placed on the
* {@link com.sun.jdi.event.EventQueue EventQueue}.
* The collection of existing ThreadStartRequests is
* managed by the {@link EventRequestManager}
*
* @see com.sun.jdi.event.ThreadStartEvent
* @see com.sun.jdi.event.EventQueue
* @see EventRequestManager
*
* @author Robert Field
* @since 1.3
*/
@jdk.Exported
public interface ThreadStartRequest extends EventRequest {
/**
* Restricts the events generated by this request to those in
* the given thread.
* @param thread the thread to filter on.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addThreadFilter(ThreadReference thread);
}

View File

@@ -0,0 +1,62 @@
/*
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*/
package com.sun.jdi.request;
import com.sun.jdi.*;
/**
* Request for notification when the target VM terminates.
* When an enabled VMDeathRequest is satisfied, an
* {@link com.sun.jdi.event.EventSet event set} containing a
* {@link com.sun.jdi.event.VMDeathEvent VMDeathEvent}
* will be placed on the
* {@link com.sun.jdi.event.EventQueue EventQueue}.
* The collection of existing VMDeathRequests is
* managed by the {@link EventRequestManager}
* <P>
* Even without creating a VMDeathRequest, a single
* unsolicited VMDeathEvent will be sent with a
* {@link EventRequest#suspendPolicy() suspend policy}
* of {@link EventRequest#SUSPEND_NONE SUSPEND_NONE}.
* This request would typically be created so that a
* VMDeathEvent with a suspend policy of
* {@link EventRequest#SUSPEND_ALL SUSPEND_ALL}
* will be sent. This event can be used to assure
* completion of any processing which requires the VM
* to be alive (e.g. event processing). Note: the
* unsolicited VMDeathEvent will still be sent.
*
* @see com.sun.jdi.event.VMDeathEvent
* @see com.sun.jdi.event.EventQueue
* @see EventRequestManager
*
* @author Robert Field
* @since 1.4
*/
@jdk.Exported
public interface VMDeathRequest extends EventRequest {
}

View File

@@ -0,0 +1,121 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*/
package com.sun.jdi.request;
import com.sun.jdi.*;
/**
* Identifies a {@link Field} in the target VM being watched.
*
* @see AccessWatchpointRequest
* @see ModificationWatchpointRequest
* @see com.sun.jdi.event.EventQueue
* @see EventRequestManager
*
* @author Robert Field
* @since 1.3
*/
@jdk.Exported
public interface WatchpointRequest extends EventRequest {
/**
* Gets the Field being watched by this WatchpointRequest.
*
* @return the {@link Field} this Watchpoint is monitoring.
*/
Field field();
/**
* Restricts the events generated by this request to those in
* the given thread.
* @param thread the thread to filter on.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addThreadFilter(ThreadReference thread);
/**
* Restricts the events generated by this request to those whose
* location is in the given reference type or any of its subtypes.
* An event will be generated for any location in a reference type
* that can be safely cast to the given reference type.
*
* @param refType the reference type to filter on.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassFilter(ReferenceType refType);
/**
* Restricts the events generated by this request to those
* whose location is in a class whose name matches a restricted
* regular expression. Regular expressions are limited
* to exact matches and patterns that begin with '*' or end with '*';
* for example, "*.Foo" or "java.*".
*
* @param classPattern the pattern String to filter for.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassFilter(String classPattern);
/**
* Restricts the events generated by this request to those
* whose location is in a class whose name does <b>not</b> match this
* restricted regular expression. Regular expressions are limited
* to exact matches and patterns that begin with '*' or end with '*';
* for example, "*.Foo" or "java.*".
*
* @param classPattern the pattern String to filter against.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addClassExclusionFilter(String classPattern);
/**
* Restricts the events generated by this request to those in
* which the currently executing instance ("this") is the object
* specified.
* <P>
* Not all targets support this operation.
* Use {@link VirtualMachine#canUseInstanceFilters()}
* to determine if the operation is supported.
* @since 1.4
* @param instance the object which must be the current instance
* in order to pass this filter.
* @throws java.lang.UnsupportedOperationException if
* the target virtual machine does not support this
* operation.
* @throws InvalidRequestStateException if this request is currently
* enabled or has been deleted.
* Filters may be added only to disabled requests.
*/
void addInstanceFilter(ObjectReference instance);
}

View File

@@ -0,0 +1,46 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 package is used to request that a JDI
* event be sent under specified conditions.
* With the exception of termination events, which are
* always sent, there is one kind of
* {@link com.sun.jdi.request.EventRequest} for each kind of
* {@link com.sun.jdi.event.Event Event} - for example,
* {@link com.sun.jdi.request.BreakpointRequest} is used to request a
* {@link com.sun.jdi.event.BreakpointEvent BreakpointEvent}.
* Event requests are created by the
* {@link com.sun.jdi.request.EventRequestManager}.
* Events and event processing are defined in the
* {@link com.sun.jdi.event} package.
* <p>
* Methods may be added to the interfaces in the JDI packages in future
* releases. Existing packages may be renamed if the JDI becomes a standard
* extension.
*/
@jdk.Exported
package com.sun.jdi.request;