private Map<String, String> getRepositories(DeployUnit deployUnit) { Map<String, String> repositories = new HashMap<>(); // hacky way to treat Maven repositories as I don't want to change the Kevoree MM for (Value val : deployUnit.getFilters()) { if (val.getName().startsWith("repo_")) { repositories.put(val.getName().substring(5), val.getValue()); } } return repositories; }
@NotNull @Override public void injectDictionaryValue(Value dictionaryValue, Object target) { internalInjectField(dictionaryValue.getName(), dictionaryValue.getValue(), target); }
private ConfigurableMavenResolverSystem getResolver(DeployUnit deployUnit) { String offlineProp = System.getProperty("offline", "false"); boolean offline = Boolean.valueOf(offlineProp); ConfigurableMavenResolverSystem resolver = Maven .configureResolver() .useLegacyLocalRepo(true) .workOffline(offline); try { LogManager.getLogManager().readConfiguration(new FileInputStream(propFile)); } catch (IOException e) { throw new RuntimeException("Unable to read " + propFile.getAbsolutePath()); } // hacky way to treat Maven repositories as I don't want to change the Kevoree MM for (Value val : deployUnit.getFilters()) { if (val.getName().startsWith("repo_")) { try { resolver.withRemoteRepo(val.getName().substring(5), new URL(val.getValue()), "default"); } catch (MalformedURLException e) { throw new RuntimeException("Invalid repository URL: " + val.getValue()); } } } return resolver; }
private void debug(Value value) { Instance instance = (Instance) value.eContainer().eContainer(); DictionaryAttribute attr = instance.getTypeDefinition().getDictionaryType().findAttributesByID(value.getName()); if (attr.getFragmentDependant()) { Log.debug("Update param for {}.{}/{} = '{}'", instance.getName(), value.getName(), ((NamedElement) value.eContainer()).getName(), value.getValue()); } else { Log.debug("Update param for {}.{} = '{}'", instance.getName(), value.getName(), value.getValue()); } }
} else { Instance instance = (Instance) dicValue.eContainer().eContainer(); DictionaryAttribute dicAtt = instance.getTypeDefinition().getDictionaryType().findAttributesByID(dicValue.getName()); if (dicAtt.getDefaultValue() != null && !dicAtt.getDefaultValue().equals("")) { valueToInject = dicAtt.getDefaultValue(); Value fakeDicoValue = new DefaultKevoreeFactory().createValue(); fakeDicoValue.setValue(valueToInject); fakeDicoValue.setName(dicValue.getName()); Object reffoundO = registry.lookup(c); if (reffoundO != null) {
if (previousInstance != null) { DictionaryType dt = instance.getTypeDefinition().getDictionaryType(); DictionaryAttribute dicAtt = dt.findAttributesByID(dicValue.getName()); if (dicAtt != null && dicAtt.getDefaultValue() != null && dicAtt.getDefaultValue().equals(dicValue.getValue())) {
param.setValue(attr.getDefaultValue()); node.getDictionary().addValues(param); Log.debug("Set default node param: {} = '{}'", param.getName(), param.getValue());