- String missingRequired = "";
- for (RequiredInterface service : reallyRequired) {
- missingRequired += service + "\n";
+ private void validateRequiredInterfaces(List<RequiredInterface> required) {
+ for (RequiredInterface service : getRequiredInterfaces()) {
+ // TODO required services by the subsystem could be
+ // subclasses or implementations of the requirements
+ // of the contained systems. The code below assumes
+ // an exact match.
+ if (!(required.contains(service))) {
+ info("Service '"
+ + service
+ + "' indicated as required is not actually required by any of the subsystems");
+ }
+ // Check for the case that the externally required service
+ // is optional whereas the internally required service is
+ // mandatory.
+ if ( service.isOptional()) {
+ for (RequiredInterface intf: required) {
+ if ( intf.equals(service) && !intf.isOptional()) {
+ // TODO indicate which subsystem this is.
+ warn("Required service '" + service + "' indicated as optional is mandatory by one of its subsystems (" + getClients(intf) + ", " + intf + "), this can lead to problems when the system is started and the service is not there.");
+ }
+ }
+ }