camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bvah...@apache.org
Subject svn commit: r1358597 - /camel/trunk/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTEndpoint.java
Date Sat, 07 Jul 2012 16:29:02 GMT
Author: bvahdat
Date: Sat Jul  7 16:29:02 2012
New Revision: 1358597

URL: http://svn.apache.org/viewvc?rev=1358597&view=rev
Log:
Polished.

Modified:
    camel/trunk/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTEndpoint.java

Modified: camel/trunk/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTEndpoint.java?rev=1358597&r1=1358596&r2=1358597&view=diff
==============================================================================
--- camel/trunk/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTEndpoint.java
(original)
+++ camel/trunk/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTEndpoint.java
Sat Jul  7 16:29:02 2012
@@ -46,7 +46,7 @@ public class MQTTEndpoint extends Defaul
     private final MQTTConfiguration configuration;
     private final List<MQTTConsumer> consumers = new CopyOnWriteArrayList<MQTTConsumer>();
 
-    public MQTTEndpoint(String uri, org.apache.camel.component.mqtt.MQTTComponent component,
MQTTConfiguration properties) {
+    public MQTTEndpoint(String uri, MQTTComponent component, MQTTConfiguration properties)
{
         super(uri, component);
         this.configuration = properties;
     }
@@ -67,7 +67,6 @@ public class MQTTEndpoint extends Defaul
         return configuration;
     }
 
-
     @Override
     protected void doStart() throws Exception {
         super.doStart();
@@ -113,7 +112,7 @@ public class MQTTEndpoint extends Defaul
                 });
             }
         });
-        final Promise promise = new Promise();
+        final Promise<Object> promise = new Promise<Object>();
         connection.connect(new Callback<Void>() {
             public void onSuccess(Void value) {
                 String subscribeTopicName = configuration.getSubscribeTopicName();
@@ -147,7 +146,7 @@ public class MQTTEndpoint extends Defaul
 
     protected void doStop() throws Exception {
         if (connection != null) {
-            final Promise promise = new Promise();
+            final Promise<Void> promise = new Promise<Void>();
             connection.disconnect(new Callback<Void>() {
                 public void onSuccess(Void value) {
                     promise.onSuccess(value);
@@ -164,22 +163,8 @@ public class MQTTEndpoint extends Defaul
 
     void publish(String topic, byte[] payload, QoS qoS, boolean retain) throws Exception
{
         connection.publish(topic, payload, qoS, retain, null);
-        /*
-        connection.publish(topic, payload, qoS, retain, new Callback<Void>() {
-            public void onSuccess(Void value) {
-                promise.onSuccess(value);
-            }
-
-            public void onFailure(Throwable value) {
-                promise.onFailure(value);
-            }
-
-        });
-        promise.await(configuration.getSendWaitInSeconds(), TimeUnit.SECONDS);
-        */
     }
 
-
     void addConsumer(MQTTConsumer consumer) {
         consumers.add(consumer);
     }



Mime
View raw message