Class BBjThreadProxy

java.lang.Object
org.dwcj.bbjplugins.thread.BBjThreadProxy

public final class BBjThreadProxy extends Object
BBjThreadProxy, the Java-side interface to the BBj Thread Plug-In
See Also:
  • Constructor Details

    • BBjThreadProxy

      public BBjThreadProxy(String className)
      Create a BBjThread class. You will typically pass a BBj class name in the form new BBjThreadProxy("::my/path/to/the/ThreadClass.bbj::ThreadClass") where ThreadClass extends BBjThread and implements the BBj side logic
      Parameters:
      className - : the BBj class name
  • Method Details

    • getBBjThreadInstance

      public Object getBBjThreadInstance()
      Allows direct access to the underlying class that extends BBjThread (This is probably most often not useful to the Java developer, only in some cases.)
      Returns:
      the instance of the BBjThread Object (BBj Object!)
    • setValue

      public void setValue(String key, Object value)
      Set a value to be prepared and/or exchanged with the background process
      Parameters:
      key - A String that serves as a key to the parameters map
      value - An Object to exchange
    • getValue

      public Object getValue(String key)
      Retrieve a value manipulated by the background thread
      Parameters:
      key - A String that serves as a key to the parameters map
      Returns:
      The object passed by the background thread
    • onFinished

      public void onFinished(Consumer<BBjThreadProxy> consumer)
      register an event callback that is executed as soon as the background thread finishes
      Parameters:
      consumer - The callback to notify
    • onUpdate

      public void onUpdate(Consumer<BBjThreadProxy> consumer)
      register an event callback that is executed whenever the background thread executes update()
      Parameters:
      consumer - The callback to notify
    • start

      public void start()
      Start the background thread.
    • kill

      public void kill()
      Kill the background thread
    • abort

      public void abort()
      Notify the background thread to terminate gracefully. The BBj background thread can use shouldAbort() to determine if the foreground process requested its termination by using the abort() method.