@@ -0,0 +1,2155 @@
+package de.fabiankeller.palladio.builder.util.impl;%0A%0Aimport de.fabiankeller.palladio.builder.util.PalladioResourceRepository;%0Aimport org.palladiosimulator.pcm.core.entity.Entity;%0Aimport org.palladiosimulator.pcm.resourcetype.CommunicationLinkResourceType;%0Aimport org.palladiosimulator.pcm.resourcetype.ProcessingResourceType;%0Aimport org.palladiosimulator.pcm.resourcetype.ResourceRepository;%0Aimport org.palladiosimulator.pcm.resourcetype.ResourceType;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Apublic class PalladioResourceRepositoryImpl implements PalladioResourceRepository %7B%0A%0A    private final ResourceRepository repository;%0A%0A    private static final String CPU = %22CPU%22;%0A    private static final String LAN = %22LAN%22;%0A    private static final String HDD = %22HDD%22;%0A    private static final String DELAY = %22DELAY%22;%0A%0A    private final Map%3CString, Entity%3E resourceTypes = new HashMap%3C%3E();%0A%0A    public PalladioResourceRepositoryImpl(final ResourceRepository repository) %7B%0A        this.repository = repository;%0A    %7D%0A%0A    @Override%0A    public ProcessingResourceType cpu() %7B%0A        return (ProcessingResourceType) getResourceTypeByName(CPU);%0A    %7D%0A%0A    @Override%0A    public ProcessingResourceType hdd() %7B%0A        return (ProcessingResourceType) getResourceTypeByName(HDD);%0A    %7D%0A%0A    @Override%0A    public ProcessingResourceType delay() %7B%0A        return (ProcessingResourceType) getResourceTypeByName(DELAY);%0A    %7D%0A%0A    @Override%0A    public CommunicationLinkResourceType lan() %7B%0A        return (CommunicationLinkResourceType) getResourceTypeByName(LAN);%0A    %7D%0A%0A    private Entity getResourceTypeByName(final String entityName) %7B%0A        if (!this.resourceTypes.containsKey(entityName)) %7B%0A            for (final ResourceType type : this.repository.getAvailableResourceTypes_ResourceRepository()) %7B%0A                if (type.getEntityName().equals(entityName)) %7B%0A                    this.resourceTypes.put(entityName, type);%0A                    break;%0A                %7D%0A            %7D%0A            throw new RuntimeException(String.format(%22Could not find resource type '%25s'%22, entityName));%0A        %7D%0A        return this.resourceTypes.get(entityName);%0A    %7D%0A%7D%0A

Implement facade to retrieve Palladio resource types