Class MethodState

  • All Implemented Interfaces:
    java.io.Serializable

    public final class MethodState
    extends java.lang.Object
    implements java.io.Serializable
    Do not use -- for internal use only.

    Holds on to the state of a method frame.

    See Also:
    Serialized Form
    • Field Detail

      • className

        private final java.lang.String className
      • methodId

        private final int methodId
      • continuationPoint

        private final int continuationPoint
      • data

        private final java.lang.Object[] data
      • lockState

        private final LockState lockState
    • Constructor Detail

      • MethodState

        public MethodState​(java.lang.String className,
                           int methodId,
                           int continuationPoint,
                           java.lang.Object[] data,
                           LockState lockState)
        Do not use -- for internal use only.

        Constructs a MethodState object.

        Parameters:
        className - name of owner (class) for method at which state was saved
        methodId - identifier for method at which state was saved
        continuationPoint - point in the method at which state was saved (does not refer to offset, just an id that's generated by the instrumenter to mark that point)
        data - locals and operand stack at the point which state was saved
        lockState - monitors entered at the point which state was saved (may be null)
    • Method Detail

      • getClassName

        public java.lang.String getClassName()
        Do not use -- for internal use only.

        Get name of owner (class) for method at which state was saved

        Returns:
        name of owner (class) for method at which state was saved
      • getMethodId

        public int getMethodId()
        Do not use -- for internal use only.

        Get identifier of method for which state was saved

        Returns:
        ID of method for which state was saved
      • getContinuationPoint

        public int getContinuationPoint()
        Do not use -- for internal use only.

        Get the point in the code at which state was saved (does not refer to offset, just an id that's generated by the instrumenter to mark that point)

        Returns:
        point in the code at which state was saved
      • getData

        public java.lang.Object[] getData()
        Do not use -- for internal use only.

        Get locals and operand stack at the point which state was saved.

        Returns:
        locals and operand stack at the point which state was saved
      • getLockState

        public LockState getLockState()
        Do not use -- for internal use only.

        Get the monitors entered at the point which state was saved.

        Returns:
        monitors entered at the point which state was saved
      • getNext

        MethodState getNext()
        Do not use -- for internal use only.

        Get the next method state.

        Returns:
        next method state
      • setNext

        void setNext​(MethodState next)
        Do not use -- for internal use only.

        Set the next method state.

        Parameters:
        next - next method state
      • getPrevious

        MethodState getPrevious()
        Do not use -- for internal use only.

        Get the previous method state.

        Returns:
        previous method state
      • setPrevious

        void setPrevious​(MethodState previous)
        Do not use -- for internal use only.

        Set the previous method state.

        Parameters:
        previous - previous method state
      • isValid

        public static boolean isValid​(java.lang.ClassLoader classLoader,
                                      java.lang.String className,
                                      int methodId,
                                      int continuationPointId)
        Do not use -- for internal use only.

        Determine if this method state is valid. Valid means that the method that this method state is for exists and the method is the correct version for this method state.

        Parameters:
        classLoader - class loader to use to look for the class (null will attempt to use this Object's classloader / the thread's context class loader)
        className - class name
        methodId - method id
        continuationPointId - continuation point id
        Returns:
        true if method for this method state exists and is of the correct version, false otherwise
        Throws:
        java.lang.NullPointerException - if className is null
        java.lang.IllegalArgumentException - if continuationPointId < 0
      • getIdentifyingFieldName

        public static java.lang.String getIdentifyingFieldName​(int methodId,
                                                               int continuationPointId)
        Do not use -- for internal use only.

        Get the name of the field that will be inserted into a class for some method id and version combination.

        Parameters:
        methodId - method id
        continuationPointId - continuation point id
        Returns:
        field name
        Throws:
        java.lang.IllegalArgumentException - if continuationPointId < 0