jaxx.runtime.swing
Class AbstractActionThread

java.lang.Object
  extended by java.lang.Thread
      extended by jaxx.runtime.swing.AbstractActionThread
All Implemented Interfaces:
Runnable

Deprecated. since 2.1, prefer the ActionExecutor.

@Deprecated
public abstract class AbstractActionThread
extends Thread

An abstract action thread to consume actions in a non Swing event thread.

Implements the method onActionXXX(ActionWorker) to hook on action status.

To consume an action, use the method addAction(String, Runnable).

Since:
2.0
Author:
tchemit

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
protected  ActionWorker worker
          Deprecated. current worker to execute action
protected  PropertyChangeListener workerListener
          Deprecated. the listener of running action
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
protected AbstractActionThread(String name)
          Deprecated.  
 
Method Summary
 ActionWorker addAction(String actionLabel, Runnable action)
          Deprecated. Add an new action to perform.
 void cancel()
          Deprecated. Cancel the thread, this will release any lock of the tread.
protected  void close()
          Deprecated. La méthode pour nettoyer le thread, a la fermeture.
 Runnable createRunnable(Object methodContainer, String methodName, Object... arguments)
          Deprecated. Creates a runnable instance (via a Proxy) to a method given by his name (methodName) to invoke on methodcontainer with given arguments.
protected  void lockThread()
          Deprecated. To lock the thread.
abstract  void onActionCancel(ActionWorker source)
          Deprecated. Hook when a action has been canceled.
abstract  void onActionEnd(ActionWorker source)
          Deprecated. Hook when a action has end with no failure or cancel.
abstract  void onActionFail(ActionWorker source)
          Deprecated. Hook when a action has failed.
abstract  void onActionStart(ActionWorker source)
          Deprecated. Hook when a action is about to start.
 void run()
          Deprecated.  
protected  void setWaiting(boolean waiting)
          Deprecated. Mutates the waiting state of the thread.
protected  void unlockThread()
          Deprecated. To unlock the thread.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

worker

protected ActionWorker worker
Deprecated. 
current worker to execute action


workerListener

protected final PropertyChangeListener workerListener
Deprecated. 
the listener of running action

Constructor Detail

AbstractActionThread

protected AbstractActionThread(String name)
Deprecated. 
Method Detail

createRunnable

public Runnable createRunnable(Object methodContainer,
                               String methodName,
                               Object... arguments)
Deprecated. 
Creates a runnable instance (via a Proxy) to a method given by his name (methodName) to invoke on methodcontainer with given arguments.

This is a great feature to create runnable code with a real context.

Parameters:
methodContainer - the container of the method to invoke
methodName - the name of the method to invoke
arguments - parameters to pass to method to invke.
Returns:
the proxy instance

addAction

public ActionWorker addAction(String actionLabel,
                              Runnable action)
Deprecated. 
Add an new action to perform.

Parameters:
actionLabel - the name of the action to perform
action - the action to perform
Returns:
the worker that will launch the action

onActionStart

public abstract void onActionStart(ActionWorker source)
Deprecated. 
Hook when a action is about to start.

Parameters:
source - the action worker containing the action to perform

onActionFail

public abstract void onActionFail(ActionWorker source)
Deprecated. 
Hook when a action has failed.

Parameters:
source - the action worker containing the action to perform

onActionCancel

public abstract void onActionCancel(ActionWorker source)
Deprecated. 
Hook when a action has been canceled.

Parameters:
source - the action worker containing the action to perform

onActionEnd

public abstract void onActionEnd(ActionWorker source)
Deprecated. 
Hook when a action has end with no failure or cancel.

Parameters:
source - the action worker containing the action to perform

run

public void run()
Deprecated. 
Specified by:
run in interface Runnable
Overrides:
run in class Thread

cancel

public void cancel()
Deprecated. 
Cancel the thread, this will release any lock of the tread.

As a side effect, this will close the thread.


close

protected void close()
Deprecated. 
La méthode pour nettoyer le thread, a la fermeture.


setWaiting

protected void setWaiting(boolean waiting)
Deprecated. 
Mutates the waiting state of the thread.

If parameter waiting is to true, then will lock the thread, otherwise will unlock the thread.

Parameters:
waiting - true if a lock is required

lockThread

protected void lockThread()
                   throws InterruptedException
Deprecated. 
To lock the thread.

Throws:
InterruptedException - if locking was interruped

unlockThread

protected void unlockThread()
Deprecated. 
To unlock the thread.



Copyright © 2008-2010 CodeLutin. All Rights Reserved.