All Implemented Interfaces:
Value
All Known Implementing Classes:
ClassLoaderReferenceImpl, ArrayReferenceImpl, ClassObjectReferenceImpl, ArrayReference, ClassObjectReference, ThreadGroupReferenceImpl, ThreadGroupReference, StringReference, ThreadReference, ArrayReferenceImpl, ThreadReferenceImpl, ObjectReferenceImpl, ThreadReferenceImpl, ObjectReferenceImpl, ClassLoaderReferenceImpl, ClassObjectReferenceImpl, ThreadGroupReferenceImpl, ClassLoaderReference, StringReferenceImpl, StringReferenceImpl
Any method on ObjectReference
which directly or
indirectly takes ObjectReference
as an parameter may throw
com.sun.jdi.VMDisconnectedException if the target VM is
disconnected and the com.sun.jdi.event.VMDisconnectEvent has been or is
available to be read from the com.sun.jdi.event.EventQueue .
Any method on ObjectReference
which directly or
indirectly takes ObjectReference
as an parameter may throw
com.sun.jdi.VMOutOfMemoryException if the target VM has run out of memory.
Any method on ObjectReference
or which directly or indirectly takes
ObjectReference
as parameter may throw
com.sun.jdi.ObjectCollectedException if the mirrored object has been
garbage collected.
Robert
- FieldGordon
- HirschJames
- McIlree1.3
- Field Summary | ||
---|---|---|
static final int | INVOKE_SINGLE_THREADED | Perform method invocation with only the invoking thread resumed |
static final int | INVOKE_NONVIRTUAL | Perform non-virtual method invocation |
Method from com.sun.jdi.ObjectReference Summary: |
---|
disableCollection, enableCollection, entryCount, equals, getValue, getValues, hashCode, invokeMethod, isCollected, owningThread, referenceType, referringObjects, setValue, uniqueID, waitingThreads |
Method from com.sun.jdi.ObjectReference Detail: |
---|
Calls to this method are counted. Every call to this method requires a corresponding call to #enableCollection before garbage collection is re-enabled. Note that while the target VM is suspended, no garbage collection will occur because all threads are suspended. The typical examination of variables, fields, and arrays during the suspension is safe without explicitly disabling garbage collection. This method should be used sparingly, as it alters the pattern of garbage collection in the target VM and, consequently, may result in application behavior under the debugger that differs from its non-debugged behavior. |
|
Not all target VMs support this operation. See VirtualMachine#canGetMonitorInfo to determine if the operation is supported. |
|
|
|
|
The method invocation will occur in the specified thread. Method invocation can occur only if the specified thread has been suspended by an event which occurred in that thread. Method invocation is not supported when the target VM has been suspended through VirtualMachine#suspend or when the specified thread is suspended through ThreadReference#suspend . The specified method is invoked with the arguments in the specified argument list. The method invocation is synchronous; this method does not return until the invoked method returns in the target VM. If the invoked method throws an exception, this method will throw an InvocationException which contains a mirror to the exception object thrown. Object arguments must be assignment compatible with the argument type (This implies that the argument type must be loaded through the enclosing class's class loader). Primitive arguments must be either assignment compatible with the argument type or must be convertible to the argument type without loss of information. If the method being called accepts a variable number of arguments, then the last argument type is an array of some component type. The argument in the matching position can be omitted, or can be null, an array of the same component type, or an argument of the component type followed by any number of other arguments of the same type. If the argument is omitted, then a 0 length array of the component type is passed. The component type can be a primitive type. Autoboxing is not supported. See section 5.2 of The Java™ Language Specification for more information on assignment compatibility.
By default, the method is invoked using dynamic lookup as
documented in section 15.12.4.4 of
The Java™ Language Specification
in particular, overriding based on the runtime type of the object
mirrored by this ObjectReference will occur. This
behavior can be changed by specifying the
#INVOKE_NONVIRTUAL bit flag in the By default, all threads in the target VM are resumed while the method is being invoked if they were previously suspended by an event or by VirtualMachine#suspend or ThreadReference#suspend . This is done to prevent the deadlocks that will occur if any of the threads own monitors that will be needed by the invoked method. Note, however, that this implicit resume acts exactly like ThreadReference#resume , so if the thread's suspend count is greater than 1, it will remain in a suspended state during the invocation and thus a deadlock could still occur. By default, when the invocation completes, all threads in the target VM are suspended, regardless their state before the invocation. It is possible that breakpoints or other events might occur during the invocation. This can cause deadlocks as described above. It can also cause a deadlock if invokeMethod is called from the client's event handler thread. In this case, this thread will be waiting for the invokeMethod to complete and won't read the EventSet that comes in for the new event. If this new EventSet is SUSPEND_ALL, then a deadlock will occur because no one will resume the EventSet. To avoid this, all EventRequests should be disabled before doing the invokeMethod, or the invokeMethod should not be done from the client's event handler thread.
The resumption of other threads during the invocation can be prevented
by specifying the #INVOKE_SINGLE_THREADED
bit flag in the If the target VM is disconnected during the invoke (for example, through VirtualMachine#dispose ) the method invocation continues. |
|
Not all target VMs support this operation. See VirtualMachine#canGetMonitorInfo to determine if the operation is supported. |
The ReferenceType of obj will mirror java.lang.String and not java.lang.Object. The type of an object never changes, so this method will always return the same ReferenceType over the lifetime of the mirrored object. The returned ReferenceType will be a ClassType or ArrayType and never an InterfaceType . |
Not all target virtual machines support this operation. Use VirtualMachine#canGetInstanceInfo() to determine if the operation is supported. |
Object values must be assignment compatible with the field type (This implies that the field type must be loaded through the enclosing class's class loader). Primitive values must be either assignment compatible with the field type or must be convertible to the field type without loss of information. See section 5.2 of The Java™ Language Specification for more information on assignment compatibility. |
|
Not all target VMs support this operation. See VirtualMachine#canGetMonitorInfo to determine if the operation is supported. |