/** * 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); } } }
/** * 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); } } }
app.getModule().add(singleModule); singleModule.setName(app.getName()); Engine webe = singleModule.createChild(Engine.class); webe.setSniffer("web"); Engine sece = singleModule.createChild(Engine.class); sece.setSniffer("security"); singleModule.getEngines().add(webe);
private static void createModuleScopedResources(Application app, Module module, List<org.glassfish.resource.common.Resource> resources, DeploymentContext dc, boolean embedded) throws ResourceException { try { if (resources != null) { Resources msc = dc.getTransientAppMetaData(module.getName()+"-resources", Resources.class); if (msc == null) { msc = module.createChild(Resources.class); module.setResources(msc); dc.addTransientAppMetaData(module.getName()+"-resources", msc); ApplicationInfo appInfo = appRegistry.get(app.getName()); if(appInfo != null){ appInfo.addTransientAppMetaData(module.getName()+"-resources", msc); } } createConfig(msc, resources, embedded); preserveResources(msc, app.getName(), module.getName()); } } catch (Exception e) { Object params[] = new Object[]{module.getName(),app.getName(), e}; _logger.log(Level.SEVERE, "gf.resources.module.scope.deployment.failure", params); throw new ResourceException(e); } }
private void createModuleScopedResources(Application app, Module module, List<org.glassfish.resources.api.Resource> resources, DeploymentContext dc, boolean embedded) throws ResourceException { try { if (resources != null) { Resources msc = dc.getTransientAppMetaData(module.getName()+"-resources", Resources.class); if (msc == null) { msc = module.createChild(Resources.class); module.setResources(msc); dc.addTransientAppMetaData(module.getName()+"-resources", msc); ApplicationInfo appInfo = appRegistry.get(app.getName()); if(appInfo != null){ appInfo.addTransientAppMetaData(module.getName()+"-resources", msc); } } createConfig(msc, resources, embedded); preserveResources(msc, app.getName(), module.getName()); } } catch (Exception e) { Object params[] = new Object[]{module.getName(),app.getName(), e}; _logger.log(Level.SEVERE, "gf.resources.module.scope.deployment.failure", params); throw new ResourceException(e); } }