Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 1 (11.1.1.5)

E22562-01

oracle.apps.fnd.applcore.flex.runtime.event
Class ModelerEventDispatcher

java.lang.Object
  extended by oracle.apps.fnd.applcore.flex.runtime.event.ModelerEventDispatcher

public class ModelerEventDispatcher
extends java.lang.Object

A thread that dispatches modeler events to a listener using a blocking queue.


Nested Class Summary
static interface ModelerEventDispatcher.DispatchAction
          A dispatch action.
 
Constructor Summary
ModelerEventDispatcher(ModelerListener listener)
          Constructs a modeler event dispatcher.
 
Method Summary
 void cancel()
          Stops this dispatcher and abandons all events in queue.
 void clearQueue()
          Clears the event queue.
 void dispatch(ModelerEventDispatcher.DispatchAction action)
          Dispatches a custom event.
 void dispatchModelerActionPerformed(ModelerEvent me)
          Dispatches a modeler event by calling the listener's modelerActionPerformed method.
 void dispatchModelerFinished(ModelerEvent me)
          Dispatches a modeler event by calling the listener's moodelerFinished method.
 void dispatchModelerInterrupted(ModelerEvent me, java.lang.Throwable t)
          Dispatches a modeler event by calling the listener's modelerInterrupted method.
 void dispatchModelerStarting(ModelerEvent me)
          Dispatches a modeler event by calling the listener's modelerStarting method.
 boolean isActive()
          Checks whether this dispatcher is currently active.
 void start()
          Starts this dispatcher.
 void stop()
          Stops this dispatcher after all queued events are dispatched.
 void stopAndWait(long millis)
          Waits until all the queued events are dispatched and then stops this dispatcher.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelerEventDispatcher

public ModelerEventDispatcher(ModelerListener listener)
Constructs a modeler event dispatcher.

Parameters:
listener - the listener to dispatch the events to
Throws:
java.lang.IllegalArgumentException - if the given listener is null
Method Detail

start

public void start()
Starts this dispatcher. If there are events in queue prior to this call, the events will start to be dispatched.

Throws:
java.lang.IllegalStateException - if this dispatcher is already active
See Also:
isActive()

clearQueue

public void clearQueue()
Clears the event queue. If this dispatcher is active, it will be cancelled.

See Also:
cancel()

stopAndWait

public void stopAndWait(long millis)
Waits until all the queued events are dispatched and then stops this dispatcher. If the dispatcher is still active after the given time, this method will attempt to stop the dispatcher by canceling all dispatch actions in the queue. If the dispatcher still cannot be stopped, the interrupt() will be called on the dispatching thread.

Parameters:
millis - the time to wait in milliseconds; 0 means to wait forever

stop

public void stop()
Stops this dispatcher after all queued events are dispatched. This method returns immediately without waiting.


cancel

public void cancel()
Stops this dispatcher and abandons all events in queue. Events in queue will be discarded. This method returns without errors if this dispatcher was already stopped. After the invocation of this method, this dispatcher may continue to run for a small period of time until it can be stopped appropriately.

This method does not wait until the dispatcher is completely stopped. If an event is being dispatched while this method is invoked, the dispatcher will stop only after the last dispatch action is complete.


isActive

public boolean isActive()
Checks whether this dispatcher is currently active.

Returns:
true if this dispatcher is currently active

dispatchModelerStarting

public void dispatchModelerStarting(ModelerEvent me)
Dispatches a modeler event by calling the listener's modelerStarting method.

Parameters:
me - the modeler event

dispatchModelerInterrupted

public void dispatchModelerInterrupted(ModelerEvent me,
                                       java.lang.Throwable t)
Dispatches a modeler event by calling the listener's modelerInterrupted method.

Parameters:
me - the modeler event
t - the cause of the interruption

dispatchModelerFinished

public void dispatchModelerFinished(ModelerEvent me)
Dispatches a modeler event by calling the listener's moodelerFinished method.

Parameters:
me - the modeler event

dispatchModelerActionPerformed

public void dispatchModelerActionPerformed(ModelerEvent me)
Dispatches a modeler event by calling the listener's modelerActionPerformed method.

Parameters:
me - the modeler event

dispatch

public void dispatch(ModelerEventDispatcher.DispatchAction action)
Dispatches a custom event.

Parameters:
action - the dispatch action
Throws:
java.lang.IllegalArgumentException - if the given action is null

Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 1 (11.1.1.5)

E22562-01

Copyright © 2011 Oracle. All Rights Reserved.