com.ibm.retail.AEF.client
Class EventDispatcher

java.lang.Object
  |
  +--com.ibm.retail.AEF.client.EventDispatcher

public class EventDispatcher
extends java.lang.Object

The EventDispatcher provides an event dispatch mechanism for AEF clients. It is used primarily to perform a thread context swap to prevent client listeners from hanging the AEF remote event calls.

EventDispatcher is a singleton object that is accessed through the static dispatch() method.


Nested Class Summary
(package private)  class EventDispatcher.EventDispatchQueue
          The EventDispatchQueue provides an equivalent to the AWT or Swing invokeLater() method for queueing events on an event dispatching thread.
 
Field Summary
static java.lang.String AEF_QUEUE
          Dispatch event queue name identifier: AEF event queue (for non-GUI apps).
static java.lang.String AWT_QUEUE
          Dispatch event queue name identifier: AWT event queue (for GUI apps).
static java.lang.String DEFAULT_QUEUE
          Default dispatch event queue name identifier.
protected static com.ibm.retail.AEF.client.EventDispatcher instance
           
static java.lang.String NO_QUEUE
          Dispatch event queue name identifier: none.
protected  EventDispatcher.EventDispatchQueue queue
           
 
Constructor Summary
protected EventDispatcher()
          Construct an EventDispatcher.
 
Method Summary
(package private) static java.lang.String copyright()
           
protected  void createEventQueues()
          Create the event queues.
static void dispatch(java.lang.Runnable obj, java.lang.String queueName)
          Handle a dispatch request.
protected  EventDispatcher.EventDispatchQueue getQueue()
          Get an event queue.
static void setDefaultDispatchQueueName(java.lang.String queue)
          Set the dispatch queue name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

protected static com.ibm.retail.AEF.client.EventDispatcher instance

AWT_QUEUE

public static java.lang.String AWT_QUEUE
Dispatch event queue name identifier: AWT event queue (for GUI apps).


AEF_QUEUE

public static java.lang.String AEF_QUEUE
Dispatch event queue name identifier: AEF event queue (for non-GUI apps).


NO_QUEUE

public static java.lang.String NO_QUEUE
Dispatch event queue name identifier: none.

(Performs the event dispatching synchronously.)


DEFAULT_QUEUE

public static java.lang.String DEFAULT_QUEUE
Default dispatch event queue name identifier.


queue

protected EventDispatcher.EventDispatchQueue queue
Constructor Detail

EventDispatcher

protected EventDispatcher()
Construct an EventDispatcher.

Method Detail

copyright

static java.lang.String copyright()

setDefaultDispatchQueueName

public static void setDefaultDispatchQueueName(java.lang.String queue)
Set the dispatch queue name. Defaults to the AEF_QUEUE.

Parameters:
queue - the dispatch queue name identifier
See Also:
AEF_QUEUE, AWT_QUEUE, NO_QUEUE

dispatch

public static void dispatch(java.lang.Runnable obj,
                            java.lang.String queueName)
                     throws AEFException
Handle a dispatch request.

Parameters:
obj - dispatch request object
queueName - dispatch queue name
Throws:
AEFException - Among the possible AEFException error codes are:
AEFConst.INVALID_DISPATCH_QUEUE
See Also:
AWT_QUEUE queue name, AEF_QUEUE queue name, NO_QUEUE no queueing

createEventQueues

protected void createEventQueues()
Create the event queues.


getQueue

protected EventDispatcher.EventDispatchQueue getQueue()
Get an event queue.

Returns:
EventDispatchQueue


Copyright © 2004 IBM. All Rights Reserved.
Generated: July 19 2004