| /******************************************************************************* |
| * 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.Cache |
| 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=#[CacheTransformer,AbstractTransformer] |
| ) |
| class CacheTransformer extends AbstractTransformer { |
| |
| static final Logger LOG = LoggerFactory.getLogger(typeof(CacheTransformer)); |
| |
| @Activate |
| def package void activate() { |
| LOG.debug("CacheTransformer activated : "+this.hashCode) |
| } |
| |
| def transfromCache(Cache amltCache) { |
| |
| return createCache(amltCache) |
| } |
| |
| private def create SampleModelFactory.eINSTANCE.createCache createCache(Cache amltMemory) { |
| it.name = amltMemory.name |
| } |
| |
| } |