@Override
protected Scope doStart(Scope aExternalScope) {
- checkSealed();
validate();
Scope scope = new DefaultScope(getProvidedInterfaces().toArray(new ProvidedInterface[0]), aExternalScope);
ComponentGraph graph = doStartOptionalDryRun(scope, false);
private ComponentGraph doStartOptionalDryRun(Scope aScope, boolean aDryRun) {
ComponentGraph graph = createComponentGraph();
graph.validate();
- if (!aDryRun) {
- graph.link();
- }
+ graph.link();
LOG.info("Starting '" + getQualifiedName() + "'");
/**
* Publishes an implementation of a provided interface.
- * @param aComponent Component that provides the interface.
* @param aInterface Interface that is provided.
* @param aImplementation Implementation of the interface.
*/
*/
public class ComponentGraph extends Graph {
+ private boolean _isLinked;
private CompositeEdgeFilter _edgeFilter;
/**
* Constructs an empty component graph.
*/
public ComponentGraph() {
+ _isLinked = false;
_edgeFilter = new CompositeEdgeFilter();
}
* Links provided and required interfaces together in the component
* model based on the graph model.
*/
- public void link() {
+ public void link() {
+ if ( _isLinked ) {
+ return;
+ }
accept(new LinkVisitor());
+ _isLinked = true;
}
/**