Class OA2ServletUtils


  • public class OA2ServletUtils
    extends Object
    Utilities for various servlets. These handle the exceptions from the script runtime engine and perform a full rollback. These are messy, but unavoidable.

    Created by Jeff Gaynor
    on 4/26/22 at 6:52 AM

    • Field Detail

      • stackTraceMaxLines

        public static int stackTraceMaxLines
    • Constructor Detail

      • OA2ServletUtils

        public OA2ServletUtils()
    • Method Detail

      • handleScriptEngineException

        public static void handleScriptEngineException​(Object callingObject,
                                                       OA2SE oa2SE,
                                                       Throwable t,
                                                       edu.uiuc.ncsa.security.core.util.MetaDebugUtil debugger,
                                                       OA2ServiceTransaction transaction,
                                                       edu.uiuc.ncsa.security.storage.XMLMap tBackup)
      • handleScriptEngineException

        public static void handleScriptEngineException​(Object callingObject,
                                                       OA2SE oa2SE,
                                                       Throwable exception,
                                                       edu.uiuc.ncsa.security.core.util.MetaDebugUtil debugger,
                                                       OA2ServiceTransaction transaction,
                                                       edu.uiuc.ncsa.security.storage.XMLMap tBackup,
                                                       TXRecord txRecord)
        Parameters:
        callingObject -
        oa2SE -
        exception -
        debugger -
        transaction -
        tBackup -
        txRecord -
      • rollback

        protected static void rollback​(OA2SE oa2SE,
                                       edu.uiuc.ncsa.security.storage.XMLMap backup,
                                       TXRecord txRecord)
      • truncateStackTrace

        public static String truncateStackTrace​(Throwable e,
                                                int n,
                                                boolean printIt)
        Take a stack trace and print the first n lines of it.
        Parameters:
        e -
        n -
        Returns:
        the truncated stack trace
      • truncateStackTrace2

        protected static String truncateStackTrace2​(Throwable e,
                                                    int n,
                                                    boolean printIt)
      • ppξ

        protected static void ppξ​(Throwable throwable,
                                  Object callingObject,
                                  OA2SE oa2SE,
                                  edu.uiuc.ncsa.security.core.util.MetaDebugUtil debugger,
                                  String message)
        Pretty print the exception. This decides what to print and shortens the stack trace.
        Parameters:
        throwable -
        callingObject -
        debugger -
        message -