de.esprit.appsuite.launch

## Class AsyncInitializableObject<C extends ApplicationContext>

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.appsuite.launch.AbstractApplicationObject<C>
    - - de.esprit.appsuite.launch.AbstractInitializableObject<C>
      - - de.esprit.appsuite.launch.AsyncInitializableObject<C>

- All Implemented Interfaces:
    ApplicationObject<C>, AsyncInitializable, Initializable, SimpleLogSupport, Dumpable
  Direct Known Subclasses:
    JavaVersionManager

      public abstract class AsyncInitializableObject<C extends ApplicationContext>
      extends AbstractInitializableObject<C>
      implements AsyncInitializable

  This class maintains an isInitializingRef flag and provides methods for checking whether initialization yet has been done.
  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AsyncInitializableObject(C ctx)`
    `AsyncInitializableObject(C ctx, LogChannel logCh)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `awaitInitialized()` Awaits the async initialization to finish.
    `void` | `checkInitialized()` Checks whether initialization has yet been done and throws an `NotInitializedException` if not.
    `protected AsyncTask` | `createInitTask()`
    `AsyncTask` | `initAsyc()` Returns a yet unsubmitted task that will call `Initializable.init()` asynchronously.
    `protected void` | `setInitialized()`

    - ### Methods inherited from class de.esprit.appsuite.launch.AbstractInitializableObject

      `init, isInitialized`

    - ### Methods inherited from class de.esprit.appsuite.launch.AbstractApplicationObject

      `getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel`

    - ### Methods inherited from class de.esprit.common.util.DumpableObject

      `configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString, toString`

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

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

    - ### Methods inherited from interface de.esprit.appsuite.launch.Initializable

      `init, isInitialized`

- - ### Constructor Detail

    - #### AsyncInitializableObject

          public AsyncInitializableObject(C ctx)

    - #### AsyncInitializableObject

          public AsyncInitializableObject(C ctx,
                                  LogChannel logCh)

  - ### Method Detail

    - #### setInitialized

          protected final void setInitialized()

      Overrides:
        `setInitialized` in class `AbstractInitializableObject<C extends ApplicationContext>`

    - #### checkInitialized

          public final void checkInitialized()

      Description copied from interface: `Initializable`
      Checks whether initialization has yet been done and throws an `NotInitializedException` if not.
      Specified by:
        `checkInitialized` in interface `Initializable`
      Overrides:
        `checkInitialized` in class `AbstractInitializableObject<C extends ApplicationContext>`

    - #### awaitInitialized

          public void awaitInitialized()
                                throws java.lang.InterruptedException

      Description copied from interface: `AsyncInitializable`
      Awaits the async initialization to finish.
      Specified by:
        `awaitInitialized` in interface `AsyncInitializable`
      Throws:
        `java.lang.InterruptedException`

    - #### initAsyc

          public AsyncTask initAsyc()
                             throws java.lang.Exception

      Description copied from interface: `AsyncInitializable`
      Returns a yet unsubmitted task that will call `Initializable.init()` asynchronously. The caller may do something else meanwhile and at a later time call `AsyncInitializable.awaitInitialized()` in order to wait on the initialization to finish.
      Specified by:
        `initAsyc` in interface `AsyncInitializable`
      Throws:
        `java.lang.Exception`

    - #### createInitTask

          protected AsyncTask createInitTask()

Copyright © 2014 EsprIT-Systems. All Rights Reserved.