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; } }
/** * return all user visible sniffer engines in an application. * The return format is <sniffer1, sniffer2, ...> * @param module - Application's module * @return sniffer engines */ String getSnifferEngines(final Module module, final boolean format) { return getSniffers (module.getEngines(), format); }
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 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; }
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);
/** * Saves its state to the configuration. this method must be called within a transaction * to the configured module instance. * * @param module the module being persisted */ public void save(Module module) throws TransactionFailure, PropertyVetoException { // write out the module properties only for composite app if (Boolean.valueOf(moduleProps.getProperty( ServerTags.IS_COMPOSITE))) { moduleProps.remove(ServerTags.IS_COMPOSITE); for (Iterator itr = moduleProps.keySet().iterator(); itr.hasNext();) { String propName = (String) itr.next(); Property prop = module.createChild(Property.class); module.getProperty().add(prop); prop.setName(propName); prop.setValue(moduleProps.getProperty(propName)); } } for (EngineRef ref : _getEngineRefs()) { Engine engine = module.createChild(Engine.class); module.getEngines().add(engine); ref.save(engine); } } }
public List<Sniffer> getSniffersFromApp(Application app) { List<String> snifferTypes = new ArrayList<String>(); for (com.sun.enterprise.config.serverbeans.Module module : app.getModule()) { for (Engine engine : module.getEngines()) { snifferTypes.add(engine.getSniffer());
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);
/** * Saves its state to the configuration. this method must be called within a transaction * to the configured module instance. * * @param module the module being persisted */ public void save(Module module) throws TransactionFailure, PropertyVetoException { // write out the module properties only for composite app if (Boolean.valueOf(moduleProps.getProperty( ServerTags.IS_COMPOSITE))) { moduleProps.remove(ServerTags.IS_COMPOSITE); for (Iterator itr = moduleProps.keySet().iterator(); itr.hasNext();) { String propName = (String) itr.next(); Property prop = module.createChild(Property.class); module.getProperty().add(prop); prop.setName(propName); prop.setValue(moduleProps.getProperty(propName)); } } for (EngineRef ref : _getEngineRefs()) { Engine engine = module.createChild(Engine.class); module.getEngines().add(engine); ref.save(engine); } } }
public List<Sniffer> getSniffersFromApp(Application app) { List<String> snifferTypes = new ArrayList<String>(); 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()); } } } }
Engine sece = singleModule.createChild(Engine.class); sece.setSniffer("security"); singleModule.getEngines().add(webe); singleModule.getEngines().add(sece); Server s = (Server) proxies[1]; List<ApplicationRef> arefs = s.getApplicationRef();