You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2006/02/10 18:33:03 UTC
svn commit: r376773 -
/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentMBeanImpl.java
Author: gnodet
Date: Fri Feb 10 09:33:01 2006
New Revision: 376773
URL: http://svn.apache.org/viewcvs?rev=376773&view=rev
Log:
Log exceptions on start/stop/shutdown for ComponentMBeanImpl
Modified:
incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentMBeanImpl.java
Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentMBeanImpl.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentMBeanImpl.java?rev=376773&r1=376772&r2=376773&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentMBeanImpl.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentMBeanImpl.java Fri Feb 10 09:33:01 2006
@@ -21,6 +21,8 @@
import javax.management.MBeanOperationInfo;
import javax.management.ObjectName;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.servicemix.jbi.management.AttributeInfoHelper;
import org.apache.servicemix.jbi.management.BaseLifeCycle;
import org.apache.servicemix.jbi.management.OperationInfoHelper;
@@ -29,6 +31,9 @@
* Defines basic statistics on the Component
*/
public class ComponentMBeanImpl extends BaseLifeCycle implements ComponentMBean {
+
+ private static Log log = LogFactory.getLog(ComponentMBeanImpl.class);
+
private LocalComponentConnector connector;
private ObjectName objectName;
@@ -98,8 +103,19 @@
* @exception javax.jbi.JBIException if the item fails to start.
*/
public void start() throws javax.jbi.JBIException {
- doStart();
- connector.writeRunningState();
+ try {
+ doStart();
+ connector.writeRunningState();
+ } catch (JBIException e) {
+ log.error("Could not start component", e);
+ throw e;
+ } catch (RuntimeException e) {
+ log.error("Could not start component", e);
+ throw e;
+ } catch (Error e) {
+ log.error("Could not start component", e);
+ throw e;
+ }
}
/**
@@ -108,8 +124,19 @@
* @exception javax.jbi.JBIException if the item fails to stop.
*/
public void stop() throws javax.jbi.JBIException {
- doStop();
- connector.writeRunningState();
+ try {
+ doStop();
+ connector.writeRunningState();
+ } catch (JBIException e) {
+ log.error("Could not stop component", e);
+ throw e;
+ } catch (RuntimeException e) {
+ log.error("Could not start component", e);
+ throw e;
+ } catch (Error e) {
+ log.error("Could not start component", e);
+ throw e;
+ }
}
/**
@@ -118,8 +145,19 @@
* @exception javax.jbi.JBIException if the item fails to shut down.
*/
public void shutDown() throws javax.jbi.JBIException {
- doShutDown();
- connector.writeRunningState();
+ try {
+ doShutDown();
+ connector.writeRunningState();
+ } catch (JBIException e) {
+ log.error("Could not shutDown component", e);
+ throw e;
+ } catch (RuntimeException e) {
+ log.error("Could not start component", e);
+ throw e;
+ } catch (Error e) {
+ log.error("Could not start component", e);
+ throw e;
+ }
}
/**
@@ -127,12 +165,12 @@
*
* @exception javax.jbi.JBIException if the item fails to start.
*/
- public void doStart() throws javax.jbi.JBIException{
- if(isShutDown()){
+ public void doStart() throws javax.jbi.JBIException {
+ if (isShutDown()) {
// need to re-initialze before starting
connector.init();
}
- if(!isRunning()){
+ if (!isRunning()) {
connector.getLifeCycle().start();
super.start();
}
@@ -145,7 +183,7 @@
* if the item fails to stop.
*/
public void doStop() throws javax.jbi.JBIException {
- if (isUnknown() || isRunning()){
+ if (isUnknown() || isRunning()) {
connector.getLifeCycle().stop();
super.stop();
}