Module openj9.dtfj

Class J9DDRDTFJUtils


  • public class J9DDRDTFJUtils
    extends Object
    • Constructor Detail

      • J9DDRDTFJUtils

        public J9DDRDTFJUtils()
    • Method Detail

      • emptyIterator

        public static Iterator emptyIterator()
      • corruptIterator

        public static Iterator corruptIterator​(CorruptData data)
        Return an iterator which contains a single corrupt data item
        Parameters:
        data -
        Returns:
      • newCorruptData

        public static J9DDRCorruptData newCorruptData​(IProcess process,
                                                      CorruptDataException e)
        Create a j9ddr corrupt data
        Parameters:
        process - the process from the dtfj context
        e - a DTFJ CDE
        Returns:
        a j9ddr corrupt data
      • newCorruptData

        public static J9DDRCorruptData newCorruptData​(IProcess process)
        Create a j9ddr corrupt data
        Parameters:
        process - the process from the dtfj context
        Returns:
        a j9ddr corrupt data
      • newCorruptData

        public static J9DDRCorruptData newCorruptData​(IProcess process,
                                                      String message)
        Create a j9ddr corrupt data
        Parameters:
        process - the process from the dtfj context
        message - message
        Returns:
        a j9ddr corrupt data
      • newCorruptDataException

        public static CorruptDataException newCorruptDataException​(IProcess process,
                                                                   CorruptDataException e)
        Convert a j9ddr corrupt data exception into a DTFJ corrupt data exception
        Parameters:
        process - the process from the dtfj context
        e - the j9ddr CDE
        Returns:
        a DTFJ CDE
      • handleAllButDataUnavailAsCorruptDataException

        public static CorruptDataException handleAllButDataUnavailAsCorruptDataException​(IProcess p,
                                                                                         Throwable t)
                                                                                  throws DataUnavailable
        Go through the standard handleAsCorruptDataException method to convert the supplied error condition into a corrupt data exception as long as it is not present in the allow list AND especially for this method, if it is not a DataUnavailable. The allow list is a set of run time exceptions which must not be intercepted and must be re-thrown. Typically this is where the DTFJ API allows RTE's to be thrown as well as checked exceptions. Likewise, DataUnavailable is an exception that must be re-thrown and not converted to CorruptDataException, hence this method's distinctive name.
        Parameters:
        p - the process from the dtfj context
        t - the error condition to handle
        Returns:
        the error condition expressed as a CDE
        Throws:
        DataUnavailable
      • handleAllButMemAccExAsCorruptDataException

        public static CorruptDataException handleAllButMemAccExAsCorruptDataException​(IProcess p,
                                                                                      Throwable t,
                                                                                      Class<?>[] allowlist)
                                                                               throws MemoryAccessException
        Go through the standard handleAsCorruptDataException method to convert the supplied error condition into a corrupt data exception as long as it is not present in the allow list AND especially for this method, if it is not a MemoryAccessException. The allow list is a set of run time exceptions which must not be intercepted and must be re-thrown. Typically this is where the DTFJ API allows RTE's to be thrown as well as checked exceptions. Likewise, MemoryAccessException is an exception that must be re-thrown and not converted to CorruptDataException, hence this method's distinctive name.
        Parameters:
        p - the process from the dtfj context
        t - the error condition to handle
        allowlist - runtime exceptions which should be ignored and re-thrown
        Returns:
        the error condition expressed as a CDE
        Throws:
        MemoryAccessException
      • handleAllButMemAccExAndDataUnavailAsCorruptDataException

        public static CorruptDataException handleAllButMemAccExAndDataUnavailAsCorruptDataException​(IProcess p,
                                                                                                    Throwable t,
                                                                                                    Class<?>[] allowlist)
                                                                                             throws MemoryAccessException,
                                                                                                    DataUnavailable
        Go through the standard handleAsCorruptDataException method to convert the supplied error condition into a corrupt data exception as long as it is not present in the allow list AND especially for this method, if it is neither MemoryAccessException or DataUnavailable. The allow list is a set of run time exceptions which must not be intercepted and must be re-thrown. Typically this is where the DTFJ API allows RTE's to be thrown as well as checked exceptions. Likewise, MemoryAccessException and DataUnavailable are exceptions that must be re-thrown and not converted to CorruptDataException, hence this method's distinctive name.
        Parameters:
        p - the process from the dtfj context
        t - the error condition to handle
        allowlist - runtime exceptions which should be ignored and re-thrown
        Returns:
        the error condition expressed as a CDE
        Throws:
        MemoryAccessException
        DataUnavailable
      • handleAsCorruptDataException

        public static CorruptDataException handleAsCorruptDataException​(IProcess p,
                                                                        Throwable t,
                                                                        Class<?>[] allowlist)
        Go through the standard handleAsCorruptDataException method to convert the supplied error condition into a corrupt data exception as long as it is not present in the allow list. The allow list is a set of run time exceptions which must not be intercepted and must be re-thrown. Typically this is where the DTFJ API allows RTE's to be thrown as well as checked exceptions.
        Parameters:
        p - the process from the dtfj context
        t - the error condition to handle
        allowlist - runtime exceptions which should be ignored and re-thrown
        Returns:
        the error condition expressed as a CDE
      • handleAsCorruptDataException

        public static CorruptDataException handleAsCorruptDataException​(IProcess p,
                                                                        Throwable t)
        Convert the supplied error condition into a corrupt data exception or re-throw it if it is an instance of Error that we do not want to intercept.
        Parameters:
        p - the process from the DTFJ context
        t - error condition to convert
        Returns:
        CorruptDataException
      • handleAsCorruptData

        public static CorruptData handleAsCorruptData​(IProcess p,
                                                      Throwable t)
        Convert the supplied error condition into a CorruptData object and return it, typically for insertion into an iterator, or re-throw it if it is an instance of Error that we do not want to intercept.
        Parameters:
        p - the process from the dtfj context
        t - the error condition to handle
        Returns:
        the error expressed as corrupt data
      • handleAsDataUnavailable

        public static DataUnavailable handleAsDataUnavailable​(Throwable t)
        Handle the supplied error condition and ultimately surface it as a data unavailable exception. This is required as not all API calls allow a CorruptDataException to be thrown
        Parameters:
        t - error condition to handle
        Throws:
        CorruptDataException - ultimately throw an CDE