org.openide.compiler
Class CompilerJob

java.lang.Object
  |
  +--org.openide.compiler.CompilerJob
All Implemented Interfaces:
Compilable

public final class CompilerJob
extends Object
implements Compilable

A compiler job consists of more Compilers with dependencies between each other. The compiler job can compiled, built or cleaned. To handle each of these jobs the instance of the compilation engine is obtained and its is up to it to decide whether it will compile in one thread, a thread group, etc.

A module author only needs to instantiate this class if it is desired to initiate a whole compilation process from scratch; normally AbstractCompileAction does this. Usually it is only used as the argument to a constructor for a Compiler implementation.


Fields inherited from interface org.openide.compiler.Compilable
MUTEX
 
Constructor Summary
CompilerJob(Compiler.Depth depth)
          Create a new job with the given initial depth.
 
Method Summary
 void add(Collection comps)
          Adds compilers into the job.
 void add(Compiler comp)
          Adds a compiler into the job.
 Collection compilers()
          A collection of all compilers that have been added by add (...) methods.
 Collection dependsOn()
          Collection of all objects this job depends on.
 void dependsOn(Collection arr)
          Adds a dependency.
 void dependsOn(Compilable c)
          Adds a dependency.
 String getDisplayName()
          Get the display name of the job
 Compiler.Depth getInitialDepth()
          Get the depth of the job.
 boolean isUpToDate()
          Test if the set of compilers in the job still needs to be compiled.
 void setDisplayName(String s)
          Set the display name of this job.
 CompilerTask start()
          Start asynchronous compilation of the job.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openide.compiler.Compilable
equals
 

Constructor Detail

CompilerJob

public CompilerJob(Compiler.Depth depth)
Create a new job with the given initial depth.
Parameters:
depth - initial depth of the job; normally Compiler.DEPTH_ONE for Compile action, and Compiler.DEPTH_INFINITE for Compile All action
Method Detail

getInitialDepth

public Compiler.Depth getInitialDepth()
Get the depth of the job. This indicates the depth at which the job was started.
Returns:
the compiler depth

start

public CompilerTask start()
Start asynchronous compilation of the job.

Usually used by, e.g., AbstractCompileAction.

Returns:
a compiler task to track the state of the compilation

isUpToDate

public final boolean isUpToDate()
Test if the set of compilers in the job still needs to be compiled. Scans the compilers looking for any that are not up to date.
Returns:
true if every compiler is up to date, false if at least one compilation is needed

setDisplayName

public void setDisplayName(String s)
Set the display name of this job.
Parameters:
s - the human readable name of this job

getDisplayName

public String getDisplayName()
Get the display name of the job
Returns:
a human readable name of this job

add

public void add(Compiler comp)
Adds a compiler into the job.
Parameters:
comp - the compiler

add

public void add(Collection comps)
Adds compilers into the job.
Parameters:
comps - collection of Compiler

dependsOn

public void dependsOn(Compilable c)
Adds a dependency. Before any compiler added into this job will be started, given dependency has to be satified (compiled).
Parameters:
c - compilable

dependsOn

public void dependsOn(Collection arr)
Adds a dependency. Before any compiler added into this job will be started, given dependency has to be satified (compiled).
Parameters:
arr - collection of Compilable objects

compilers

public final Collection compilers()
A collection of all compilers that have been added by add (...) methods.
Specified by:
compilers in interface Compilable
Returns:
unmodifiable collection of Compiler

dependsOn

public final Collection dependsOn()
Collection of all objects this job depends on.
Specified by:
dependsOn in interface Compilable
Returns:
unmodifiable collection with depenencies on Compilable objects

toString

public String toString()
Overrides:
toString in class Object
Returns:
the name of the job.


Built on December 12 2001.  |  Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.