|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.schmant.support.AbstractArgumentChecker org.schmant.project.java.JavaProjectDependencies
public class JavaProjectDependencies
This is a ProjectDependencies
implementation for
handling compile dependencies between JavaProject
:s.
In addition to the dependency handling defined in
ProjectDependencies
, it also keeps tracks of the
directories where each project's class files are stored. The class file
directory is registered by the build script by calling
registerClassDirectory(JavaProject, Object)
or
registerClassDirectories(JavaProject, Collection)
. Later on they are
retrieved when compiling the dependent project by giving its compile task a
JavaProjectClasspathDecorator
.
See the user's guide for an example.
Constructor Summary | |
---|---|
JavaProjectDependencies()
|
Method Summary | |
---|---|
Collection<Object> |
getClassDirectories()
Get all registered class directories |
Collection<Object> |
getClassDirectories(JavaProject p)
Get the directories for built classes for the specified project. |
Collection<? extends TaskDependency> |
getDependencies(Project p)
Get dependency objects for the given project. |
Observable |
getDependencyObservable()
Observable that will fire with the dependency as argument when all dependencies are satisfied. |
Lock |
getSatisfiedStateLock()
Get the Lock that protects the dependency's satisfied
property. |
boolean |
isSatisfied()
Is this dependency satisfied? |
void |
registerClassDirectories(JavaProject p,
Collection<?> c)
Register a collection of class directories for a Java project. |
void |
registerClassDirectory(JavaProject p,
Object d)
Register one class directory for a Java project. |
void |
registerDependency(Project p,
TaskDependency d)
Register a dependency for a project. |
void |
update(Observable obs,
Object o)
|
Methods inherited from class org.schmant.support.AbstractArgumentChecker |
---|
check, check, check, check |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JavaProjectDependencies()
Method Detail |
---|
public void registerDependency(Project p, TaskDependency d)
ProjectDependencies
registerDependency
in interface ProjectDependencies
public Collection<Object> getClassDirectories(JavaProject p)
p
- The project.
public Collection<Object> getClassDirectories()
public void registerClassDirectory(JavaProject p, Object d)
p
- The project.d
- The class directory.public void registerClassDirectories(JavaProject p, Collection<?> c)
p
- The project.c
- The collection of directories.public Collection<? extends TaskDependency> getDependencies(Project p)
ProjectDependencies
getDependencies
in interface ProjectDependencies
p
- The project
ProjectDependencies.registerDependency(Project, TaskDependency)
.public void update(Observable obs, Object o)
update
in interface Observer
public boolean isSatisfied()
TaskDependency
Implementation note: This method should be protected by the same
lock that can be retrieved by calling TaskDependency.getSatisfiedStateLock()
.
isSatisfied
in interface TaskDependency
true
if the dependency is satisfied.public Lock getSatisfiedStateLock()
TaskDependency
Lock
that protects the dependency's satisfied
property. This lock must be locked before the dependency's satisfied
state can be update.
An external class can lock this to ensure that the satisfied state is not updated while it holds the lock.
getSatisfiedStateLock
in interface TaskDependency
TaskDependency.isSatisfied()
public Observable getDependencyObservable()
TaskDependency
Implementation note: The thread firing an event must own the satisfied state lock on the task dependency object.
getDependencyObservable
in interface TaskDependency
Observable
to observe.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |