Not every commit needs one. I ask myself these two questions (which are really the same question):
- will a user want to know about this? - should this appear in the release notes? If the answer to either of those questions is, yes, then I file a jira. If it takes several commits to implement feature FOO-123, try to mention FOO-123 in all the commits. That's more to help the review process at the end of a release. I'll actually pick through the commits that don't have JIRAs and file JIRAs as needed. Anything that already has a JIRA on it is skipped, so adding one saves me a ton of time. -David On Apr 17, 2012, at 11:40 AM, dsh wrote: > You could start to script such reminder mails :) > > On Tue, Apr 17, 2012 at 8:21 PM, David Blevins <[email protected]> > wrote: >> Jira :) >> >> On Apr 17, 2012, at 7:07 AM, [email protected] wrote: >> >>> Author: rmannibucau >>> Date: Tue Apr 17 14:07:02 2012 >>> New Revision: 1327103 >>> >>> URL: http://svn.apache.org/viewvc?rev=1327103&view=rev >>> Log: >>> starting work to undeploy app resources with the app undeployment >>> >>> Modified: >>> >>> openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/AppInfo.java >>> >>> openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java >>> >>> openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java >>> >>> openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java >>> >>> openejb/trunk/openejb/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/OpenEJBXmlByModuleTest.java >>> >>> Modified: >>> openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/AppInfo.java >>> URL: >>> http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/AppInfo.java?rev=1327103&r1=1327102&r2=1327103&view=diff >>> ============================================================================== >>> --- >>> openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/AppInfo.java >>> (original) >>> +++ >>> openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/AppInfo.java >>> Tue Apr 17 14:07:02 2012 >>> @@ -36,7 +36,7 @@ public class AppInfo extends InfoObject >>> public final List<PersistenceUnitInfo> persistenceUnits = new >>> ArrayList<PersistenceUnitInfo>(); >>> public final List<String> libs = new ArrayList<String>(); >>> public final Set<String> watchedResources = new TreeSet<String>(); >>> - public final Set<ResourceInfo> resourceInfos = new >>> TreeSet<ResourceInfo>(); >>> + public final Set<String> resourceIds = new TreeSet<String>(); >>> public final JndiEncInfo globalJndiEnc = new JndiEncInfo(); >>> public final JndiEncInfo appJndiEnc = new JndiEncInfo(); >>> public String cmpMappingsXml; >>> >>> Modified: >>> openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java >>> URL: >>> http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java?rev=1327103&r1=1327102&r2=1327103&view=diff >>> ============================================================================== >>> --- >>> openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java >>> (original) >>> +++ >>> openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java >>> Tue Apr 17 14:07:02 2012 >>> @@ -1333,6 +1333,14 @@ public class Assembler extends Assembler >>> } >>> } >>> >>> + for (String id : appInfo.resourceIds) { >>> + try { >>> + >>> containerSystem.getJNDIContext().unbind(OPENEJB_RESOURCE_JNDI_PREFIX + id); >>> + } catch (NamingException e) { >>> + logger.warning("can't unbind resource '{0}'", id); >>> + } >>> + } >>> + >>> containerSystem.removeAppContext(appInfo.appId); >>> >>> ClassLoaderUtil.destroyClassLoader(appInfo.path); >>> @@ -1810,6 +1818,7 @@ public class Assembler extends Assembler >>> for (String property : unsetProperties.keySet()) { >>> //TODO: DMB: Make more robust later >>> if (property.equalsIgnoreCase("properties")) return; >>> + if (property.equalsIgnoreCase("ApplicationWide")) return; >>> if (property.equalsIgnoreCase("transactionManager")) return; >>> if (info.types.contains("javax.mail.Session")) return; >>> //--- >>> >>> Modified: >>> openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java >>> URL: >>> http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java?rev=1327103&r1=1327102&r2=1327103&view=diff >>> ============================================================================== >>> --- >>> openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java >>> (original) >>> +++ >>> openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java >>> Tue Apr 17 14:07:02 2012 >>> @@ -272,14 +272,15 @@ class AppInfoBuilder { >>> >>> private void buildAppResources(AppModule module, AppInfo info) { >>> for (Resource def : module.getResources()) { >>> - ResourceInfo resourceInfo = new ResourceInfo(); >>> - resourceInfo.id = module.getModuleId() + "/" + >>> def.getJndi().replace("java:", ""); >>> - >>> - resourceInfo.service = "Resource"; >>> - resourceInfo.types.add(def.getType()); >>> - resourceInfo.properties = def.getProperties(); >>> - >>> - info.resourceInfos.add(resourceInfo); >>> + // the resource is already deployed >>> + // however we keep its id to be able to undeployed it later >>> + // note: if ApplicationWide property was specified >>> + // we want this application be managed only by the container >>> + // once deployed = not undeployed with the app >>> + // so we skip the undeployement skipping the id >>> + if (!def.getProperties().containsKey("ApplicationWide")) { >>> + info.resourceIds.add(def.getId()); >>> + } >>> } >>> } >>> >>> >>> Modified: >>> openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java >>> URL: >>> http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java?rev=1327103&r1=1327102&r2=1327103&view=diff >>> ============================================================================== >>> --- >>> openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java >>> (original) >>> +++ >>> openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java >>> Tue Apr 17 14:07:02 2012 >>> @@ -858,6 +858,7 @@ public class AutoConfig implements Dynam >>> } >>> >>> final List<ResourceInfo> resourceInfos = new >>> ArrayList<ResourceInfo>(); >>> + final Map<ResourceInfo, Resource> resourcesMap = new >>> HashMap<ResourceInfo, Resource>(resources.size()); >>> for (Resource resource : resources) { >>> Properties properties = resource.getProperties(); >>> >>> @@ -901,15 +902,17 @@ public class AutoConfig implements Dynam >>> } >>> >>> resourceInfos.add(resourceInfo); >>> + resourcesMap.put(resourceInfo, resource); >>> } >>> >>> Collections.sort(resourceInfos, new >>> ConfigurationFactory.ResourceInfoComparator(resourceInfos)); >>> for (ResourceInfo resourceInfo : resourceInfos) { >>> - installResource(module.getModuleId(), resourceInfo); >>> + final String id = installResource(module.getModuleId(), >>> resourceInfo); >>> + resourcesMap.remove(resourceInfo).setId(id); >>> } >>> >>> resourceInfos.clear(); >>> - resources.clear(); >>> + // resources.clear(); // don't clear it since we want to keep this >>> to be able to undeploy resources with the app >>> } >>> >>> private String dataSourceLookupName(Resource datasource) { >>> >>> Modified: >>> openejb/trunk/openejb/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/OpenEJBXmlByModuleTest.java >>> URL: >>> http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/OpenEJBXmlByModuleTest.java?rev=1327103&r1=1327102&r2=1327103&view=diff >>> ============================================================================== >>> --- >>> openejb/trunk/openejb/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/OpenEJBXmlByModuleTest.java >>> (original) >>> +++ >>> openejb/trunk/openejb/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/OpenEJBXmlByModuleTest.java >>> Tue Apr 17 14:07:02 2012 >>> @@ -16,7 +16,15 @@ >>> */ >>> package org.apache.openejb.assembler.classic; >>> >>> +import java.io.IOException; >>> +import java.util.Properties; >>> +import javax.annotation.Resource; >>> +import javax.naming.Context; >>> +import javax.naming.InitialContext; >>> +import javax.naming.NamingException; >>> +import javax.sql.DataSource; >>> import org.apache.commons.dbcp.BasicDataSource; >>> +import org.apache.openejb.OpenEJB; >>> import org.apache.openejb.OpenEJBException; >>> import org.apache.openejb.config.AppModule; >>> import org.apache.openejb.config.ConfigurationFactory; >>> @@ -28,14 +36,6 @@ import org.junit.After; >>> import org.junit.Before; >>> import org.junit.Test; >>> >>> -import javax.annotation.Resource; >>> -import javax.naming.Context; >>> -import javax.naming.InitialContext; >>> -import javax.naming.NamingException; >>> -import javax.sql.DataSource; >>> -import java.io.IOException; >>> -import java.util.Properties; >>> - >>> import static junit.framework.Assert.assertEquals; >>> import static junit.framework.Assert.assertNotNull; >>> import static junit.framework.Assert.assertTrue; >>> @@ -63,6 +63,9 @@ public class OpenEJBXmlByModuleTest { >>> >>> Properties properties = new Properties(); >>> >>> properties.setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY, >>> LocalInitialContextFactory.class.getName()); >>> + properties.setProperty("openejb.embedded.initialcontext.close", >>> "destroy"); >>> + >>> + // some hack to be sure to call destroy() >>> context = new InitialContext(properties); >>> >>> bean = (UselessBean) context.lookup("UselessBeanLocalBean"); >>> @@ -71,6 +74,7 @@ public class OpenEJBXmlByModuleTest { >>> @After public void close() throws NamingException { >>> if (context != null) { >>> context.close(); >>> + OpenEJB.destroy(); // has to be called manually since we start >>> openejb in a custom way >>> } >>> } >>> >>> >>> >>> >>
