You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by js...@apache.org on 2006/10/03 13:08:10 UTC
svn commit: r452418 -
/incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/ProviderEndpoint.java
Author: jstrachan
Date: Tue Oct 3 04:08:09 2006
New Revision: 452418
URL: http://svn.apache.org/viewvc?view=rev&rev=452418
Log:
throw a more meaningful exception if a component developer forgets to activate a dynamic endpoint
Modified:
incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/ProviderEndpoint.java
Modified: incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/ProviderEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/ProviderEndpoint.java?view=diff&rev=452418&r1=452417&r2=452418
==============================================================================
--- incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/ProviderEndpoint.java (original)
+++ incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/ProviderEndpoint.java Tue Oct 3 04:08:09 2006
@@ -1,5 +1,8 @@
package org.apache.servicemix.common;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
import javax.jbi.component.ComponentContext;
import javax.jbi.messaging.DeliveryChannel;
import javax.jbi.messaging.ExchangeStatus;
@@ -36,6 +39,9 @@
public void deactivate() throws Exception {
stop();
+ if (activated == null) {
+ throw new IllegalStateException("Endpoint not activated: " + this);
+ }
ServiceEndpoint ep = activated;
activated = null;
ComponentContext ctx = getServiceUnit().getComponent().getComponentContext();