blob: 0d433414b7c5665ad153c3bb3b057632a535e004 [file] [log] [blame]
/*******************************************************************************
* 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.LoggerFactory
import org.slf4j.Logger
@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
}
}