/** * This method creates a new execution container and registers it as well. * * @param namedIdentifier * The identifier of the new container. * @param name * The name of the new container. * * @return The newly created execution container. */ public final ExecutionContainer createAndRegisterExecutionContainer(final String namedIdentifier, final String name) { if (this.executionContainersByName.containsKey(namedIdentifier)) { throw new IllegalArgumentException("Element with name " + namedIdentifier + "exists already"); } final int id = this.getAndIncrementNextId(); final ExecutionContainer newInst = new ExecutionContainer(id, null, name); this.executionContainersById.put(id, newInst); this.executionContainersByName.put(namedIdentifier, newInst); return newInst; }
.lookupExecutionContainerByNamedIdentifier(executionContainerName); if (execContainer == null) { // doesn't exist, yet execContainer = systemModelRepository.getExecutionEnvironmentFactory() .createAndRegisterExecutionContainer(executionContainerName, executionContainerName);
/** * Creates a new instance of this class using the given parameters. * * @param configuration * The configuration to use for this repository. * @param projectContext * The project context to use for this repository. */ public SystemModelRepository(final Configuration configuration, final IProjectContext projectContext) { super(configuration, projectContext); this.typeRepositoryFactory = new TypeRepository(this); this.assemblyFactory = new AssemblyRepository(this); this.executionEnvironmentFactory = new ExecutionEnvironmentRepository(this); this.allocationFactory = new AllocationRepository(this); this.operationFactory = new OperationRepository(this); this.allocationPairFactory = new AllocationComponentOperationPairFactory(this); this.assemblyPairFactory = new AssemblyComponentOperationPairFactory(this); }
this.printLinebreak(ps); this.printOpenHtmlTable(ps, "Execution Containers", new String[] { "ID", "Name" }); final Collection<ExecutionContainer> containers = this.executionEnvironmentFactory.getExecutionContainers(); for (final ExecutionContainer container : containers) { final String[] cells = new String[] {
ExecutionContainer containerC = this.systemEntityFactory.getExecutionEnvironmentFactory().lookupExecutionContainerByNamedIdentifier(executionContainerName); if (containerC == null) { containerC = this.systemEntityFactory.getExecutionEnvironmentFactory().createAndRegisterExecutionContainer(executionContainerName, executionContainerName);