diff --git a/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/Activator.java b/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/Activator.java index d9758352b4..1cbdc5b975 100644 --- a/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/Activator.java +++ b/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/Activator.java @@ -36,6 +36,7 @@ import org.osgi.framework.Constants; * has been started * Mar 05, 2013 1754 djohnson Catch exceptions and allow as much of the Spring container to boot as possible. * May 23, 2013 2005 njensen Added springSuccess flag + * Nov 12, 2013 2361 njensen Print out time spent on each spring context * * * @@ -153,10 +154,11 @@ public class Activator implements BundleActivator { } try { + long t0 = System.currentTimeMillis(); if (parentContexts.size() > 0) { // Context with parent context appCtx = new OSGIXmlApplicationContext( - new OSGIGroupApplicationContext( + new OSGIGroupApplicationContext(bundle, parentContexts), files.toArray(new String[0]), bundle); } else { @@ -164,6 +166,9 @@ public class Activator implements BundleActivator { appCtx = new OSGIXmlApplicationContext( files.toArray(new String[0]), bundle); } + System.out.println("Bundle " + bundle.getSymbolicName() + + " spring init took: " + + (System.currentTimeMillis() - t0)); } catch (Throwable t) { // No access to the statusHandler yet, so print the // stack trace to the console. By catching this, we also diff --git a/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/OSGIGroupApplicationContext.java b/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/OSGIGroupApplicationContext.java index 0396b29a7c..1411d6aaf8 100644 --- a/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/OSGIGroupApplicationContext.java +++ b/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/OSGIGroupApplicationContext.java @@ -21,6 +21,7 @@ package com.raytheon.uf.viz.spring.dm; import java.util.List; +import org.osgi.framework.Bundle; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.context.support.GenericApplicationContext; @@ -35,7 +36,8 @@ import org.springframework.context.support.GenericApplicationContext; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Nov 1, 2012 mschenke Initial creation + * Nov 01, 2012 mschenke Initial creation + * Nov 12, 2013 2361 njensen call setDisplayName() * * * @@ -45,8 +47,9 @@ import org.springframework.context.support.GenericApplicationContext; public class OSGIGroupApplicationContext extends GenericApplicationContext { - public OSGIGroupApplicationContext( + public OSGIGroupApplicationContext(Bundle child, List contextGroup) { + this.setDisplayName("parent of " + child.getSymbolicName()); refresh(); // refresh first to avoid recreating bean definitions DefaultListableBeanFactory factory = getDefaultListableBeanFactory(); // Register all bean definitions from other contexts into our factory diff --git a/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/OSGIXmlApplicationContext.java b/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/OSGIXmlApplicationContext.java index 7ccfb4c6a2..86d4d543cb 100644 --- a/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/OSGIXmlApplicationContext.java +++ b/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/OSGIXmlApplicationContext.java @@ -34,7 +34,8 @@ import org.springframework.context.support.AbstractXmlApplicationContext; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Oct 30, 2012 mschenke Initial creation + * Oct 30, 2012 mschenke Initial creation + * Nov 12, 2013 2361 njensen call setDisplayName() * * * @@ -53,6 +54,7 @@ public class OSGIXmlApplicationContext extends AbstractXmlApplicationContext { super(parent); setClassLoader(new OSGIXmlClassLoader(bundle, getClassLoader())); setConfigLocations(configLocations); + this.setDisplayName(bundle.getSymbolicName()); refresh(); }