You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by am...@apache.org on 2005/12/04 03:36:25 UTC
svn commit: r353802 [2/2] - in /geronimo/trunk:
applications/console-core/src/java/org/apache/geronimo/console/core/jms/
applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/
applications/console-standard/src/java/org/...
Modified: geronimo/trunk/modules/spring/src/java/org/apache/geronimo/spring/SpringGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/spring/src/java/org/apache/geronimo/spring/SpringGBean.java?rev=353802&r1=353801&r2=353802&view=diff
==============================================================================
--- geronimo/trunk/modules/spring/src/java/org/apache/geronimo/spring/SpringGBean.java (original)
+++ geronimo/trunk/modules/spring/src/java/org/apache/geronimo/spring/SpringGBean.java Sat Dec 3 18:35:42 2005
@@ -26,6 +26,7 @@
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Set;
+import java.io.Serializable;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
@@ -49,311 +50,272 @@
*
* @version $Rev$
*/
-public class SpringGBean
- implements GBeanLifecycle
-{
- protected static final Log _log = LogFactory.getLog(SpringGBean.class);
-
- // injected into ctor
- protected final Kernel _kernel;
- protected final String _objectName;
- protected final ClassLoader _classLoader;
- protected final URI[] _classPath;
- protected final URL _configurationBaseUrl;
- protected final URI _configPath;
-
- protected ClassLoader _appClassLoader;
- protected ObjectName _jmxName;
- protected DefaultListableBeanFactory _factory;
-
- //----------------------------------------
- public static final GBeanInfo GBEAN_INFO;
-
- static
- {
- GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic("Spring Application Context", SpringGBean.class);
-
- infoBuilder.addAttribute("kernel" , Kernel.class , false);
- infoBuilder.addAttribute("objectName" , String.class , false);
- infoBuilder.addAttribute("classLoader" , ClassLoader.class , false);
- infoBuilder.addAttribute("classPath" , URI[].class , true);
- infoBuilder.addAttribute("configurationBaseUrl" , URL.class , true);
- infoBuilder.addAttribute("configPath" , URI.class , true);
-
- infoBuilder.setConstructor(new String[]{
- "kernel",
- "objectName",
- "classLoader",
- "classPath",
- "configurationBaseUrl",
- "configPath"
- });
-
- GBEAN_INFO = infoBuilder.getBeanInfo();
- }
-
- public static GBeanInfo getGBeanInfo() {return GBEAN_INFO;}
-
- //----------------------------------------
-
-
- public
- SpringGBean(Kernel kernel, String objectName, ClassLoader classLoader, URI[] classPath, URL configurationBaseUrl, URI configPath)
- {
- _kernel =kernel;
- _objectName =objectName;
- _configPath =configPath;
- _classLoader =classLoader;
- _classPath =classPath;
- _configurationBaseUrl =configurationBaseUrl;
- }
-
- //----------------------------------------
- // GBeanLifecycle
- //----------------------------------------
-
- class GeronimoBeanFactory
- extends DefaultListableBeanFactory
- {
- GeronimoBeanFactory(){super();}
- }
-
- public void
- doStart()
- throws Exception
- {
- _jmxName=new ObjectName(_objectName);
-
- // set up classloader
- URI root = URI.create(_configurationBaseUrl.toString());
-
- URL[] urls=new URL[_classPath.length];
-
- for (int i=0; i<_classPath.length; i++)
- {
- URL url=root.resolve(_classPath[i]).toURL();
- _log.info("_classPath["+i+"]: "+url);
- urls[i]=url;
- }
-
- _appClassLoader=new URLClassLoader(urls, _classLoader);
-
- // delegate work to Spring framework...
- _factory=new GeronimoBeanFactory();
- XmlBeanDefinitionReader xbdr=new XmlBeanDefinitionReader(_factory);
- xbdr.setBeanClassLoader(_appClassLoader);
- xbdr.loadBeanDefinitions(new ClassPathResource(_configPath.toString(), _appClassLoader));
-
- // install aspects around Spring Bean initialisation...
- _factory.addBeanPostProcessor(new BeanPostProcessor() {
- public Object postProcessBeforeInitialization(Object bean, String name) throws BeansException {
- return beforeInitialization(bean, name);
- }
-
- public Object postProcessAfterInitialization(Object bean, String name) throws BeansException {
- return afterInitialization(bean, name);
- }
- });
-
- // force lazy construction of every bean described... - is there a better way - ROB ?
- String[] ids=_factory.getBeanDefinitionNames();
- int n=ids.length;
- for (int i=n; i>0; i--)
- _factory.getBean(ids[i-1]);
-
- _log.info("Deployed: "+n+" POJO"+(n==1?"":"s"));
- }
-
-
- public void
- doStop()
- throws Exception
- {
- tidyUp();
- }
-
- public void
- doFail()
- {
- try
- {
- tidyUp();
- }
- catch (Exception e)
- {
- _log.warn("problem decommissioning Spring module: "+_jmxName, e);
- }
- }
-
- protected void
- tidyUp()
- throws Exception
- {
- // can we put this as a spring aspect around each POJO ? would be better...
- String pattern=_jmxName.getDomain()+":J2EEApplication="+_jmxName.getKeyProperty("J2EEApplication")+",J2EEServer="+_jmxName.getKeyProperty("J2EEServer")+",SpringModule="+_jmxName.getKeyProperty("name")+",j2eeType=SpringBean,*";
- ObjectName on=new ObjectName(pattern);
-
- // can't we do it like this - much less typo-prone...
- // Hashtable props =new Hashtable(_jmxName.getKeyPropertyList());
- // props.put("SpringModule" , props.get("name"));
- // props.put("j2eeType" , "SpringBean");
- // props.remove("name");
- // props.put("*", "");
- // ObjectName on=new ObjectName(_jmxName.getDomain(), props);
-
- Set peers=_kernel.listGBeans(on);
- for (Iterator i=peers.iterator(); i.hasNext();)
- {
- ObjectName tmp=(ObjectName)i.next();
- try
- {
- _log.info("stopping: "+tmp);
- _kernel.stopGBean(tmp);
- _log.info("unloading: "+tmp);
- _kernel.unloadGBean(tmp);
- }
- catch (Exception e)
- {
- _log.warn("problem decommissioning POJO peer GBean: "+tmp, e);
- }
- }
-
- _factory.destroySingletons();
- }
-
- //----------------------------------------
- // aspects around Spring Bean creation...
- //----------------------------------------
-
- /**
- * Hook to perform action before Spring Bean initialisation.
- */
- protected Object
- beforeInitialization(Object bean, String name)
- {
- return bean;
- }
-
- /**
- * Hook to perform action after Spring Bean initialisation.
- */
- protected Object
- afterInitialization(Object bean, String name)
- throws BeansException
- {
- // create a GBean peer...
- try
- {
- GBeanData gd=createPOJOGBeanData(bean, name);
- if (gd==null)
- _log.warn("No GBean available for name: " + name + " bean: " + bean);
- else
- {
- _log.info("proxying: "+bean);
- _log.info("loading: "+gd.getName());
- // _kernel.loadGBeanProxy(bean, gd, _appClassLoader);
- _kernel.loadGBean(gd, _appClassLoader);
- _log.info("starting: "+gd.getName());
- _kernel.startGBean(gd.getName());
- }
- }
- catch (Exception e)
- {
- throw new BeanDefinitionValidationException("Could not load the GBean for name: " + name + " bean: " + bean + ". Reason: " + e, e);
- }
- return bean;
- }
-
- //----------------------------------------
- // utils...
- //----------------------------------------
-
- /**
- * Factory method to create an ObjectName for the Spring bean
- *
- * @param name the name of the bean in the Spring config file
- * @return the ObjectName to use for the given Spring bean name
- */
- protected ObjectName
- createObjectName(String name)
- throws MalformedObjectNameException
- {
- Hashtable props =new Hashtable(_jmxName.getKeyPropertyList());
- props.put("SpringModule" , props.get("name"));
- props.put("j2eeType" , "SpringBean");
- props.put("name" , name);
- return new ObjectName(_jmxName.getDomain(), props);
- }
-
- protected int _count=0; // we should use a Spring generated unique name here - TODO
-
- public static class InvocationHandler
- implements java.lang.reflect.InvocationHandler, java.io.Serializable
- {
- protected Object _pojo;
-
- public
- InvocationHandler(Object pojo) {_pojo=pojo;}
-
- public Object
- invoke(Object proxy, Method method, Object[] args)
- throws Throwable
- {
- return _pojo.getClass().getMethod(method.getName(), method.getParameterTypes()).invoke(_pojo, args);
- }
- }
-
- protected synchronized GBeanData
- createPOJOGBeanData(Object bean, String name)
- throws MalformedObjectNameException
- {
- Class c=createProxyClass(bean);
- GBeanInfoBuilder gbif = GBeanInfoBuilder.createStatic(c, "POJO["+(_count++)+"]");
-
- gbif.addAttribute("invocationHandler", java.lang.reflect.InvocationHandler.class, true);
- gbif.setConstructor(new String[]{"invocationHandler"});
- // describe the rest of the POJOs public API
- Set pm=new HashSet();
- Method[] methods=c.getMethods();
- for (int i=0;i<methods.length;i++)
- {
- Method m=methods[i];
- String n=m.getName();
- Class[] pt=m.getParameterTypes();
- Class rt=m.getReturnType();
-
- // ugly way of collecting Bean property names - maybe we can get this from Spring ?
- if ((n.startsWith("get") && pt.length==0) || (n.startsWith("set") && pt.length==1 && rt==Void.TYPE))
- pm.add(n.substring(3,4).toLowerCase()+n.substring(4));
- }
-
- // pm.remove("class"); // do we want this available ?
- gbif.addInterface(c, (String[])pm.toArray(new String[pm.size()]));
- //gbif.addInterface(c);
- GBeanData gbd=new GBeanData(createObjectName(name), gbif.getBeanInfo());
- // ensure the injection of the InvocationHandler into the newly instantiated Proxy
- gbd.setAttribute("invocationHandler" , new InvocationHandler(bean));
-
- return gbd;
- }
-
- // We have to create a proxy here because the kernel only accepts
- // classes from which to instantiate GBeanInstance targets, not
- // instances, which is what we get from Spring. So we create a proxy
- // that can be instantiated and injected with an InvocationHandler
- // which will delegate all calls onto the corresponding method on
- // the bean that we wanted to pass in in the first place. Complex
- // syntactic sugar - eh...!
- protected Class
- createProxyClass(Object pojo)
- {
- InterfaceMaker im=new InterfaceMaker();
- im.add(pojo.getClass()); // add all class' public methods...
-
- // if POJO does not implement GBeanLifeCycle should we implement
- // it and dump/reroute it, to be safe ?
-
- Class c=im.create();
- return Proxy.getProxyClass(c.getClassLoader(), new Class[] {c});
- }
+public class SpringGBean implements GBeanLifecycle {
+ protected static final Log _log = LogFactory.getLog(SpringGBean.class);
+
+ // injected into ctor
+ protected final Kernel _kernel;
+ protected final String _objectName;
+ protected final ClassLoader _classLoader;
+ protected final URI[] _classPath;
+ protected final URL _configurationBaseUrl;
+ protected final URI _configPath;
+
+ protected ClassLoader _appClassLoader;
+ protected ObjectName _jmxName;
+ protected DefaultListableBeanFactory _factory;
+
+ //----------------------------------------
+ public static final GBeanInfo GBEAN_INFO;
+
+ static {
+ GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic("Spring Application Context", SpringGBean.class);
+
+ infoBuilder.addAttribute("kernel", Kernel.class, false);
+ infoBuilder.addAttribute("objectName", String.class, false);
+ infoBuilder.addAttribute("classLoader", ClassLoader.class, false);
+ infoBuilder.addAttribute("classPath", URI[].class, true);
+ infoBuilder.addAttribute("configurationBaseUrl", URL.class, true);
+ infoBuilder.addAttribute("configPath", URI.class, true);
+
+ infoBuilder.setConstructor(new String[]{
+ "kernel",
+ "objectName",
+ "classLoader",
+ "classPath",
+ "configurationBaseUrl",
+ "configPath"
+ });
+
+ GBEAN_INFO = infoBuilder.getBeanInfo();
+ }
+
+ public static GBeanInfo getGBeanInfo() {
+ return GBEAN_INFO;
+ }
+
+ //----------------------------------------
+
+
+ public SpringGBean(Kernel kernel, String objectName, ClassLoader classLoader, URI[] classPath, URL configurationBaseUrl, URI configPath) {
+ _kernel = kernel;
+ _objectName = objectName;
+ _configPath = configPath;
+ _classLoader = classLoader;
+ _classPath = classPath;
+ _configurationBaseUrl = configurationBaseUrl;
+ }
+
+ //----------------------------------------
+ // GBeanLifecycle
+ //----------------------------------------
+
+ class GeronimoBeanFactory extends DefaultListableBeanFactory {
+ GeronimoBeanFactory() {
+ super();
+ }
+ }
+
+ public void doStart() throws Exception {
+ _jmxName = new ObjectName(_objectName);
+
+ // set up classloader
+ URI root = URI.create(_configurationBaseUrl.toString());
+
+ URL[] urls = new URL[_classPath.length];
+
+ for (int i = 0; i < _classPath.length; i++) {
+ URL url = root.resolve(_classPath[i]).toURL();
+ _log.debug("_classPath[" + i + "]: " + url);
+ urls[i] = url;
+ }
+
+ _appClassLoader = new URLClassLoader(urls, _classLoader);
+
+ // delegate work to Spring framework...
+ _factory = new GeronimoBeanFactory();
+ XmlBeanDefinitionReader xbdr = new XmlBeanDefinitionReader(_factory);
+ xbdr.setBeanClassLoader(_appClassLoader);
+ xbdr.loadBeanDefinitions(new ClassPathResource(_configPath.toString(), _appClassLoader));
+
+ // install aspects around Spring Bean initialisation...
+ _factory.addBeanPostProcessor(new BeanPostProcessor() {
+ public Object postProcessBeforeInitialization(Object bean, String name) throws BeansException {
+ return beforeInitialization(bean, name);
+ }
+
+ public Object postProcessAfterInitialization(Object bean, String name) throws BeansException {
+ return afterInitialization(bean, name);
+ }
+ });
+
+ // force lazy construction of every bean described... - is there a better way - ROB ?
+ String[] ids = _factory.getBeanDefinitionNames();
+ int n = ids.length;
+ for (int i = n; i > 0; i--)
+ _factory.getBean(ids[i - 1]);
+
+ _log.debug("Deployed: " + n + " POJO" + (n == 1 ? "" : "s"));
+ }
+
+
+ public void doStop() throws Exception {
+ tidyUp();
+ }
+
+ public void doFail() {
+ try {
+ tidyUp();
+ }
+ catch (Exception e) {
+ _log.warn("problem decommissioning Spring module: " + _jmxName, e);
+ }
+ }
+
+ protected void tidyUp() throws Exception {
+ // can we put this as a spring aspect around each POJO ? would be better...
+ String pattern = _jmxName.getDomain() + ":J2EEApplication=" + _jmxName.getKeyProperty("J2EEApplication") + ",J2EEServer=" + _jmxName.getKeyProperty("J2EEServer") + ",SpringModule=" + _jmxName.getKeyProperty("name") + ",j2eeType=SpringBean,*";
+ ObjectName on = new ObjectName(pattern);
+
+ // can't we do it like this - much less typo-prone...
+ // Hashtable props =new Hashtable(_jmxName.getKeyPropertyList());
+ // props.put("SpringModule" , props.get("name"));
+ // props.put("j2eeType" , "SpringBean");
+ // props.remove("name");
+ // props.put("*", "");
+ // ObjectName on=new ObjectName(_jmxName.getDomain(), props);
+
+ Set peers = _kernel.listGBeans(on);
+ for (Iterator i = peers.iterator(); i.hasNext();) {
+ ObjectName tmp = (ObjectName) i.next();
+ try {
+ _log.debug("stopping: " + tmp);
+ _kernel.stopGBean(tmp);
+ _log.debug("unloading: " + tmp);
+ _kernel.unloadGBean(tmp);
+ }
+ catch (Exception e) {
+ _log.warn("problem decommissioning POJO peer GBean: " + tmp, e);
+ }
+ }
+
+ _factory.destroySingletons();
+ }
+
+ //----------------------------------------
+ // aspects around Spring Bean creation...
+ //----------------------------------------
+
+ /**
+ * Hook to perform action before Spring Bean initialisation.
+ */
+ protected Object beforeInitialization(Object bean, String name) {
+ return bean;
+ }
+
+ /**
+ * Hook to perform action after Spring Bean initialisation.
+ */
+ protected Object afterInitialization(Object bean, String name) throws BeansException {
+ // create a GBean peer...
+ try {
+ GBeanData gd = createPOJOGBeanData(bean, name);
+ if (gd == null)
+ _log.warn("No GBean available for name: " + name + " bean: " + bean);
+ else {
+ _log.debug("proxying: " + bean);
+ _log.debug("loading: " + gd.getName());
+ // _kernel.loadGBeanProxy(bean, gd, _appClassLoader);
+ _kernel.loadGBean(gd, _appClassLoader);
+ _log.debug("starting: " + gd.getName());
+ _kernel.startGBean(gd.getName());
+ }
+ }
+ catch (Exception e) {
+ throw new BeanDefinitionValidationException("Could not load the GBean for name: " + name + " bean: " + bean + ". Reason: " + e, e);
+ }
+ return bean;
+ }
+
+ //----------------------------------------
+ // utils...
+ //----------------------------------------
+
+ /**
+ * Factory method to create an ObjectName for the Spring bean
+ *
+ * @param name the name of the bean in the Spring config file
+ * @return the ObjectName to use for the given Spring bean name
+ */
+ protected ObjectName createObjectName(String name) throws MalformedObjectNameException {
+ Hashtable props = new Hashtable(_jmxName.getKeyPropertyList());
+ props.put("SpringModule", props.get("name"));
+ props.put("j2eeType", "SpringBean");
+ props.put("name", name);
+ return new ObjectName(_jmxName.getDomain(), props);
+ }
+
+ protected int _count = 0; // we should use a Spring generated unique name here - TODO
+
+ public static class InvocationHandler implements java.lang.reflect.InvocationHandler, Serializable {
+ protected Object _pojo;
+
+ public InvocationHandler(Object pojo) {
+ _pojo = pojo;
+ }
+
+ public Object
+ invoke(Object proxy, Method method, Object[] args)
+ throws Throwable {
+ return _pojo.getClass().getMethod(method.getName(), method.getParameterTypes()).invoke(_pojo, args);
+ }
+ }
+
+ protected synchronized GBeanData createPOJOGBeanData(Object bean, String name) throws MalformedObjectNameException {
+ Class c = createProxyClass(bean);
+ GBeanInfoBuilder gbif = GBeanInfoBuilder.createStatic(c, "POJO[" + (_count++) + "]");
+
+ gbif.addAttribute("invocationHandler", java.lang.reflect.InvocationHandler.class, true);
+ gbif.setConstructor(new String[]{"invocationHandler"});
+ // describe the rest of the POJOs public API
+ Set pm = new HashSet();
+ Method[] methods = c.getMethods();
+ for (int i = 0; i < methods.length; i++) {
+ Method m = methods[i];
+ String n = m.getName();
+ Class[] pt = m.getParameterTypes();
+ Class rt = m.getReturnType();
+
+ // ugly way of collecting Bean property names - maybe we can get this from Spring ?
+ if ((n.startsWith("get") && pt.length == 0) || (n.startsWith("set") && pt.length == 1 && rt == Void.TYPE))
+ pm.add(n.substring(3, 4).toLowerCase() + n.substring(4));
+ }
+
+ // pm.remove("class"); // do we want this available ?
+ gbif.addInterface(c, (String[]) pm.toArray(new String[pm.size()]));
+ //gbif.addInterface(c);
+ GBeanData gbd = new GBeanData(createObjectName(name), gbif.getBeanInfo());
+ // ensure the injection of the InvocationHandler into the newly instantiated Proxy
+ gbd.setAttribute("invocationHandler", new InvocationHandler(bean));
+
+ return gbd;
+ }
+
+ // We have to create a proxy here because the kernel only accepts
+ // classes from which to instantiate GBeanInstance targets, not
+ // instances, which is what we get from Spring. So we create a proxy
+ // that can be instantiated and injected with an InvocationHandler
+ // which will delegate all calls onto the corresponding method on
+ // the bean that we wanted to pass in in the first place. Complex
+ // syntactic sugar - eh...!
+ protected Class createProxyClass(Object pojo) {
+ InterfaceMaker im = new InterfaceMaker();
+ im.add(pojo.getClass()); // add all class' public methods...
+
+ // if POJO does not implement GBeanLifeCycle should we implement
+ // it and dump/reroute it, to be safe ?
+
+ Class c = im.create();
+ return Proxy.getProxyClass(c.getClassLoader(), new Class[]{c});
+ }
}
Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/FileConfigurationList.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/FileConfigurationList.java?rev=353802&r1=353801&r2=353802&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/FileConfigurationList.java (original)
+++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/FileConfigurationList.java Sat Dec 3 18:35:42 2005
@@ -215,7 +215,7 @@
try {
save();
} catch (IOException e) {
- log.info("Couldn't save while adding " + configName, e);
+ log.warn("Couldn't save while adding " + configName, e);
}
}
@@ -223,7 +223,7 @@
try {
save();
} catch (IOException e) {
- log.info("Couldnt save while removing " + configName, e);
+ log.warn("Couldnt save while removing " + configName, e);
}
}
Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/jmx/MBeanServerKernelBridge.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/jmx/MBeanServerKernelBridge.java?rev=353802&r1=353801&r2=353802&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/jmx/MBeanServerKernelBridge.java (original)
+++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/jmx/MBeanServerKernelBridge.java Sat Dec 3 18:35:42 2005
@@ -95,7 +95,7 @@
} catch (InstanceAlreadyExistsException e) {
// ignore - gbean already has an mbean shadow object
} catch (Exception e) {
- log.info("Unable to register MBean shadow object for GBean", unwrapJMException(e));
+ log.warn("Unable to register MBean shadow object for GBean", unwrapJMException(e));
}
}
}
@@ -138,7 +138,7 @@
} catch (InstanceAlreadyExistsException e) {
// ignore - gbean already has an mbean shadow object
} catch (Exception e) {
- log.info("Unable to register MBean shadow object for GBean", unwrapJMException(e));
+ log.warn("Unable to register MBean shadow object for GBean", unwrapJMException(e));
}
}
@@ -155,7 +155,7 @@
// ignore - something else may have unregistered us
// if there truely is no GBean then we will catch it below whwn we call the superclass
} catch (Exception e) {
- log.info("Unable to unregister MBean shadow object for GBean", unwrapJMException(e));
+ log.warn("Unable to unregister MBean shadow object for GBean", unwrapJMException(e));
}
}
Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java?rev=353802&r1=353801&r2=353802&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java (original)
+++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java Sat Dec 3 18:35:42 2005
@@ -78,8 +78,6 @@
// Initialization tasks that must run before anything else
initializeSystem();
- // Now logging is available and
- log.info("Server startup begun");
monitor.systemStarting(start);
doStartup();
} else {
@@ -179,7 +177,10 @@
GeronimoEnvironment.init();
// This MUST be done before the first log is acquired (WHICH THE STARTUP MONITOR 5 LINES LATER DOES!)
- GeronimoLogging.initialize(verboseArg == null ? GeronimoLogging.WARN : verboseArg.equals(ARGUMENT_VERBOSE) ? GeronimoLogging.INFO : GeronimoLogging.DEBUG);
+ // Generally we want to suppress anything but WARN until the log GBean starts up
+ GeronimoLogging.initialize(verboseArg == null || verboseArg.equals(ARGUMENT_VERBOSE) ? GeronimoLogging.WARN : GeronimoLogging.DEBUG);
+ // The following will be used once the log GBean starts up
+ GeronimoLogging.setConsoleLogLevel(verboseArg == null ? GeronimoLogging.INFO : verboseArg.equals(ARGUMENT_VERBOSE) ? GeronimoLogging.DEBUG : GeronimoLogging.TRACE);
log = LogFactory.getLog(Daemon.class.getName());
}
@@ -267,10 +268,8 @@
// add our shutdown hook
Runtime.getRuntime().addShutdownHook(new Thread("Geronimo shutdown thread") {
public void run() {
- log.info("Server shutdown begun");
System.out.println("\rServer shutdown begun ");
kernel.shutdown();
- log.info("Server shutdown completed");
System.out.println("Server shutdown completed");
}
});
@@ -351,7 +350,6 @@
// Startup sequence is finished
monitor.startupFinished();
monitor = null;
- log.info("Server startup completed");
// capture this thread until the kernel is ready to exit
while (kernel.isRunning()) {
Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java?rev=353802&r1=353801&r2=353802&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java (original)
+++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java Sat Dec 3 18:35:42 2005
@@ -243,6 +243,8 @@
e.printStackTrace();
}
+ Collections.sort(apps);
+
// Helpful output: list of ports we listen on
if(ports.size() > 0) {
Collections.sort(ports);
@@ -372,10 +374,13 @@
buf.append(' ');
}
buf.append(time).append("s ");
- if(currentOperation.length() > operationLimit) { // "Foo BarBarBar" limit 9 = "Foo ...ar" = 13 - 9 + 3 + 1 + 3
- int space = currentOperation.indexOf(' ');
+ if(currentOperation.length() > operationLimit) {
+ int space = currentOperation.indexOf(' ', 5);
buf.append(currentOperation.substring(0, space+1));
- buf.append("...").append(currentOperation.substring(currentOperation.length()-operationLimit+space+4));
+ // "Foo BarBarBar" limit 9 = "Foo ...ar" = 13 - 9 + 3 + 1 + 3
+ // buf.append("...").append(currentOperation.substring(currentOperation.length()-operationLimit+space+4));
+ // "FooBar BarBarBar" limit 12 = "FooBar Ba..." = (7, 12-3)
+ buf.append(currentOperation.substring(space+1, operationLimit - 3)).append("...");
} else {
buf.append(currentOperation);
for(int i=currentOperation.length(); i<operationLimit; i++) {
Modified: geronimo/trunk/modules/timer/src/java/org/apache/geronimo/timer/ExecutorFeedingTimerTask.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/timer/src/java/org/apache/geronimo/timer/ExecutorFeedingTimerTask.java?rev=353802&r1=353801&r2=353802&view=diff
==============================================================================
--- geronimo/trunk/modules/timer/src/java/org/apache/geronimo/timer/ExecutorFeedingTimerTask.java (original)
+++ geronimo/trunk/modules/timer/src/java/org/apache/geronimo/timer/ExecutorFeedingTimerTask.java Sat Dec 3 18:35:42 2005
@@ -50,7 +50,7 @@
try {
threadPooledTimer.getExecutor().execute(workInfo.getExecutorTask());
} catch (InterruptedException e) {
- log.warn(e);
+ log.warn("Exception running task", e);
}
}
@@ -59,10 +59,10 @@
try {
threadPooledTimer.registerSynchronization(new CancelSynchronization(this));
} catch (RollbackException e) {
- log.info(e);
+ log.warn("Exception canceling task", e);
throw (IllegalStateException) new IllegalStateException("RollbackException when trying to register Cancel Synchronization").initCause(e);
} catch (SystemException e) {
- log.info(e);
+ log.warn("Exception canceling task", e);
throw (IllegalStateException) new IllegalStateException("SystemException when trying to register Cancel Synchronization").initCause(e);
}
// One cancels the task at this specific time. If the transaction is
@@ -81,7 +81,7 @@
// in the scope of a committed transactions.
threadPooledTimer.getWorkerPersistence().cancel(workInfo.getId());
} catch (PersistenceException e) {
- log.warn(e);
+ log.warn("Exception canceling task", e);
}
}
Modified: geronimo/trunk/modules/timer/src/java/org/apache/geronimo/timer/NontransactionalExecutorTask.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/timer/src/java/org/apache/geronimo/timer/NontransactionalExecutorTask.java?rev=353802&r1=353801&r2=353802&view=diff
==============================================================================
--- geronimo/trunk/modules/timer/src/java/org/apache/geronimo/timer/NontransactionalExecutorTask.java (original)
+++ geronimo/trunk/modules/timer/src/java/org/apache/geronimo/timer/NontransactionalExecutorTask.java Sat Dec 3 18:35:42 2005
@@ -48,12 +48,12 @@
try {
userTask.run();
} catch (Exception e) {
- log.info(e);
+ log.warn("Exception running task", e);
}
try {
threadPooledTimer.workPerformed(workInfo);
} catch (PersistenceException e) {
- log.info(e);
+ log.warn("Exception completing task", e);
}
if (workInfo.isOneTime()) {
threadPooledTimer.removeWorkInfo(workInfo);
Modified: geronimo/trunk/modules/timer/src/java/org/apache/geronimo/timer/ThreadPooledTimer.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/timer/src/java/org/apache/geronimo/timer/ThreadPooledTimer.java?rev=353802&r1=353801&r2=353802&view=diff
==============================================================================
--- geronimo/trunk/modules/timer/src/java/org/apache/geronimo/timer/ThreadPooledTimer.java (original)
+++ geronimo/trunk/modules/timer/src/java/org/apache/geronimo/timer/ThreadPooledTimer.java Sat Dec 3 18:35:42 2005
@@ -272,7 +272,7 @@
getTimer().schedule(worker, time);
} catch (IllegalStateException e) {
//TODO consider again if catching this exception is appropriate
- log.info("Couldn't schedule worker " + e.getMessage() + "at (now) " + System.currentTimeMillis() + " for " + time.getTime());
+ log.warn("Couldn't schedule worker " + e.getMessage() + "at (now) " + System.currentTimeMillis() + " for " + time.getTime());
}
}
}
@@ -302,7 +302,7 @@
try {
getTimer().schedule(worker, time, period);
} catch (Exception e) {
- log.info("Couldn't schedule/period worker " + e.getMessage() + "at (now) " + System.currentTimeMillis() + " for " + time.getTime());
+ log.warn("Couldn't schedule/period worker " + e.getMessage() + "at (now) " + System.currentTimeMillis() + " for " + time.getTime());
}
}
}
@@ -332,7 +332,7 @@
try {
getTimer().scheduleAtFixedRate(worker, time, period);
} catch (Exception e) {
- log.info("Couldn't scheduleAtFixedRate worker " + e.getMessage() + "at (now) " + System.currentTimeMillis() + " for " + time.getTime());
+ log.warn("Couldn't scheduleAtFixedRate worker " + e.getMessage() + "at (now) " + System.currentTimeMillis() + " for " + time.getTime());
}
}
}
Modified: geronimo/trunk/modules/timer/src/java/org/apache/geronimo/timer/TransactionalExecutorTask.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/timer/src/java/org/apache/geronimo/timer/TransactionalExecutorTask.java?rev=353802&r1=353801&r2=353802&view=diff
==============================================================================
--- geronimo/trunk/modules/timer/src/java/org/apache/geronimo/timer/TransactionalExecutorTask.java (original)
+++ geronimo/trunk/modules/timer/src/java/org/apache/geronimo/timer/TransactionalExecutorTask.java Sat Dec 3 18:35:42 2005
@@ -49,19 +49,19 @@
try {
transactionContext = transactionContextManager.newContainerTransactionContext();
} catch (Exception e) {
- log.info("Exception occured while starting container transaction", e);
+ log.warn("Exception occured while starting container transaction", e);
break;
}
try {
try {
userTask.run();
} catch (Exception e) {
- log.info("Exception occured while running user task", e);
+ log.warn("Exception occured while running user task", e);
}
try {
threadPooledTimer.workPerformed(workInfo);
} catch (PersistenceException e) {
- log.info("Exception occured while updating timer persistent state", e);
+ log.warn("Exception occured while updating timer persistent state", e);
}
} finally {
try {
@@ -74,7 +74,7 @@
return;
}
} catch (Exception e) {
- log.info("Exception occured while completing container transaction", e);
+ log.warn("Exception occured while completing container transaction", e);
}
}
}
Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java?rev=353802&r1=353801&r2=353802&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java (original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java Sat Dec 3 18:35:42 2005
@@ -265,7 +265,7 @@
realm = new TomcatJAASRealm();
}
- log.info("The security-realm-name '" + securityRealmName +
+ log.debug("The security-realm-name '" + securityRealmName +
"' was specified and a parent (Engine/Host) is not named the same or no RealmGBean was configured for this context. " +
"Creating a default " + realm.getClass().getName() +
" adapter for this context.");
Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java?rev=353802&r1=353801&r2=353802&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java (original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java Sat Dec 3 18:35:42 2005
@@ -63,7 +63,7 @@
this.setParentClassLoader(classLoader);
this.setDelegate(true);
- log.info("EJB Webservice Context = " + contextPath);
+ log.debug("EJB Webservice Context = " + contextPath);
if (securityRealmName != null) {
TomcatEJBWSGeronimoRealm realm = new TomcatEJBWSGeronimoRealm();
Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java?rev=353802&r1=353801&r2=353802&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java (original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java Sat Dec 3 18:35:42 2005
@@ -393,7 +393,7 @@
// Is it necessary - doesn't Tomcat Embedded take care of it?
// super.start();
- log.info("TomcatWebAppContext started for " + path);
+ log.debug("TomcatWebAppContext started for " + path);
}
public void doStop() throws Exception {
@@ -402,7 +402,7 @@
// No more logging will occur for this ClassLoader. Inform the LogFactory to avoid a memory leak.
LogFactory.release(webClassLoader);
- log.info("TomcatWebAppContext stopped");
+ log.debug("TomcatWebAppContext stopped");
}
public void doFail() {
@@ -411,7 +411,7 @@
// No more logging will occur for this ClassLoader. Inform the LogFactory to avoid a memory leak.
LogFactory.release(webClassLoader);
- log.info("TomcatWebAppContext failed");
+ log.warn("TomcatWebAppContext failed");
}
public static final GBeanInfo GBEAN_INFO;
Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/CatalinaClusterGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/CatalinaClusterGBean.java?rev=353802&r1=353801&r2=353802&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/CatalinaClusterGBean.java (original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/CatalinaClusterGBean.java Sat Dec 3 18:35:42 2005
@@ -111,15 +111,15 @@
}
public void doFail() {
- log.info("Failed");
+ log.warn("Failed");
}
public void doStart() throws Exception {
- log.info("Started cluster gbean.");
+ log.debug("Started cluster gbean.");
}
public void doStop() throws Exception {
- log.info("Stopped cluster gbean.");
+ log.debug("Stopped cluster gbean.");
}
public static final GBeanInfo GBEAN_INFO;
Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/ClusterDeployerGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/ClusterDeployerGBean.java?rev=353802&r1=353801&r2=353802&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/ClusterDeployerGBean.java (original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/ClusterDeployerGBean.java Sat Dec 3 18:35:42 2005
@@ -59,15 +59,15 @@
}
public void doFail() {
- log.info("Failed: "+ deployer.getClass().getName());
+ log.warn("Failed: "+ deployer.getClass().getName());
}
public void doStart() throws Exception {
- log.info("Started "+ deployer.getClass().getName() +" gbean.");
+ log.debug("Started "+ deployer.getClass().getName() +" gbean.");
}
public void doStop() throws Exception {
- log.info("Stopped " + deployer.getClass().getName() + " gbean.");
+ log.debug("Stopped " + deployer.getClass().getName() + " gbean.");
}
public static final GBeanInfo GBEAN_INFO;
Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/MembershipServiceGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/MembershipServiceGBean.java?rev=353802&r1=353801&r2=353802&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/MembershipServiceGBean.java (original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/MembershipServiceGBean.java Sat Dec 3 18:35:42 2005
@@ -60,15 +60,15 @@
}
public void doFail() {
- log.info("Failed");
+ log.warn("Failed");
}
public void doStart() throws Exception {
- log.info("Started membership service gbean.");
+ log.debug("Started membership service gbean.");
}
public void doStop() throws Exception {
- log.info("Stopped MembershipService gbean.");
+ log.debug("Stopped MembershipService gbean.");
}
public static final GBeanInfo GBEAN_INFO;
Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/MessageListenerGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/MessageListenerGBean.java?rev=353802&r1=353801&r2=353802&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/MessageListenerGBean.java (original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/MessageListenerGBean.java Sat Dec 3 18:35:42 2005
@@ -56,15 +56,15 @@
}
public void doStart() throws Exception {
- log.info(className + " started.");
+ log.debug(className + " started.");
}
public void doStop() throws Exception {
- log.info(className + " stopped.");
+ log.debug(className + " stopped.");
}
public void doFail() {
- log.info(className + " failed.");
+ log.warn(className + " failed.");
}
public Object getInternalObject() {
Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/ReceiverGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/ReceiverGBean.java?rev=353802&r1=353801&r2=353802&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/ReceiverGBean.java (original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/ReceiverGBean.java Sat Dec 3 18:35:42 2005
@@ -60,15 +60,15 @@
}
public void doFail() {
- log.info("Failed");
+ log.warn("Failed");
}
public void doStart() throws Exception {
- log.info("Started Receiver service gbean.");
+ log.debug("Started Receiver service gbean.");
}
public void doStop() throws Exception {
- log.info("Stopped Receiver gbean.");
+ log.debug("Stopped Receiver gbean.");
}
public static final GBeanInfo GBEAN_INFO;
Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/SenderGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/SenderGBean.java?rev=353802&r1=353801&r2=353802&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/SenderGBean.java (original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/cluster/SenderGBean.java Sat Dec 3 18:35:42 2005
@@ -60,15 +60,15 @@
}
public void doFail() {
- log.info("Failed");
+ log.warn("Failed");
}
public void doStart() throws Exception {
- log.info("Started Sender service gbean.");
+ log.debug("Started Sender service gbean.");
}
public void doStop() throws Exception {
- log.info("Stopped Sender gbean.");
+ log.debug("Stopped Sender gbean.");
}
public static final GBeanInfo GBEAN_INFO;