camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1358699 - in /camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter: ./ consumer/directmessage/ consumer/search/ consumer/streaming/ consumer/timeline/ producer/
Date Sun, 08 Jul 2012 07:07:01 GMT
Author: davsclaus
Date: Sun Jul  8 07:07:00 2012
New Revision: 1358699

URL: http://svn.apache.org/viewvc?rev=1358699&view=rev
Log:
CAMEL-5430: Cleaup in camel-twitter. Thanks to Brett Meyer for the patch.

Modified:
    camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java
    camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpoint.java
    camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointDirect.java
    camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointEvent.java
    camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java
    camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/directmessage/DirectMessageConsumer.java
    camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/search/SearchConsumer.java
    camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/streaming/StreamingConsumer.java
    camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/HomeConsumer.java
    camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/MentionsConsumer.java
    camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/PublicConsumer.java
    camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/RetweetsConsumer.java
    camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/UserConsumer.java
    camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/DirectMessageProducer.java
    camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/SearchProducer.java
    camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/UserProducer.java

Modified: camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java?rev=1358699&r1=1358698&r2=1358699&view=diff
==============================================================================
--- camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java
(original)
+++ camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java
Sun Jul  8 07:07:00 2012
@@ -36,6 +36,14 @@ public class TwitterConfiguration {
     private String locations;
     private String userIds;
     private boolean filterOld = true;
+
+    /**
+     * Singleton, on demand instances of Twitter4J's Twitter & TwitterStream.
+     * This should not be created by an endpoint's doStart(), etc., since
+     * instances of twitter and/or twitterStream can be supplied by the route
+     * itself.  Further, as an example, we don't want to initialize twitter
+     * if we only need twitterStream.
+     */
     private Twitter twitter;
     private TwitterStream twitterStream;
 
@@ -144,6 +152,9 @@ public class TwitterConfiguration {
     }
 
     public Twitter getTwitter() {
+        if (twitter == null) {
+            twitter = new TwitterFactory(getConfiguration()).getInstance();
+        }
         return twitter;
     }
 
@@ -152,22 +163,15 @@ public class TwitterConfiguration {
     }
 
     public TwitterStream getTwitterStream() {
+        if (twitterStream == null) {
+            twitterStream = new TwitterStreamFactory(getConfiguration()).getInstance();
+        }
         return twitterStream;
     }
 
     public void setTwitterStream(TwitterStream twitterStream) {
         this.twitterStream = twitterStream;
     }
-
-    public Twitter getTwitterInstance() {
-        checkComplete();
-        return getTwitter() != null ? getTwitter() : new TwitterFactory(getConfiguration()).getInstance();
-    }
-
-    public TwitterStream getTwitterStreamInstance() {
-        checkComplete();
-        return getTwitterStream() != null ? getTwitterStream() : new TwitterStreamFactory(getConfiguration()).getInstance();
-    }
 }
 
 

