de.esprit.appsuite.util

## Class AppUtil

- java.lang.Object
- - de.esprit.appsuite.util.AppUtil

-     public final class AppUtil
      extends java.lang.Object

  This class contains useful utility methods which depend on the existence of an `ApplicationContext`.
  Author:
    Rainer Buesch

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <A extends ApplicationContext> A` | `getDefaultContext()` Returns the `ApplicationContext` instance that was set by `setDefaultContext(ApplicationContext)`.
    `static void` | `invokeAndWait(ApplicationContext ctx, java.lang.Runnable r)` A version of invokeAndWait that distinguishes between GUI and non-GUI clients.
    `static void` | `invokeLater(ApplicationContext ctx, java.lang.Runnable r)` A version of invokeLater that distinguishes between GUI and non GUI clients.
    `static void` | `logDebug(java.lang.Object caller, java.lang.String msg)`
    `static void` | `logDump(java.lang.Object caller, java.lang.String msg)`
    `static void` | `logError(java.lang.Object caller, java.lang.Exception e)`
    `static void` | `logError(java.lang.Object caller, java.lang.String msg)`
    `static void` | `logError(java.lang.Object caller, java.lang.String msg, java.lang.Exception e)`
    `static void` | `logInfo(java.lang.Object caller, java.lang.String msg)`
    `static void` | `logVerbose(java.lang.Object caller, java.lang.String msg)`
    `static void` | `logWarning(java.lang.Object caller, java.lang.String msg)`
    `static void` | `runBlockingInET(RunnableAdapter r)` This method executes the given `RunnableAdapter` in the EventDispatcherThread and raises any thrown Exception to the caller.
    `static void` | `setDefaultContext(ApplicationContext ctx)` Sets a default context.
    `static void` | `setDefaultLogLevel(LogLevel level)` Sets the default log `LogLevel` that is used by the logging methods used defined in this class.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### setDefaultContext

          public static void setDefaultContext(ApplicationContext ctx)

      Sets a default context. If set, this context provides the default LogChannel. Note that this method is called automatically on construction of a `ApplicationContext` instance.

    - #### getDefaultContext

          public static <A extends ApplicationContext> A getDefaultContext()

      Returns the `ApplicationContext` instance that was set by `setDefaultContext(ApplicationContext)`.
      Returns:
        the default context if set, null otherwise.

    - #### invokeLater

          public static void invokeLater(ApplicationContext ctx,
                         java.lang.Runnable r)

      A version of invokeLater that distinguishes between GUI and non GUI clients. If the client has no GUI the Runnable is executed directly in the current thread.

    - #### invokeAndWait

          public static void invokeAndWait(ApplicationContext ctx,
                           java.lang.Runnable r)

      A version of invokeAndWait that distinguishes between GUI and non-GUI clients. If the client has no GUI the Runnable is executed directly in the current thread.

    - #### runBlockingInET

          public static void runBlockingInET(RunnableAdapter r)
                                      throws java.lang.Exception

      This method executes the given `RunnableAdapter` in the EventDispatcherThread and raises any thrown Exception to the caller.
      Throws:
        `java.lang.Exception`

    - #### setDefaultLogLevel

          public static void setDefaultLogLevel(LogLevel level)

      Sets the default log `LogLevel` that is used by the logging methods used defined in this class.

    - #### logError

          public static void logError(java.lang.Object caller,
                      java.lang.String msg)

    - #### logError

          public static void logError(java.lang.Object caller,
                      java.lang.Exception e)

    - #### logError

          public static void logError(java.lang.Object caller,
                      java.lang.String msg,
                      java.lang.Exception e)

    - #### logWarning

          public static void logWarning(java.lang.Object caller,
                        java.lang.String msg)

    - #### logVerbose

          public static void logVerbose(java.lang.Object caller,
                        java.lang.String msg)

    - #### logInfo

          public static void logInfo(java.lang.Object caller,
                     java.lang.String msg)

    - #### logDebug

          public static void logDebug(java.lang.Object caller,
                      java.lang.String msg)

    - #### logDump

          public static void logDump(java.lang.Object caller,
                     java.lang.String msg)

Copyright © 2014 EsprIT-Systems. All Rights Reserved.