servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r388154 - /incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/components/util/PojoSupport.java
Date Thu, 23 Mar 2006 12:29:47 GMT
Author: gnodet
Date: Thu Mar 23 04:29:44 2006
New Revision: 388154

URL: http://svn.apache.org/viewcvs?rev=388154&view=rev
Log:
Keep the reference to the DeliveryChannel so that meaningful exceptions are thrown when the
channel is closed (instead of NPE)

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=388154&r1=388153&r2=388154&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
Thu Mar 23 04:29:44 2006
@@ -54,6 +54,7 @@
     private MessageExchangeFactory exchangeFactory;
     private String description = "POJO Component";
     private ServiceEndpoint serviceEndpoint;
+    private DeliveryChannel channel;
     
     protected PojoSupport() {
     }
@@ -80,6 +81,7 @@
      */
     public void init(ComponentContext cc) throws JBIException {
         this.context = cc;
+        this.channel = this.context.getDeliveryChannel();
         init();
         if (service != null && endpoint != null) {
             serviceEndpoint = context.activateEndpoint(service, endpoint);
@@ -187,10 +189,10 @@
     }
 
     public DeliveryChannel getDeliveryChannel() throws MessagingException {
-        if (context == null) {
+        if (channel == null) {
             throw new NotInitialisedYetException();
         }
-        return context.getDeliveryChannel();
+        return channel;
     }
 
     /**



Mime
View raw message