public static Engine getEngine(Module instance, String snifferName) { for (Engine engine : instance.getEngines()) { if (engine.getSniffer().equals(snifferName)) { return engine; } } return null; } }
public static Engine getEngine(Module instance, String snifferName) { for (Engine engine : instance.getEngines()) { if (engine.getSniffer().equals(snifferName)) { return engine; } } return null; } }
/** * check the type of application by comparing the sniffer engine. * @param app - Application * @param type - type of application * @return true if application is of the specified type else return * false. */ boolean isApplicationOfThisType(final Application app, String type) { // do the type conversion to be compatible with v2 syntax if (type.equals("application")) { type = "ear"; } else if (type.equals("webservice")) { type = "webservices"; } List <Engine> engineList = getAppEngines(app); for (Engine engine : engineList) { if (engine.getSniffer().equals(type)) { return true; } } return false; }
private String getSniffers(final List<Engine> engineList, final boolean format) { Set<String> snifferSet = new LinkedHashSet<String>(); for (Engine engine : engineList) { final String engType = engine.getSniffer(); if (displaySnifferEngine(engType)) { snifferSet.add(engine.getSniffer()); } } StringBuffer se = new StringBuffer(); if (!snifferSet.isEmpty()) { if (format) { se.append("<"); } for (String sniffer : snifferSet) { se.append(sniffer + ", "); } //eliminate the last "," and end the list with ">" if (se.length()>2) { se.replace(se.length()-2, se.length(), (format)?">":""); } else if (format) { se.append(">"); } } return se.toString(); }
public static boolean containsSnifferType(Application app, String snifferType) { List<Engine> engineList = new ArrayList<Engine>(); // first add application level engines engineList.addAll(app.getEngine()); // now add module level engines for (Module module : app.getModule()) { engineList.addAll(module.getEngines()); } for (Engine engine : engineList) { if (engine.getSniffer().equals(snifferType)) { return true; } } return false; }
public static boolean containsSnifferType(Application app, String snifferType) { List<Engine> engineList = new ArrayList<Engine>(); // first add application level engines engineList.addAll(app.getEngine()); // now add module level engines for (Module module: app.getModule()) { engineList.addAll(module.getEngines()); } for (Engine engine : engineList) { if (engine.getSniffer().equals(snifferType)) { return true; } } return false; }
for (com.sun.enterprise.config.serverbeans.Module module : app.getModule()) { for (Engine engine : module.getEngines()) { snifferTypes.add(engine.getSniffer());
for (com.sun.enterprise.config.serverbeans.Module module : app.getModule()) { for (Engine engine : module.getEngines()) { snifferTypes.add(engine.getSniffer());
private boolean isApplicationOfThisType(String name, String type) { if (type == null) { return true; } Application app = applications.getApplication(name); if (app != null) { if (!app.isStandaloneModule()) { if (type.equals("ear")) { return true; } else { return false; } } for (Module module : app.getModule()) { final List<Engine> engineList = module.getEngines(); for (Engine engine : engineList) { if (engine.getSniffer().equals(type)) { return true; } } } } return false; }
public ApplicationConfigInfo(final Application app) { moduleToEngineToAppConfig = createNewMap(); if (app != null) { for (Module m : app.getModule()) { for (Engine e : m.getEngines()) { put(m.getName(), e.getSniffer(), e.getApplicationConfig()); } } } }