public final AllocationComponent createAndRegisterAllocationComponentInstance(final String namedIdentifier, final AssemblyComponent assemblyComponentInstance, final ExecutionContainer executionContainer) { if (this.allocationComponentInstancesByName.containsKey(namedIdentifier)) { throw new IllegalArgumentException("Element with name " + namedIdentifier + "exists already"); } final int id = this.getAndIncrementNextId(); final AllocationComponent newInst = new AllocationComponent(id, assemblyComponentInstance, executionContainer); this.allocationComponentInstancesById.put(id, newInst); this.allocationComponentInstancesByName.put(namedIdentifier, newInst); return newInst; }
.lookupAllocationComponentInstanceByNamedIdentifier(allocationComponentName); if (allocInst == null) { // Allocation component instance doesn't exist AssemblyComponent assemblyComponent = systemModelRepository.getAssemblyFactory() .createAndRegisterAllocationComponentInstance(allocationComponentName, assemblyComponent, execContainer);
/** * 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, "Deployment Components", new String[] { "ID", "Assembly component", "Execution container" }); final Collection<AllocationComponent> allocationComponentInstances = this.allocationFactory.getAllocationComponentInstances(); for (final AllocationComponent allocationComponent : allocationComponentInstances) { final String[] cells = new String[] {
this.systemEntityFactory.getAllocationFactory().lookupAllocationComponentInstanceByNamedIdentifier(allocationName); if (allocationComponentA == null) { allocationComponentA = this.systemEntityFactory.getAllocationFactory().createAndRegisterAllocationComponentInstance(allocationName, assemblyComponentA, containerC);