| /******************************************************************************* |
| * Copyright (c) 2018 Robert Bosch GmbH. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Robert Bosch GmbH - initial API and implementation |
| *******************************************************************************/ |
| |
| package app4mc.example.transform.m2m.transformers |
| |
| import app4mc.example.transform.samplemodel.SampleModelFactory |
| import org.eclipse.app4mc.amalthea.model.Memory |
| import org.eclipse.app4mc.transformation.ServiceConstants |
| import org.eclipse.app4mc.transformation.transformers.AbstractTransformer |
| import org.osgi.service.component.annotations.Activate |
| import org.osgi.service.component.annotations.Component |
| import org.osgi.service.component.annotations.ConfigurationPolicy |
| import org.slf4j.Logger |
| import org.slf4j.LoggerFactory |
| |
| @Component( |
| configurationPid = ServiceConstants.SESSION_CONFIGURATION_PID, |
| configurationPolicy = ConfigurationPolicy.REQUIRE, |
| service = #[MemoryTransformer,AbstractTransformer]) |
| class MemoryTransformer extends AbstractTransformer { |
| |
| static final Logger LOG = LoggerFactory.getLogger(typeof(MemoryTransformer)) |
| |
| @Activate |
| def package void activate() { |
| LOG.debug("MemoryTransformer activated : "+this.hashCode) |
| } |
| |
| def transfromMemory(Memory amltMemory) { |
| return createMemory(amltMemory) |
| } |
| |
| private def create SampleModelFactory.eINSTANCE.createMemory createMemory(Memory amltMemory) { |
| name = amltMemory.name |
| } |
| |
| } |