All Packages This Package Class Hierarchy Class Search Index
Summary |
public interface Task { // Methods 2 public abstract int perform(String[], Authorization); public abstract boolean producesOutput(); }
A Task implements some action that an Envoy performs. A Task is usually performed when the process has elevated privileges. A Task may perform nothing but Java actions, or it may execute other programs that perform some or all of its intended actions.
A Task may or may not produce returnable output (text). If it does, it must return T from producesOutput(), otherwise the System.out stream will be set to a bit-bucket when the Task is perform()'ed. A Task need not produce any special encoding on System.out. If that needs to be done, it will be done transparently by the PrintStream assigned to System.out, or by some other means. Basically, a Task's output can be whatever is appropriate for that Task.
Cross Reference |
Methods |
· producesOutput | Summary | Top |
public abstract boolean producesOutput()
Does this Task produce output on System.out that should be collected and returned to the Envoy's master?
A Task may or may not produce any returnable output on System.out. It may produce no output on success but an error message on failure. If the Task's status code from perform() sufficiently distinguishes success from failure, then no returnable output is needed and the Task should return false here.
Or a Task may produce output, but the output isn't returnable. Such Tasks should return false, and their System.out will be a data sink.
Or a Task may produce nothing on System.out, but produce diagnostic results on a side-channel, such as the System.err stream. Such Tasks should also return false, and they can write to System.err as usual, which will not be returned as output.
· perform | Summary | Top |
public abstract int perform(String[] args, Authorization auth)
Perform the actions embodied in this Task, returning a completion-code, which an Envoy then returns to its master.
The Task may call authorize() or other methods of the Authorization, but should not detach() or release() it. The provided Authorization will be passed to other Tasks being perform()'ed by the same calling Envoy.
A value of zero means "success". Non-zero values mean some kind of failure. If this method throws any exceptions, that is also considered a failure.
All Packages This Package Class Hierarchy Class Search IndexFreshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7