jdk/src/share/classes/com/sun/jdi/ObjectReference.java
author jbachorik
Tue, 29 Apr 2014 14:37:02 +0200
changeset 24127 5d05d4c0de7f
parent 24125 b85eeaae56c7
child 24195 705325a63a58
permissions -rw-r--r--
8042096: Backout JDK-8042091 Reviewed-by: sla
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
23010
6dadb192ad81 8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents: 20742
diff changeset
     2
 * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package com.sun.jdi;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.util.List;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.util.Map;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * An object that currently exists in the target VM. An ObjectReference
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * mirrors only the object itself and is not specific to any
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * {@link Field} or {@link LocalVariable} to which it is currently
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * assigned. An ObjectReference can
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * have 0 or more references from field(s) and/or variable(s).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * Any method on <code>ObjectReference</code> which directly or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * indirectly takes <code>ObjectReference</code> as an parameter may throw
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * {@link com.sun.jdi.VMDisconnectedException} if the target VM is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * disconnected and the {@link com.sun.jdi.event.VMDisconnectEvent} has been or is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * available to be read from the {@link com.sun.jdi.event.EventQueue}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * Any method on <code>ObjectReference</code> which directly or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * indirectly takes <code>ObjectReference</code> as an parameter may throw
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * {@link com.sun.jdi.VMOutOfMemoryException} if the target VM has run out of memory.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * Any method on <code>ObjectReference</code> or which directly or indirectly takes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * <code>ObjectReference</code> as parameter may throw
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * {@link com.sun.jdi.ObjectCollectedException} if the mirrored object has been
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * garbage collected.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * @author Robert Field
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * @author Gordon Hirsch
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * @author James McIlree
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * @since  1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 */
20742
4ae78e8060d6 8008662: Add @jdk.Exported to JDK-specific/exported APIs
alanb
parents: 14342
diff changeset
    58
@jdk.Exported
4ae78e8060d6 8008662: Add @jdk.Exported to JDK-specific/exported APIs
alanb
parents: 14342
diff changeset
    59
