@startuml
package com.iluwatar.async.method.invocation {
  class App {
    - LOGGER : Logger {static}
    + App()
    - callback(name : String) : AsyncCallback<T> {static}
    - lazyval(value : T, delayMillis : long) : Callable<T> {static}
    - log(msg : String) {static}
    + main(args : String[]) {static}
  }
  interface AsyncCallback<T> {
    + onComplete(T) {abstract}
    + onError(Exception) {abstract}
  }
  interface AsyncExecutor {
    + endProcess(AsyncResult<T>) : T {abstract}
    + startProcess(Callable<T>) : AsyncResult<T> {abstract}
    + startProcess(Callable<T>, AsyncCallback<T>) : AsyncResult<T> {abstract}
  }
  interface AsyncResult<T> {
    + await() {abstract}
    + getValue() : T {abstract}
    + isCompleted() : boolean {abstract}
  }
  class ThreadAsyncExecutor {
    - idx : AtomicInteger
    + ThreadAsyncExecutor()
    + endProcess(asyncResult : AsyncResult<T>) : T
    + startProcess(task : Callable<T>) : AsyncResult<T>
    + startProcess(task : Callable<T>, callback : AsyncCallback<T>) : AsyncResult<T>
  }
  -class CompletableResult<T> {
    ~ COMPLETED : int {static}
    ~ FAILED : int {static}
    ~ RUNNING : int {static}
    ~ callback : AsyncCallback<T>
    ~ exception : Exception
    ~ lock : Object
    ~ state : int
    ~ value : T
    ~ CompletableResult<T>(callback : AsyncCallback<T>)
    + await()
    + getValue() : T
    ~ hasCallback() : boolean
    + isCompleted() : boolean
    ~ setException(exception : Exception)
    ~ setValue(value : T)
  }
}
ThreadAsyncExecutor ..|> AsyncCallback
ThreadAsyncExecutor ..|> AsyncResult
ThreadAsyncExecutor ..|> AsyncExecutor
CompletableResult ..+ ThreadAsyncExecutor
CompletableResult ..|> AsyncResult
@enduml
