org.epics.pvmanager
Class ThreadSwitch

java.lang.Object
  extended by org.epics.pvmanager.ThreadSwitch

public abstract class ThreadSwitch
extends java.lang.Object

Embeds the logic to post events on a separate thread so that PVManager can appropriately redirect the notifications.

Author:
carcassi

Constructor Summary
ThreadSwitch()
           
 
Method Summary
static ThreadSwitch onSwingEDT()
          Tells the PV manager to notify on the Swing Event Dispatch Thread using SwingUtilities.invokeLater().
static ThreadSwitch onTimerThread()
          Tells the PV manager to notify on the timer thread.
abstract  void post(java.lang.Runnable run)
          Post the given task to the notification thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadSwitch

public ThreadSwitch()
Method Detail

onSwingEDT

public static ThreadSwitch onSwingEDT()
Tells the PV manager to notify on the Swing Event Dispatch Thread using SwingUtilities.invokeLater().

Returns:
an object that posts events on the EDT

onTimerThread

public static ThreadSwitch onTimerThread()
Tells the PV manager to notify on the timer thread.

Returns:
an object that runs tasks on the timer thread

post

public abstract void post(java.lang.Runnable run)
Post the given task to the notification thread.

Parameters:
run - a new task


Copyright © 2010. All Rights Reserved.