Add a service to be deployed: use the host IP

This fixes the problem in the new method to add the information of a
service to ECServiceLoader.

git-svn-id: https://clas12svn.jlab.org/repos/clas12/EC_reconstruction/trunk@8544 b9d438ff-8729-0410-a4ab-d2f36c9c72ed
ECServiceLoader: remove ServiceInfo old constructor

Use the new one, which accepts the three parameters instead of a String
array with them.

git-svn-id: https://clas12svn.jlab.org/repos/clas12/EC_reconstruction/trunk@8545 b9d438ff-8729-0410-a4ab-d2f36c9c72ed
Remove call to exit() when checking EC services

It is unnecessary, since it will be called in the main function.

git-svn-id: https://clas12svn.jlab.org/repos/clas12/EC_reconstruction/trunk@8625 b9d438ff-8729-0410-a4ab-d2f36c9c72ed
Check all EC services before returning error

Print an error message for each service that is not found, instead of
printing only the first missing service.

git-svn-id: https://clas12svn.jlab.org/repos/clas12/EC_reconstruction/trunk@8626 b9d438ff-8729-0410-a4ab-d2f36c9c72ed
Print "services found" only if they are in a chain

Don't use two different messages to print that the services were found
and that the reconstruction chain was found. Use just one, when the
services and the chain are deployed.

git-svn-id: https://clas12svn.jlab.org/repos/clas12/EC_reconstruction/trunk@8627 b9d438ff-8729-0410-a4ab-d2f36c9c72ed
Improve starting/finishing/aborting messages

- Print a message when the reconstruction is started
- Print done when the reconstruction is finished successfully
- Reduce empty lines if printing that the reconstruction was aborted

git-svn-id: https://clas12svn.jlab.org/repos/clas12/EC_reconstruction/trunk@8628 b9d438ff-8729-0410-a4ab-d2f36c9c72ed
Simplify event counting in EC reconstruction

Use an atomic variable to count started events, and another one to count
reconstructed events (i.e., the number of callbacks received).

Stop the reconstruction when the number of reconstructed events is equal
to the number of requested events.

git-svn-id: https://clas12svn.jlab.org/repos/clas12/EC_reconstruction/trunk@8629 b9d438ff-8729-0410-a4ab-d2f36c9c72ed
Stop requesting events if the reconstruction was aborted

When the reconstruction is aborted, some callbacks may still be received
before the orchestrator unsubscribes and exits from CLARA, and those
callbacks are requesting new events and printing information to STDOUT.

This side effect is now avoided by checking the status of the
reconstruction at the beginning of the callback. If the status is
ABORTED then return without doing anything else.

Note that the callbacks will be received until the main orchestrator
threads unsubscribes from the reconstruction chain.

git-svn-id: https://clas12svn.jlab.org/repos/clas12/EC_reconstruction/trunk@8630 b9d438ff-8729-0410-a4ab-d2f36c9c72ed
Change name of config properties in I/O services

Use simpler versions: "open" and "close" to configure the services to
open and close a file.

Always pass the name of the file as the value of those properties.

git-svn-id: https://clas12svn.jlab.org/repos/clas12/EC_reconstruction/trunk@8631 b9d438ff-8729-0410-a4ab-d2f36c9c72ed
Better handling of filenames in I/O services

Some changes to the configuration of the file used by those services:

- Use "undefined" as the default name (no open file).
- Get the filename from the properties inside a synchronized block.
- Improve status messages about openning/closing the file.
- If there was an error when trying to open the file, reset the name to
  "undefined".
- After closing the file, reset the name to "undefined" too.

git-svn-id: https://clas12svn.jlab.org/repos/clas12/EC_reconstruction/trunk@8632 b9d438ff-8729-0410-a4ab-d2f36c9c72ed
Close any open file when removing I/O services

Use the destruct method to close any file that may still be open before
removing the service from CLARA.

git-svn-id: https://clas12svn.jlab.org/repos/clas12/EC_reconstruction/trunk@8633 b9d438ff-8729-0410-a4ab-d2f36c9c72ed
Store errors when configuring I/O services

- The default error message is "No open file", which means that a request
  to open a file has not been received.
- If opening a file throws an exception, save its stack trace as part of
  the error message.  The exception is also printed to STDOUT.
- Reset the error message to "No open file" after closing the file.

git-svn-id: https://clas12svn.jlab.org/repos/clas12/EC_reconstruction/trunk@8634 b9d438ff-8729-0410-a4ab-d2f36c9c72ed
Report execution errors of I/O services

- Don't print the errors to STDERR, just save them in the description
  field of the returned JioSerial object.
- If the file is not open, report the error stored in the configure
  method.
- If the event could not be read/written, report the error and the stack
  trace.
- Report if the input data has the wrong mime-type

git-svn-id: https://clas12svn.jlab.org/repos/clas12/EC_reconstruction/trunk@8635 b9d438ff-8729-0410-a4ab-d2f36c9c72ed
Abort the reconstruction if services report errors

Check the status of the received data in the callback. If it is an error
status, abort the reconstruction and print the source of the error and
the details.

git-svn-id: https://clas12svn.jlab.org/repos/clas12/EC_reconstruction/trunk@8636 b9d438ff-8729-0410-a4ab-d2f36c9c72ed