Search in sources :

Example 1 with AllocationFactory

use of org.palladiosimulator.pcm.allocation.AllocationFactory in project iobserve-analysis by research-iobserve.

the class AllocationModelFactory method addAllocationContext.

/**
 * Add an {@link AllocationContext} for the given {@link ResourceContainer} and
 * {@link AssemblyContext} if they are absent to this model. No check for duplication is done!
 *
 * @param model
 *            allocation model
 * @param resContainer
 *            container
 * @param asmCtx
 *            assembly context
 */
public static void addAllocationContext(final Allocation model, final ResourceContainer resContainer, final AssemblyContext asmCtx) {
    final AllocationFactory factory = AllocationFactory.eINSTANCE;
    final AllocationContext allocationCtx = factory.createAllocationContext();
    allocationCtx.setEntityName(asmCtx.getEntityName());
    allocationCtx.setAssemblyContext_AllocationContext(asmCtx);
    allocationCtx.setResourceContainer_AllocationContext(resContainer);
    model.getAllocationContexts_Allocation().add(allocationCtx);
}
Also used : AllocationContext(org.palladiosimulator.pcm.allocation.AllocationContext) AllocationFactory(org.palladiosimulator.pcm.allocation.AllocationFactory)

Example 2 with AllocationFactory

use of org.palladiosimulator.pcm.allocation.AllocationFactory in project iobserve-analysis by research-iobserve.

the class DeploymentResourceContainerTest method addAllocationContext.

/**
 * Add an {@link AllocationContext} for the given {@link ResourceContainer} and
 * {@link AssemblyContext} if they are absent to this model. No check for duplication is done!
 *
 * @param model
 *            allocation model
 * @param resContainer
 *            container
 * @param asmCtx
 *            assembly context
 */
private void addAllocationContext(final Allocation model, final ResourceContainer resContainer, final AssemblyContext asmCtx) {
    final AllocationFactory factory = AllocationFactory.eINSTANCE;
    final AllocationContext allocationCtx = factory.createAllocationContext();
    allocationCtx.setEntityName(asmCtx.getEntityName());
    allocationCtx.setAssemblyContext_AllocationContext(asmCtx);
    allocationCtx.setResourceContainer_AllocationContext(resContainer);
    model.getAllocationContexts_Allocation().add(allocationCtx);
}
Also used : AllocationContext(org.palladiosimulator.pcm.allocation.AllocationContext) AllocationFactory(org.palladiosimulator.pcm.allocation.AllocationFactory)

Aggregations

AllocationContext (org.palladiosimulator.pcm.allocation.AllocationContext)2 AllocationFactory (org.palladiosimulator.pcm.allocation.AllocationFactory)2