Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

oracle.adfnmc.util.async
Class BackgroundWorker

java.lang.Object
  extended by oracle.adfnmc.util.async.BackgroundWorker
All Implemented Interfaces:
java.lang.Runnable

public class BackgroundWorker
extends java.lang.Object
implements java.lang.Runnable

Implements a background worker thread which executes tasks asynchronously. Users can enqueue work items to be run on a dedicated network thread, a general purpose background thread, or on the UI thread.

Author:
PARACHAN

Nested Class Summary
static class BackgroundWorker.RunnableWithParams
          This class acts as an adaptor to go from Backgroundable to Runnable
 
Field Summary
static java.lang.String BACKGROUND_INSTANCE_NAME
           
static java.lang.String NAVIGATION_INSTANCE_NAME
           
static java.lang.String NETWORK_INSTANCE_NAME
           
static java.lang.String UI_INSTANCE_NAME
           
static java.lang.String UI_SYNC_INSTANCE_NAME
           
 
Method Summary
static java.lang.Thread getNavigationThread()
           
static int nQBackground(Backgroundable work, java.lang.Object[] params)
          Enqueue a work item to be run at some later time on the dedicated general processing thread
static int nQNavigation(Backgroundable work, java.lang.Object[] params)
          Enqueue a work item to be run at some later time on the dedicated navigation processing thread
static int nQNetwork(Backgroundable work, java.lang.Object[] params)
          Enqueue a work item to be run at some later time on the dedicated network processing thread
static int nQOrRunDirectlyBackground(Backgroundable work, java.lang.Object[] params)
          Enqueue a work item to be run on the dedicated general processing thread
static int nQOrRunDirectlyNavigation(Backgroundable work, java.lang.Object[] params)
          Enqueue a work item to be run on the dedicated navigation processing thread
static int nQOrRunDirectlyNetwork(Backgroundable work, java.lang.Object[] params)
          Enqueue a work item to be run on the dedicated network processing thread
static int nQOrRunDirectlySyncUI(Backgroundable work, java.lang.Object[] params)
           
static int nQOrRunDirectlyUI(Backgroundable work, java.lang.Object[] params)
          Enqueue a work item to be run on the UI thread
static int nQSyncUI(Backgroundable work, java.lang.Object[] params)
           
static int nQUI(Backgroundable work, java.lang.Object[] params)
          Enqueue a work item to be run at some later time on the UI thread
 void run()
          A background thread's main processing loop.
static void shutdownAll()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NETWORK_INSTANCE_NAME

public static final java.lang.String NETWORK_INSTANCE_NAME
See Also:
Constant Field Values

BACKGROUND_INSTANCE_NAME

public static final java.lang.String BACKGROUND_INSTANCE_NAME
See Also:
Constant Field Values

UI_INSTANCE_NAME

public static final java.lang.String UI_INSTANCE_NAME
See Also:
Constant Field Values

UI_SYNC_INSTANCE_NAME

public static final java.lang.String UI_SYNC_INSTANCE_NAME
See Also:
Constant Field Values

NAVIGATION_INSTANCE_NAME

public static final java.lang.String NAVIGATION_INSTANCE_NAME
See Also:
Constant Field Values
Method Detail

getNavigationThread

public static java.lang.Thread getNavigationThread()

run

public void run()
A background thread's main processing loop. Essentially, wait for work items to appear in the queue and execute them one at a time, in the order they were enqueued.

Specified by:
run in interface java.lang.Runnable

nQNetwork

public static final int nQNetwork(Backgroundable work,
                                  java.lang.Object[] params)
Enqueue a work item to be run at some later time on the dedicated network processing thread

Parameters:
work -
params -
Returns:

nQOrRunDirectlyNetwork

public static final int nQOrRunDirectlyNetwork(Backgroundable work,
                                               java.lang.Object[] params)
Enqueue a work item to be run on the dedicated network processing thread

Parameters:
work -
params -
Returns:

nQBackground

public static final int nQBackground(Backgroundable work,
                                     java.lang.Object[] params)
Enqueue a work item to be run at some later time on the dedicated general processing thread

Parameters:
work -
params -
Returns:

nQOrRunDirectlyBackground

public static final int nQOrRunDirectlyBackground(Backgroundable work,
                                                  java.lang.Object[] params)
Enqueue a work item to be run on the dedicated general processing thread

Parameters:
work -
params -
Returns:

nQNavigation

public static final int nQNavigation(Backgroundable work,
                                     java.lang.Object[] params)
Enqueue a work item to be run at some later time on the dedicated navigation processing thread

Parameters:
work -
params -
Returns:

nQOrRunDirectlyNavigation

public static final int nQOrRunDirectlyNavigation(Backgroundable work,
                                                  java.lang.Object[] params)
Enqueue a work item to be run on the dedicated navigation processing thread

Parameters:
work -
params -
Returns:

nQUI

public static final int nQUI(Backgroundable work,
                             java.lang.Object[] params)
Enqueue a work item to be run at some later time on the UI thread

Parameters:
work -
params -
Returns:

nQOrRunDirectlyUI

public static final int nQOrRunDirectlyUI(Backgroundable work,
                                          java.lang.Object[] params)
Enqueue a work item to be run on the UI thread

Parameters:
work -
params -
Returns:

nQSyncUI

public static final int nQSyncUI(Backgroundable work,
                                 java.lang.Object[] params)

nQOrRunDirectlySyncUI

public static final int nQOrRunDirectlySyncUI(Backgroundable work,
                                              java.lang.Object[] params)

shutdownAll

public static final void shutdownAll()

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.