private List<Engine> getAppEngines(final Application app) { final 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()); } return engineList; }
public Object run(Application application) throws PropertyVetoException, TransactionFailure { Module module = application.createChild(Module.class); module.setName(application.getName()); for (Engine engine : application.getEngine()) { module.getEngines().add(engine); } application.getModule().add(module); application.getEngine().clear(); return null; } }, app);
public Object run(Application application) throws PropertyVetoException, TransactionFailure { Module module = application.createChild(Module.class); module.setName(application.getName()); for (Engine engine : application.getEngine()) { module.getEngines().add(engine); } application.getModule().add(module); application.getEngine().clear(); return null; } }, app);
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; }
/** * Saves its state to the configuration. this method must be called within a transaction * to the configured Application instance. * * @param app the application being persisted */ public void save(Application app) throws TransactionFailure, PropertyVetoException { for (EngineRef ref : engines) { Engine engine = app.createChild(Engine.class); app.getEngine().add(engine); ref.save(engine); } for (ModuleInfo module : modules) { Module modConfig = app.getModule(module.getName()); if (modConfig == null) { // not a JavaEE module, create it here modConfig = app.createChild(Module.class); modConfig.setName(module.getName()); app.getModule().add(modConfig); } module.save(modConfig); } }
/** * Saves its state to the configuration. this method must be called within a transaction * to the configured Application instance. * * @param app the application being persisted */ public void save(Application app) throws TransactionFailure, PropertyVetoException { for (EngineRef ref : engines) { Engine engine = app.createChild(Engine.class); app.getEngine().add(engine); ref.save(engine); } for (ModuleInfo module : modules) { Module modConfig = app.getModule(module.getName()); if (modConfig == null) { // not a JavaEE module, create it here modConfig = app.createChild(Module.class); modConfig.setName(module.getName()); app.getModule().add(modConfig); } module.save(modConfig); } }