Modified: camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpoint.java?rev=1358699&r1=1358698&r2=1358699&view=diff
==============================================================================
--- camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpoint.java
(original)
+++ camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpoint.java
Sun Jul  8 07:07:00 2012
@@ -22,8 +22,6 @@ import twitter4j.Twitter;
 
 public interface TwitterEndpoint extends Endpoint {
 
-    Twitter getTwitter();
-
     TwitterConfiguration getProperties();
 
     EndpointType getEndpointType();

Modified: camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointDirect.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointDirect.java?rev=1358699&r1=1358698&r2=1358699&view=diff
==============================================================================
--- camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointDirect.java
(original)
+++ camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointDirect.java
Sun Jul  8 07:07:00 2012
@@ -25,14 +25,11 @@ import org.apache.camel.component.twitte
 import org.apache.camel.component.twitter.consumer.TwitterConsumerDirect;
 import org.apache.camel.component.twitter.data.EndpointType;
 
-import twitter4j.Twitter;
-
 /**
  * Twitter direct endpoint
  */
 public class TwitterEndpointDirect extends DirectEndpoint implements TwitterEndpoint {
 
-    private Twitter twitter;
     private TwitterConfiguration properties;
 
     public TwitterEndpointDirect(String uri, TwitterComponent component, TwitterConfiguration
properties) {
@@ -51,15 +48,6 @@ public class TwitterEndpointDirect exten
         return Twitter4JFactory.getProducer(this, getEndpointUri());
     }
 
-    @Override
-    protected void doStart() {
-        twitter = properties.getTwitterInstance();
-    }
-
-    public Twitter getTwitter() {
-        return twitter;
-    }
-
     public TwitterConfiguration getProperties() {
         return properties;
     }

Modified: camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointEvent.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointEvent.java?rev=1358699&r1=1358698&r2=1358699&view=diff
==============================================================================
--- camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointEvent.java
(original)
+++ camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointEvent.java
Sun Jul  8 07:07:00 2012
@@ -24,11 +24,8 @@ import org.apache.camel.component.twitte
 import org.apache.camel.component.twitter.consumer.TwitterConsumerEvent;
 import org.apache.camel.component.twitter.data.EndpointType;
 
-import twitter4j.Twitter;
-
 public class TwitterEndpointEvent extends DirectEndpoint implements TwitterEndpoint {
 
-    private Twitter twitter;
     private TwitterConfiguration properties;
 
     public TwitterEndpointEvent(String uri, TwitterComponent component, TwitterConfiguration
properties) {
@@ -47,15 +44,6 @@ public class TwitterEndpointEvent extend
         throw new UnsupportedOperationException("Producer not supported");
     }
 
-    @Override
-    protected void doStart() {
-        twitter = properties.getTwitterInstance();
-    }
-
-    public Twitter getTwitter() {
-        return twitter;
-    }
-
     public TwitterConfiguration getProperties() {
         return properties;
     }

Modified: camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java?rev=1358699&r1=1358698&r2=1358699&view=diff
==============================================================================
--- camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java
(original)
+++ camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java
Sun Jul  8 07:07:00 2012
@@ -24,14 +24,12 @@ import org.apache.camel.component.twitte
 import org.apache.camel.component.twitter.consumer.TwitterConsumerPolling;
 import org.apache.camel.component.twitter.data.EndpointType;
 import org.apache.camel.impl.DefaultPollingEndpoint;
-import twitter4j.Twitter;
 
 /**
  * Twitter polling endpoint
  */
 public class TwitterEndpointPolling extends DefaultPollingEndpoint implements TwitterEndpoint
{
 
-    private Twitter twitter;
     private TwitterConfiguration properties;
 
     public TwitterEndpointPolling(String uri, TwitterComponent component, TwitterConfiguration
properties) {
@@ -52,15 +50,6 @@ public class TwitterEndpointPolling exte
         return Twitter4JFactory.getProducer(this, getEndpointUri());
     }
 
-    @Override
-    protected void doStart() {
-        twitter = properties.getTwitterInstance();
-    }
-
-    public Twitter getTwitter() {
-        return twitter;
-    }
-
     public boolean isSingleton() {
         return true;
     }

Modified: camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/directmessage/DirectMessageConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/directmessage/DirectMessageConsumer.java?rev=1358699&r1=1358698&r2=1358699&view=diff
==============================================================================
--- camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/directmessage/DirectMessageConsumer.java
(original)
+++ camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/directmessage/DirectMessageConsumer.java
Sun Jul  8 07:07:00 2012
@@ -37,7 +37,7 @@ public class DirectMessageConsumer exten
     }
 
     public List<DirectMessage> pollConsume() throws TwitterException {
-        List<DirectMessage> list = te.getTwitter().getDirectMessages(new Paging(lastId));
+        List<DirectMessage> list = te.getProperties().getTwitter().getDirectMessages(new
Paging(lastId));
         for (DirectMessage dm : list) {
             checkLastId(dm.getId());
         }
@@ -45,6 +45,6 @@ public class DirectMessageConsumer exten
     }
 
     public List<DirectMessage> directConsume() throws TwitterException {
-        return te.getTwitter().getDirectMessages();
+        return te.getProperties().getTwitter().getDirectMessages();
     }
 }

Modified: camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/search/SearchConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/search/SearchConsumer.java?rev=1358699&r1=1358698&r2=1358699&view=diff
==============================================================================
--- camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/search/SearchConsumer.java
(original)
+++ camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/search/SearchConsumer.java
Sun Jul  8 07:07:00 2012
@@ -61,7 +61,7 @@ public class SearchConsumer extends Twit
     }
 
     private List<Tweet> search(Query query) throws TwitterException {
-        QueryResult qr = te.getTwitter().search(query);
+        QueryResult qr = te.getProperties().getTwitter().search(query);
         List<Tweet> tweets = qr.getTweets();
 
         if (te.getProperties().isFilterOld()) {

Modified: camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/streaming/StreamingConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/streaming/StreamingConsumer.java?rev=1358699&r1=1358698&r2=1358699&view=diff
==============================================================================
--- camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/streaming/StreamingConsumer.java
(original)
+++ camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/streaming/StreamingConsumer.java
Sun Jul  8 07:07:00 2012
@@ -43,7 +43,7 @@ public class StreamingConsumer extends T
 
     public StreamingConsumer(TwitterEndpoint te) {
         this.te = te;
-        twitterStream = te.getProperties().getTwitterStreamInstance();
+        twitterStream = te.getProperties().getTwitterStream();
         twitterStream.addListener(this);
     }
 

Modified: camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/HomeConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/HomeConsumer.java?rev=1358699&r1=1358698&r2=1358699&view=diff
==============================================================================
--- camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/HomeConsumer.java
(original)
+++ camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/HomeConsumer.java
Sun Jul  8 07:07:00 2012
@@ -38,7 +38,7 @@ public class HomeConsumer extends Twitte
     }
 
     public List<Status> pollConsume() throws TwitterException {
-        List<Status> list = te.getTwitter().getHomeTimeline(new Paging(lastId));
+        List<Status> list = te.getProperties().getTwitter().getHomeTimeline(new Paging(lastId));
         for (Status s : list) {
             checkLastId(s.getId());
         }
@@ -46,6 +46,6 @@ public class HomeConsumer extends Twitte
     }
 
     public List<Status> directConsume() throws TwitterException {
-        return te.getTwitter().getHomeTimeline();
+        return te.getProperties().getTwitter().getHomeTimeline();
     }
 }

Modified: camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/MentionsConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/MentionsConsumer.java?rev=1358699&r1=1358698&r2=1358699&view=diff
==============================================================================
--- camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/MentionsConsumer.java
(original)
+++ camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/MentionsConsumer.java
Sun Jul  8 07:07:00 2012
@@ -37,7 +37,7 @@ public class MentionsConsumer extends Tw
     }
 
     public List<Status> pollConsume() throws TwitterException {
-        List<Status> list = te.getTwitter().getMentions(new Paging(lastId));
+        List<Status> list = te.getProperties().getTwitter().getMentions(new Paging(lastId));
         for (Status s : list) {
             checkLastId(s.getId());
         }
@@ -45,6 +45,6 @@ public class MentionsConsumer extends Tw
     }
 
     public List<Status> directConsume() throws TwitterException {
-        return te.getTwitter().getMentions();
+        return te.getProperties().getTwitter().getMentions();
     }
 }

