@Nullable @Override public FlexyClassLoader installTypeDefinition(Instance instance) { TypeDefinition td = instance.getTypeDefinition(); List<KMFContainer> filters = td.select("deployUnits[]/filters[name=platform,value=java]"); if (filters.size() > 1) { String filtersStr = ""; for (int i=0; i < filters.size(); i++) { filtersStr += filters.get(i).eContainer().path(); if (i < filters.size() - 1) { filtersStr += ", "; } } throw new RuntimeException("Instance " + instance.path() + " has " + filters.size() + " deployUnits ("+filtersStr+") that matches platform \"java\" (must only be one)"); } DeployUnit du = (DeployUnit) filters.get(0).eContainer(); return installDeployUnit(du); }
@Override public ClassLoader installTypeDefinition(Instance instance) throws KevoreeCoreException { TypeDefinition td = instance.getTypeDefinition(); DeployUnit du = validateFilters(instance, td.select("deployUnits[]/filters[name=platform,value=java]")); return installDeployUnit(du); }
private String searchMainClassName(final Instance instance) { TypeDefinition td = instance.getTypeDefinition(); List<KMFContainer> filters = td.select("deployUnits[]/filters[name=platform,value=java]"); if (filters.size() > 1) { String filtersStr = ""; for (int i=0; i < filters.size(); i++) { filtersStr += filters.get(i).eContainer().path(); if (i < filters.size() - 1) { filtersStr += ", "; } } throw new RuntimeException("Instance " + instance.path() + " has " + filters.size() + " deployUnits ("+filtersStr+") that matches platform \"java\" (must only be one)"); } DeployUnit du = (DeployUnit) filters.get(0).eContainer(); String tag = "class:" + td.getName() + ":" + td.getVersion(); Value tdefClassName = du.findFiltersByID(tag); if (tdefClassName != null) { return tdefClassName.getValue(); } else { throw new RuntimeException("Cannot find meta-data \"" + tag + "\" in DeployUnit " + du.getHashcode() + "/" + du.getName() + "/" + du.getVersion()); } }
private String searchMainClassName(final Instance instance) throws KevoreeCoreException { TypeDefinition td = instance.getTypeDefinition(); DeployUnit du = validateFilters(instance, td.select("deployUnits[]/filters[name=platform,value=java]")); String tag = "class:" + td.getName() + ":" + td.getVersion(); Value tdefClassName = du.findFiltersByID(tag); if (tdefClassName != null) { return tdefClassName.getValue(); } else { throw new RuntimeException("Cannot find meta-data \"" + tag + "\" in DeployUnit " + du.getHashcode() + "/" + du.getName() + "/" + du.getVersion()); } }
public boolean execute() { List<KMFContainer> metas = c.getTypeDefinition().select("deployUnits[]/filters[name=platform,value=java]"); if (metas.isEmpty()) { Log.error("No DeployUnit found for '" + c.getName() + ": " + c.getTypeDefinition().getName() + "/" + c.getTypeDefinition().getVersion() + "' that matches the 'java' platform"); return false; } Thread subThread = null; try { tg = new KevoreeThreadGroup("kev/" + c.path()); subThread = new Thread(tg, this); subThread.start(); subThread.join(); return resultSub; } catch (Throwable e) { if (subThread != null) { try { //subThread.stop(); //kill sub thread subThread.interrupt(); } catch (Throwable t) { //ignore killing thread } } Log.error("Could not add the instance {}:{}", c.getName(), c.getTypeDefinition().getName(), e); return false; } }