public interface ObjectReference extends Value {
4ae78e8060d6 8008662: Add @jdk.Exported to JDK-specific/exported APIs
alanb
parents: 14342
diff changeset
    60
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     * Gets the {@link ReferenceType} that mirrors the type
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     * of this object. The type may be a subclass or implementor of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     * declared type of any field or variable which currently holds it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     * For example, right after the following statement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     * <code>Object obj = new String("Hello, world!");</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     * The ReferenceType of obj will mirror java.lang.String and not
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * java.lang.Object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * The type of an object never changes, so this method will
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * always return the same ReferenceType over the lifetime of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     * mirrored object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     * The returned ReferenceType will be a {@link ClassType} or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     * {@link ArrayType} and never an {@link InterfaceType}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     * @return the {@link ReferenceType} for this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    ReferenceType referenceType();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     * Gets the value of a given instance or static field in this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * The Field must be valid for this ObjectReference;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * that is, it must be from
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * the mirrored object's class or a superclass of that class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * @param sig the field containing the requested value
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * @return the {@link Value} of the instance field.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * @throws java.lang.IllegalArgumentException if the field is not valid for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * this object's class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    Value getValue(Field sig);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * Gets the value of multiple instance and/or static fields in this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     * The Fields must be valid for this ObjectReference;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * that is, they must be from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * the mirrored object's class or a superclass of that class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * @param fields a list of {@link Field} objects containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * requested values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * @return a Map of the requested {@link Field} objects with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * their {@link Value}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * @throws java.lang.IllegalArgumentException if any field is not valid for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * this object's class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    Map<Field,Value> getValues(List<? extends Field> fields);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     * Sets the value of a given instance or static field in this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     * The {@link Field} must be valid for this ObjectReference; that is,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * it must be from the mirrored object's class or a superclass of that class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * If static, the field must not be final.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * Object values must be assignment compatible with the field type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * (This implies that the field type must be loaded through the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * enclosing class's class loader). Primitive values must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * either assignment compatible with the field type or must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * convertible to the field type without loss of information.
9266
121fb370f179 7032960: API files in java.awt need to be updated for references to JVM Spec with editions/hyperlinks
jjh
parents: 5506
diff changeset
   122
     * See section 5.2 of
121fb370f179 7032960: API files in java.awt need to be updated for references to JVM Spec with editions/hyperlinks
jjh
parents: 5506
diff changeset
   123
     * <cite>The Java&trade; Language Specification</cite>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * for more information on assignment
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * compatibility.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * @param field the field containing the requested value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     * @param value the new value to assign
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * @throws java.lang.IllegalArgumentException if the field is not valid for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * this object's class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * @throws InvalidTypeException if the value's type does not match
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * the field's type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * @throws ClassNotLoadedException if 'value' is not null, and the field
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * type has not yet been loaded through the appropriate class loader.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * @throws VMCannotBeModifiedException if the VirtualMachine is read-only - see {@link VirtualMachine#canBeModified()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    void setValue(Field field, Value value)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        throws InvalidTypeException, ClassNotLoadedException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    /** Perform method invocation with only the invoking thread resumed */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    static final int INVOKE_SINGLE_THREADED = 0x1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    /** Perform non-virtual method invocation */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    static final int INVOKE_NONVIRTUAL      = 0x2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * Invokes the specified {@link Method} on this object in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * target VM. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * specified method can be defined in this object's class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * in a superclass of this object's class, or in an interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * implemented by this object. The method may be a static method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * or an instance method, but not a static initializer or constructor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * Use {@link ClassType#newInstance} to create a new object and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * run its constructor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * The method invocation will occur in the specified thread.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * Method invocation can occur only if the specified thread
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * has been suspended by an event which occurred in that thread.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * Method invocation is not supported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * when the target VM has been suspended through
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * {@link VirtualMachine#suspend} or when the specified thread
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * is suspended through {@link ThreadReference#suspend}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * The specified method is invoked with the arguments in the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * argument list.  The method invocation is synchronous; this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     * does not return until the invoked method returns in the target VM.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * If the invoked method throws an exception, this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     * will throw an {@link InvocationException} which contains
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     * a mirror to the exception object thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * Object arguments must be assignment compatible with the argument type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * (This implies that the argument type must be loaded through the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * enclosing class's class loader). Primitive arguments must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     * either assignment compatible with the argument type or must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * convertible to the argument type without loss of information.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * If the method being called accepts a variable number of arguments,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     * then the last argument type is an array of some component type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     * The argument in the matching position can be omitted, or can be null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * an array of the same component type, or an argument of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * component type followed by any number of other arguments of the same
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * type. If the argument is omitted, then a 0 length array of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * component type is passed.  The component type can be a primitive type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     * Autoboxing is not supported.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     *
9266
121fb370f179 7032960: API files in java.awt need to be updated for references to JVM Spec with editions/hyperlinks
jjh
parents: 5506
diff changeset
   184
     * See section 5.2 of
121fb370f179 7032960: API files in java.awt need to be updated for references to JVM Spec with editions/hyperlinks
jjh
parents: 5506
diff changeset
   185
     * <cite>The Java&trade; Language Specification</cite>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     * for more information on assignment compatibility.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * By default, the method is invoked using dynamic lookup as
9266
121fb370f179 7032960: API files in java.awt need to be updated for references to JVM Spec with editions/hyperlinks
jjh
parents: 5506
diff changeset
   189
     * documented in section 15.12.4.4 of
121fb370f179 7032960: API files in java.awt need to be updated for references to JVM Spec with editions/hyperlinks
jjh
parents: 5506
diff changeset
   190
     * <cite>The Java&trade; Language Specification</cite>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     * in particular, overriding based on the runtime type of the object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * mirrored by this {@link ObjectReference} will occur. This
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * behavior can be changed by specifying the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * {@link #INVOKE_NONVIRTUAL} bit flag in the <code>options</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     * argument. If this flag is set, the specified method is invoked
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * whether or not it is overridden for this object's runtime type.
24127
5d05d4c0de7f 8042096: Backout JDK-8042091
jbachorik
parents: 24125
diff changeset
   197
     * The method, in this case, must not belong to an interface and
5d05d4c0de7f 8042096: Backout JDK-8042091
jbachorik
parents: 24125
diff changeset
   198
     * must not be abstract. This option is useful for performing method
5d05d4c0de7f 8042096: Backout JDK-8042091
jbachorik
parents: 24125
diff changeset
   199
     * invocations like those done with the <code>super</code> keyword in
5d05d4c0de7f 8042096: Backout JDK-8042091
jbachorik
parents: 24125
diff changeset
   200
     * the Java programming language.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * By default, all threads in the target VM are resumed while
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * the method is being invoked if they were previously
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     * suspended by an event or by {@link VirtualMachine#suspend} or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     * {@link ThreadReference#suspend}. This is done to prevent the deadlocks
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     * that will occur if any of the threads own monitors
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * that will be needed by the invoked method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * Note, however, that this implicit resume acts exactly like
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * {@link ThreadReference#resume}, so if the thread's suspend
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * count is greater than 1, it will remain in a suspended state
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     * during the invocation and thus a deadlock could still occur.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * By default, when the invocation completes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     * all threads in the target VM are suspended, regardless their state
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * before the invocation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * It is possible that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * breakpoints or other events might occur during the invocation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     * This can cause deadlocks as described above. It can also cause a deadlock
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     * if invokeMethod is called from the client's event handler thread.  In this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     * case, this thread will be waiting for the invokeMethod to complete and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     * won't read the EventSet that comes in for the new event.  If this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     * new EventSet is SUSPEND_ALL, then a deadlock will occur because no
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * one will resume the EventSet.  To avoid this, all EventRequests should
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     * be disabled before doing the invokeMethod, or the invokeMethod should
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * not be done from the client's event handler thread.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     * The resumption of other threads during the invocation can be prevented
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     * by specifying the {@link #INVOKE_SINGLE_THREADED}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
     * bit flag in the <code>options</code> argument; however,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     * there is no protection against or recovery from the deadlocks
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     * described above, so this option should be used with great caution.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     * Only the specified thread will be resumed (as described for all
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     * threads above). Upon completion of a single threaded invoke, the invoking thread
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
     * will be suspended once again. Note that any threads started during
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * the single threaded invocation will not be suspended when the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     * invocation completes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     * If the target VM is disconnected during the invoke (for example, through
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     * {@link VirtualMachine#dispose}) the method invocation continues.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     * @param thread the thread in which to invoke.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     * @param method the {@link Method} to invoke.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     * @param arguments the list of {@link Value} arguments bound to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     * invoked method. Values from the list are assigned to arguments
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     * in the order they appear in the method signature.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     * @param options the integer bit flag options.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     * @return a {@link Value} mirror of the invoked method's return value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     * @throws java.lang.IllegalArgumentException if the method is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     * a member of this object's class, if the size of the argument list
24127
5d05d4c0de7f 8042096: Backout JDK-8042091
jbachorik
parents: 24125
diff changeset
   249
     * does not match the number of declared arguemnts for the method,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
     * if the method is a constructor or static intializer, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     * if {@link #INVOKE_NONVIRTUAL} is specified and the method is
24127
5d05d4c0de7f 8042096: Backout JDK-8042091
jbachorik
parents: 24125
diff changeset
   252
     * either abstract or an interface member.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     * @throws {@link InvalidTypeException} if any argument in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     * argument list is not assignable to the corresponding method argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     * type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * @throws ClassNotLoadedException if any argument type has not yet been loaded
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     * through the appropriate class loader.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     * @throws IncompatibleThreadStateException if the specified thread has not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     * been suspended by an event.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     * @throws InvocationException if the method invocation resulted in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     * an exception in the target VM.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     * @throws InvalidTypeException If the arguments do not meet this requirement --
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     *         Object arguments must be assignment compatible with the argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     *         type.  This implies that the argument type must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     *         loaded through the enclosing class's class loader.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     *         Primitive arguments must be either assignment compatible with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     *         argument type or must be convertible to the argument type without loss
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     *         of information. See JLS section 5.2 for more information on assignment
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     *         compatibility.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     * @throws VMCannotBeModifiedException if the VirtualMachine is read-only - see {@link VirtualMachine#canBeModified()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
    Value invokeMethod(ThreadReference thread, Method method,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
                       List<? extends Value> arguments, int options)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
                                   throws InvalidTypeException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
                                          ClassNotLoadedException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
                                          IncompatibleThreadStateException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
                                          InvocationException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     * Prevents garbage collection for this object. By default all
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     * {@link ObjectReference} values returned by JDI may be collected
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
     * at any time the target VM is running. A call to this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
     * guarantees that the object will not be collected.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
     * {@link #enableCollection} can be used to allow collection once
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     * again.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
     * Calls to this method are counted. Every call to this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     * requires a corresponding call to {@link #enableCollection} before
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     * garbage collection is re-enabled.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     * Note that while the target VM is suspended, no garbage collection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     * will occur because all threads are suspended. The typical
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     * examination of variables, fields, and arrays during the suspension
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     * is safe without explicitly disabling garbage collection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
     * This method should be used sparingly, as it alters the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     * pattern of garbage collection in the target VM and,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
     * consequently, may result in application behavior under the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     * debugger that differs from its non-debugged behavior.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     * @throws VMCannotBeModifiedException if the VirtualMachine is read-only
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     * -see {@link VirtualMachine#canBeModified()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
    void disableCollection();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     * Permits garbage collection for this object. By default all
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     * {@link ObjectReference} values returned by JDI may be collected
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     * at any time the target VM is running. A call to this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     * is necessary only if garbage collection was previously disabled
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
     * with {@link #disableCollection}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
     * @throws VMCannotBeModifiedException if the VirtualMachine is read-only
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     * -see {@link VirtualMachine#canBeModified()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
    void enableCollection();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
     * Determines if this object has been garbage collected in the target
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
     * VM.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
     * @return <code>true</code> if this {@link ObjectReference} has been collected;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
     * <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
     * @throws VMCannotBeModifiedException if the VirtualMachine is read-only
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     * -see {@link VirtualMachine#canBeModified()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
    boolean isCollected();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     * Returns a unique identifier for this ObjectReference.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     * It is guaranteed to be unique among all
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     * ObjectReferences from the same VM that have not yet been disposed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     * The guarantee applies as long
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     * as this ObjectReference has not yet been disposed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     * @return a long unique ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
    long uniqueID();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
     * Returns a List containing a {@link ThreadReference} for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
     * each thread currently waiting for this object's monitor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
     * See {@link ThreadReference#currentContendedMonitor} for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
     * information about when a thread is considered to be waiting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
     * for a monitor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
     * Not all target VMs support this operation. See
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
     * VirtualMachine#canGetMonitorInfo to determine if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
     * operation is supported.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
     * @return a List of {@link ThreadReference} objects. The list
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
     * has zero length if no threads are waiting for the monitor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
     * @throws java.lang.UnsupportedOperationException if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
     * target VM does not support this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
     * @throws IncompatibleThreadStateException if any
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     * waiting thread is not suspended
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
     * in the target VM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
    List<ThreadReference> waitingThreads()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
        throws IncompatibleThreadStateException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
     * Returns an {@link ThreadReference} for the thread, if any,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
     * which currently owns this object's monitor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     * See {@link ThreadReference#ownedMonitors} for a definition
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     * of ownership.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     * Not all target VMs support this operation. See
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     * VirtualMachine#canGetMonitorInfo to determine if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     * operation is supported.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
     * @return the {@link ThreadReference} which currently owns the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
     * monitor, or null if it is unowned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
     * @throws java.lang.UnsupportedOperationException if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
     * target VM does not support this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     * @throws IncompatibleThreadStateException if the owning thread is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     * not suspended in the target VM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
    ThreadReference owningThread() throws IncompatibleThreadStateException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
     * Returns the number times this object's monitor has been
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
     * entered by the current owning thread.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
     * See {@link ThreadReference#ownedMonitors} for a definition
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
     * of ownership.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
     * Not all target VMs support this operation. See
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
     * VirtualMachine#canGetMonitorInfo to determine if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
     * operation is supported.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
     * @see #owningThread
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
     * @return the integer count of the number of entries.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
     * @throws java.lang.UnsupportedOperationException if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     * target VM does not support this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     * @throws IncompatibleThreadStateException if the owning thread is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
     * not suspended in the target VM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
    int entryCount() throws IncompatibleThreadStateException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     * Returns objects that directly reference this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
     * Only objects that are reachable for the purposes of garbage collection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
     * are returned.  Note that an object can also be referenced in other ways,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
     * such as from a local variable in a stack frame, or from a JNI global
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
     * reference.  Such non-object referrers are not returned by this method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
     * Not all target virtual machines support this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
     * Use {@link VirtualMachine#canGetInstanceInfo()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
     * to determine if the operation is supported.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
     * @see VirtualMachine#instanceCounts(List)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
     * @see ReferenceType#instances(long)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     * @param maxReferrers  The maximum number of referring objects to return.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     *                      Must be non-negative.  If zero, all referring
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
     *                      objects are returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
     * @return a of List of {@link ObjectReference} objects. If there are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
     *  no objects that reference this object, a zero-length list is returned..
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
     * @throws java.lang.UnsupportedOperationException if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     * the target virtual machine does not support this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     * operation - see
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
     * {@link VirtualMachine#canGetInstanceInfo() canGetInstanceInfo()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     * @throws java.lang.IllegalArgumentException if maxReferrers is less
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     *         than zero.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
    List<ObjectReference> referringObjects(long maxReferrers);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     * Compares the specified Object with this ObjectReference for equality.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
     * @return  true if the Object is an ObjectReference, if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     * ObjectReferences belong to the same VM, and if applying the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     * "==" operator on the mirrored objects in that VM evaluates to true.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
    boolean equals(Object obj);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
     * Returns the hash code value for this ObjectReference.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
     * @return the integer hash code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
    int hashCode();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
}