Modified: camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/PublicConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/PublicConsumer.java?rev=1358699&r1=1358698&r2=1358699&view=diff
==============================================================================
--- camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/PublicConsumer.java
(original)
+++ camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/PublicConsumer.java
Sun Jul  8 07:07:00 2012
@@ -45,6 +45,6 @@ public class PublicConsumer extends Twit
     }
 
     private List<Status> getPublicTimeline() throws TwitterException {
-        return te.getTwitter().getPublicTimeline();
+        return te.getProperties().getTwitter().getPublicTimeline();
     }
 }

Modified: camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/RetweetsConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/RetweetsConsumer.java?rev=1358699&r1=1358698&r2=1358699&view=diff
==============================================================================
--- camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/RetweetsConsumer.java
(original)
+++ camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/RetweetsConsumer.java
Sun Jul  8 07:07:00 2012
@@ -38,7 +38,7 @@ public class RetweetsConsumer extends Tw
     }
 
     public List<Status> pollConsume() throws TwitterException {
-        List<Status> list = te.getTwitter().getRetweetsOfMe(new Paging(lastId));
+        List<Status> list = te.getProperties().getTwitter().getRetweetsOfMe(new Paging(lastId));
         for (Status s : list) {
             checkLastId(s.getId());
         }
@@ -46,6 +46,6 @@ public class RetweetsConsumer extends Tw
     }
 
     public List<Status> directConsume() throws TwitterException {
-        return te.getTwitter().getRetweetsOfMe();
+        return te.getProperties().getTwitter().getRetweetsOfMe();
     }
 }

