public class Orderer extends java.lang.Object
Constructor and Description |
---|
Orderer(ErrorHandler errorHandler,
java.lang.String objectType)
Creates an instance using
org.apache.hivemind.order.Orderer as the Log. |
Orderer(ErrorLog errorLog,
java.lang.String objectType)
Creates a new instance.
|
Orderer(org.apache.commons.logging.Log log,
ErrorHandler errorHandler,
java.lang.String objectType)
Creates a new instance, but directs all debug and error logging output to the provided log.
|
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.Object object,
java.lang.String name,
java.lang.String prereqs,
java.lang.String postreqs)
Adds a new object.
|
java.util.List |
getOrderedObjects()
Uses the information provided by
add(Object, String, String, String) to order the
objects into an appropriate order based on the pre- and post-reqts provided. |
public Orderer(ErrorHandler errorHandler, java.lang.String objectType)
org.apache.hivemind.order.Orderer
as the Log.public Orderer(org.apache.commons.logging.Log log, ErrorHandler errorHandler, java.lang.String objectType)
log
- Used for logging any errorsobjectType
- user presentable name for the type of object to be ordered; used in some error
messagespublic void add(java.lang.Object object, java.lang.String name, java.lang.String prereqs, java.lang.String postreqs)
add(Object, String, String, String)
should
occur before invoking getOrderedObjects()
.object
- an object to be sorted into order based on prereqs and postreqsname
- a unique name for theprereqs
- a comma-separated list of the names of objects that should precede this object in
the list (or null)postreqs
- a comma-separated list of the names of objects that should follow this object in
the list (or null)public java.util.List getOrderedObjects()
add(Object, String, String, String)
to order the
objects into an appropriate order based on the pre- and post-reqts provided. Errors such as
cyclic dependencies or unrecognized names are logged and ignored.