org.objectweb.jac.aspects.gui
Class InvokeThread

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.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(InvokeEvent invoke)
          Creates a new thread that will invoke a method when started.
InvokeThread(InvokeEvent invoke, String[] attrNames, Object[] attrValues, String[] lattrNames, Object[] lattrValues)
          Creates a new thread that will invoke a method when started.
 
Method Summary
static InvokeThread quietRun(InvokeEvent invoke, 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(InvokeEvent invoke)
          Runs a method in a new thread.
static InvokeThread run(InvokeEvent invoke, 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(InvokeEvent invoke)
Creates a new thread that will invoke a method when started.

The programmer should use the static run methods.

Parameters:
invoke - the invocation to perform

InvokeThread

public InvokeThread(InvokeEvent invoke,
                    String[] attrNames,
                    Object[] attrValues,
                    String[] lattrNames,
                    Object[] lattrValues)
Creates a new thread that will invoke a method when started.

The programmer should use the static run methods.

Parameters:
invoke - the invocation to perform
attrNames - name of attributes to add to the context before invoking the method (may be null)
attrValues - values of the attributes (may be null)
lattrNames - name of local attributes to add to the context (may be null) before invoking the method (may be null)
lattrValues - values of the local attributes (may be null)
Method Detail

run

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

Parameters:
invoke - the invocation to perform
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(InvokeEvent invoke,
                                    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:
invoke - the invocation to perform
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(InvokeEvent invoke)
Runs a method in a new thread.

Parameters:
invoke - the invocation to perform

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.