Modified: camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/UserConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/UserConsumer.java?rev=1358699&r1=1358698&r2=1358699&view=diff
==============================================================================
--- camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/UserConsumer.java
(original)
+++ camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/UserConsumer.java
Sun Jul  8 07:07:00 2012
@@ -37,7 +37,7 @@ public class UserConsumer extends Twitte
     }
 
     public List<Status> pollConsume() throws TwitterException {
-        List<Status> list = te.getTwitter().getUserTimeline(te.getProperties().getUser(),
new Paging(lastId));
+        List<Status> list = te.getProperties().getTwitter().getUserTimeline(te.getProperties().getUser(),
new Paging(lastId));
         for (Status s : list) {
             checkLastId(s.getId());
         }
@@ -45,6 +45,6 @@ public class UserConsumer extends Twitte
     }
 
     public List<Status> directConsume() throws TwitterException {
-        return te.getTwitter().getUserTimeline(te.getProperties().getUser());
+        return te.getProperties().getTwitter().getUserTimeline(te.getProperties().getUser());
     }
 }

Modified: camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/DirectMessageProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/DirectMessageProducer.java?rev=1358699&r1=1358698&r2=1358699&view=diff
==============================================================================
--- camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/DirectMessageProducer.java
(original)
+++ camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/DirectMessageProducer.java
Sun Jul  8 07:07:00 2012
@@ -44,7 +44,7 @@ public class DirectMessageProducer exten
             throw new CamelExchangeException("Username not configured on TwitterEndpoint",
exchange);
         } else {
             log.debug("Sending to: {} message: {}", toUsername, text);
-            te.getTwitter().sendDirectMessage(toUsername, text);
+            te.getProperties().getTwitter().sendDirectMessage(toUsername, text);
         }
     }
 

Modified: camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/SearchProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/SearchProducer.java?rev=1358699&r1=1358698&r2=1358699&view=diff
==============================================================================
--- camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/SearchProducer.java
(original)
+++ camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/SearchProducer.java
Sun Jul  8 07:07:00 2012
@@ -31,11 +31,11 @@ import twitter4j.Twitter;
 public class SearchProducer extends DefaultProducer {
 
     private long lastId;
-    private TwitterEndpoint twitterEndpoint;
+    private TwitterEndpoint te;
 
     public SearchProducer(TwitterEndpoint te) {
         super(te);
-        this.twitterEndpoint = te;
+        this.te = te;
     }
 
     @Override
@@ -43,7 +43,7 @@ public class SearchProducer extends Defa
         // keywords from header take precedence
         String keywords = exchange.getIn().getHeader(TwitterConstants.TWITTER_KEYWORDS, String.class);
         if (keywords == null) {
-            keywords = twitterEndpoint.getProperties().getKeywords();
+            keywords = te.getProperties().getKeywords();
         }
 
         if (keywords == null) {
@@ -55,7 +55,7 @@ public class SearchProducer extends Defa
             query.setSinceId(lastId);
         }
 
-        Twitter twitter = twitterEndpoint.getTwitter();
+        Twitter twitter = te.getProperties().getTwitter();
         log.debug("Searching twitter with keywords: {}", keywords);
         QueryResult results = twitter.search(query);
         List<Tweet> list = results.getTweets();

Modified: camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/UserProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/UserProducer.java?rev=1358699&r1=1358698&r2=1358699&view=diff
==============================================================================
--- camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/UserProducer.java
(original)
+++ camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/UserProducer.java
Sun Jul  8 07:07:00 2012
@@ -46,7 +46,7 @@ public class UserProducer extends Defaul
     }
 
     private void updateStatus(StatusUpdate status) throws Exception {
-        te.getTwitter().updateStatus(status);
+        te.getProperties().getTwitter().updateStatus(status);
         log.debug("Updated status: {}", status);
     }
 
@@ -56,7 +56,7 @@ public class UserProducer extends Defaul
             status = status.substring(0, 160);
         }
 
-        te.getTwitter().updateStatus(status);
+        te.getProperties().getTwitter().updateStatus(status);
         log.debug("Updated status: {}", status);
     }
 }



Mime
View raw message