Package net.sf.basedb.util.annotations
Class RunnableInheritAnnotationsManager
- java.lang.Object
-
- net.sf.basedb.util.annotations.RunnableInheritAnnotationsManager
-
- All Implemented Interfaces:
Runnable
public class RunnableInheritAnnotationsManager extends Object implements Runnable
Utility class for processing multiple items with aInheritAnnotationsManager
in a separated thread with progress reporting.Initialize this class with a session control, a list of
Annotatable
items and a list ofInheritSpecification
:s, then start a new thread: new Thread(manager).start();- Since:
- 3.5
- Author:
- nicklas
-
-
Field Summary
Fields Modifier and Type Field Description private List<Annotatable>
items
private ProgressReporter
progress
private SessionControl
sc
private List<InheritSpecification>
specifications
-
Constructor Summary
Constructors Constructor Description RunnableInheritAnnotationsManager(SessionControl sc)
Create a new instance that should use the given session control.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAllItems(Collection<? extends Annotatable> items)
Add all items for processing.void
addItem(Annotatable item)
Add an item that should inherit annotations.void
addSpecification(InheritSpecification specification)
Add a specification with rules for inheriting annotations.void
run()
void
setProgressReporter(ProgressReporter progress)
Set the progress reporter to use for reporting progress.
-
-
-
Field Detail
-
sc
private final SessionControl sc
-
progress
private ProgressReporter progress
-
specifications
private final List<InheritSpecification> specifications
-
items
private final List<Annotatable> items
-
-
Constructor Detail
-
RunnableInheritAnnotationsManager
public RunnableInheritAnnotationsManager(SessionControl sc)
Create a new instance that should use the given session control.
-
-
Method Detail
-
setProgressReporter
public void setProgressReporter(ProgressReporter progress)
Set the progress reporter to use for reporting progress.
-
addSpecification
public void addSpecification(InheritSpecification specification)
Add a specification with rules for inheriting annotations.
-
addItem
public void addItem(Annotatable item)
Add an item that should inherit annotations. The item will be processed withInheritAnnotationsManager.process(Annotatable)
once the thread is stared.
-
addAllItems
public void addAllItems(Collection<? extends Annotatable> items)
Add all items for processing.
-
-