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);
private void addModuleConfig(DeploymentContext dc, Application application) { DeployCommandParameters params = dc.getCommandParameters(DeployCommandParameters.class); if (!params.origin.isDeploy()) { return; } try { com.sun.enterprise.config.serverbeans.Application app_w = dc.getTransientAppMetaData(com.sun.enterprise.config.serverbeans.ServerTags.APPLICATION, com.sun.enterprise.config.serverbeans.Application.class); if (app_w != null) { if (application.isVirtual()) { Module modConfig = app_w.createChild(Module.class); app_w.getModule().add(modConfig); modConfig.setName(application.getRegistrationName()); } else { for (ModuleDescriptor moduleDesc : application.getModules()) { Module modConfig = app_w.createChild(Module.class); app_w.getModule().add(modConfig); modConfig.setName(moduleDesc.getArchiveUri()); } } } } catch (Exception e) { Logger.getAnonymousLogger().log(Level.WARNING, "failed to add the module config", e); } }
/** * 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); } }
singleModule.setName(app.getName()); Engine webe = singleModule.createChild(Engine.class); webe.setSniffer("web");