JAC project
AOPSYS
CEDRIC & LIP6 labs

org.objectweb.jac.aspects.gui
Class InvokeThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--org.objectweb.jac.aspects.gui.InvokeThread
All Implemented Interfaces:
Runnable

public class InvokeThread
extends Thread

This class allows the programmer to invoke a given method in a new thread.

JAC programmers should use JAC to pass some attibutes of the current thread to the new thread.

Typical use:


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
InvokeThread(Object object, AbstractMethodItem method, Object[] parameters)
          Creates a new thread that will invoke a method when started.
InvokeThread(Object object, AbstractMethodItem method, Object[] parameters, String[] attrNames, Object[] attrValues, String[] lattrNames, Object[] lattrValues)
           
 
Method Summary
static InvokeThread quietRun(Object object, AbstractMethodItem method, Object[] parameters, String[] attrNames, Object[] attrValues, String[] lattrNames, Object[] lattrValues)
          Runs a method in a new thread and sets a display for this thread.
 void run()
          Runs the thread (and invoke the method that was given to the constructor with the right display in the collaboration).
static InvokeThread run(Object object, AbstractMethodItem method, Object[] parameters)
          Runs a method in a new thread.
static InvokeThread run(Object object, AbstractMethodItem method, Object[] parameters, String[] attrNames, Object[] attrValues, String[] lattrNames, Object[] lattrValues)
          Runs a method in a new thread and sets a display for this thread.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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
 

Constructor Detail

InvokeThread

public InvokeThread(Object object,
                    AbstractMethodItem method,
                    Object[] parameters)
Creates a new thread that will invoke a method when started.

The programmer should use the static run methods.

Parameters:
object - the object that contains the method to invoke
method - the method to invoke when started
parameters - the parameters to pass to the method

InvokeThread

public InvokeThread(Object object,
                    AbstractMethodItem method,
                    Object[] parameters,
                    String[] attrNames,
                    Object[] attrValues,
                    String[] lattrNames,
                    Object[] lattrValues)
Method Detail

run

public static InvokeThread run(Object object,
                               AbstractMethodItem method,
                               Object[] parameters,
                               String[] attrNames,
                               Object[] attrValues,
                               String[] lattrNames,
                               Object[] lattrValues)
Runs a method in a new thread and sets a display for this thread.

Parameters:
object - the object that contains the method to call
method - the method to call
parameters - the parameters to pass to the method
attrNames - the attribute names to set into the new thread collaboration
attrValues - the values of these attributes
lattrNames - the local attribute names to set into the new thread collaboration
lattrValues - the values of these local attributes

quietRun

public static InvokeThread quietRun(Object object,
                                    AbstractMethodItem method,
                                    Object[] parameters,
                                    String[] attrNames,
                                    Object[] attrValues,
                                    String[] lattrNames,
                                    Object[] lattrValues)
Runs a method in a new thread and sets a display for this thread. Do not show any results on the display.

Parameters:
object - the object that contains the method to call
method - the method to call
parameters - the parameters to pass to the method
attrNames - the attribute names to set into the new thread collaboration
attrValues - the values of these attributes
lattrNames - the local attribute names to set into the new thread collaboration
lattrValues - the values of these local attributes

run

public static InvokeThread run(Object object,
                               AbstractMethodItem method,
                               Object[] parameters)
Runs a method in a new thread.

Parameters:
object - the object that contains the method to call
method - the method to call
parameters - the parameters to pass to the method

run

public void run()
Runs the thread (and invoke the method that was given to the constructor with the right display in the collaboration).

Do not call this method directly.

Specified by:
run in interface Runnable
Overrides:
run in class Thread

Contact JAC development team:
Renaud Pawlak
Lionel Seinturier
Laurent Martelli