/* Utility operations */
protected List<ServiceDefinition> createServiceDefinitions() throws IOException {
final List<ServiceDefinition> serviceDefinitions = new ArrayList<ServiceDefinition>();
final ServiceDefinitionEditor serviceDefinitionEditor = new ServiceDefinitionEditor();
for (final Resource configuration : resolveConfigurations()) {
final LineNumberReader in = new LineNumberReader(new InputStreamReader(configuration.getInputStream()));
for (String line; (line = in.readLine()) != null;) {
line = line.trim();
if (line.isEmpty() || line.startsWith("#")) {
// Skip empty lines and comments.
continue;
}
try {
serviceDefinitionEditor.setAsText(line);
final ServiceDefinition serviceDefinition = (ServiceDefinition) serviceDefinitionEditor.getValue();
serviceDefinitions.add(serviceDefinition);
} catch (final IllegalArgumentException e) {
logger.warn("Could not parse SystemPackage configuration line: {}", e.getMessage());
}