servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r382965 - /incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/components/util/PojoSupport.java
Date Fri, 03 Mar 2006 23:32:42 GMT
Author: gnodet
Date: Fri Mar  3 15:32:40 2006
New Revision: 382965

URL: http://svn.apache.org/viewcvs?rev=382965&view=rev
Log:
Deactivate endpoint when lw component is shutdown

Modified:
    incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/components/util/PojoSupport.java

Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/components/util/PojoSupport.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/components/util/PojoSupport.java?rev=382965&r1=382964&r2=382965&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/components/util/PojoSupport.java
(original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/components/util/PojoSupport.java
Fri Mar  3 15:32:40 2006
@@ -37,6 +37,7 @@
 import javax.jbi.messaging.MessageExchangeFactory;
 import javax.jbi.messaging.MessagingException;
 import javax.jbi.messaging.NormalizedMessage;
+import javax.jbi.servicedesc.ServiceEndpoint;
 import javax.management.ObjectName;
 import javax.xml.namespace.QName;
 import javax.xml.transform.Source;
@@ -54,6 +55,7 @@
     private String endpoint;
     private MessageExchangeFactory exchangeFactory;
     private String description = "POJO Component";
+    private ServiceEndpoint serviceEndpoint;
     
     private static final Log log = LogFactory.getLog(PojoSupport.class);
     
@@ -84,10 +86,21 @@
         this.context = cc;
         init();
         if (service != null && endpoint != null) {
-            context.activateEndpoint(service, endpoint);
+            serviceEndpoint = context.activateEndpoint(service, endpoint);
         }
     }
 
+    /**
+     * Shut down the item. The releases resources, preparatory to uninstallation.
+     * 
+     * @exception javax.jbi.JBIException if the item fails to shut down.
+     */
+    public void shutDown() throws javax.jbi.JBIException {
+        if (serviceEndpoint != null) {
+            context.deactivateEndpoint(serviceEndpoint);
+        }
+        super.shutDown();
+    }
 
     // Helper methods
     //-------------------------------------------------------------------------



Mime
View raw message