twitter4j
Class AsyncTwitterFactory

java.lang.Object
  extended by twitter4j.AsyncTwitterFactory
All Implemented Interfaces:
java.io.Serializable

public final class AsyncTwitterFactory
extends java.lang.Object
implements java.io.Serializable

A factory class for AsyncTwitter.
An instance of this class is completely thread safe and can be re-used and used concurrently.
Note that currently AsyncTwitter is NOT compatible with Google App Engine as it is maintaining threads internally.

Since:
Twitter4J 2.1.0
Author:
Yusuke Yamamoto - yusuke at mac.com
See Also:
Serialized Form

Field Summary
protected  twitter4j.conf.Configuration conf
           
 
Constructor Summary
AsyncTwitterFactory()
          Creates a AsyncTwitterFactory with the root configuration, with no listener.
AsyncTwitterFactory(java.lang.String configTreePath, TwitterListener listener)
          Creates a AsyncTwitterFactory with a specified config tree, with given listener
AsyncTwitterFactory(TwitterListener listener)
          Creates a AsyncTwitterFactory with the root configuration, with given listener
 
Method Summary
 T getInstance()
          Returns a instance.
 T getInstance(twitter4j.http.Authorization auth)
           
protected  AsyncTwitter getInstance(twitter4j.conf.Configuration conf, twitter4j.http.Authorization auth)
          
 T getInstance(java.lang.String screenName, java.lang.String password)
          Returns a Basic Authenticated instance.
 T getOAuthAuthorizedInstance(twitter4j.http.AccessToken accessToken)
          Returns a OAuth Authenticated instance.
consumer key and consumer Secret must be provided by twitter4j.properties, or system properties.
 T getOAuthAuthorizedInstance(java.lang.String consumerKey, java.lang.String consumerSecret)
          Returns a OAuth Authenticated instance.
 T getOAuthAuthorizedInstance(java.lang.String consumerKey, java.lang.String consumerSecret, twitter4j.http.AccessToken accessToken)
          Returns a OAuth Authenticated instance.
 T getOAuthSupportInstance(twitter4j.http.Authorization auth)
           
protected  AsyncTwitter getOAuthSupportInstance(twitter4j.conf.Configuration conf, twitter4j.http.Authorization auth)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conf

protected final twitter4j.conf.Configuration conf
Constructor Detail

AsyncTwitterFactory

public AsyncTwitterFactory()
Creates a AsyncTwitterFactory with the root configuration, with no listener. AsyncTwitter instances will not perform callbacks when using this constructor.


AsyncTwitterFactory

public AsyncTwitterFactory(TwitterListener listener)
Creates a AsyncTwitterFactory with the root configuration, with given listener

Parameters:
listener - listener

AsyncTwitterFactory

public AsyncTwitterFactory(java.lang.String configTreePath,
                           TwitterListener listener)
Creates a AsyncTwitterFactory with a specified config tree, with given listener

Parameters:
configTreePath - the path
listener - listener
Method Detail

getInstance

protected AsyncTwitter getInstance(twitter4j.conf.Configuration conf,
                                   twitter4j.http.Authorization auth)


getOAuthSupportInstance

protected AsyncTwitter getOAuthSupportInstance(twitter4j.conf.Configuration conf,
                                               twitter4j.http.Authorization auth)


getOAuthAuthorizedInstance

public T getOAuthAuthorizedInstance(java.lang.String consumerKey,
                                    java.lang.String consumerSecret)
Returns a OAuth Authenticated instance.

Parameters:
consumerKey - consumer key
consumerSecret - consumer secret
Returns:
an instance

getOAuthAuthorizedInstance

public T getOAuthAuthorizedInstance(java.lang.String consumerKey,
                                    java.lang.String consumerSecret,
                                    twitter4j.http.AccessToken accessToken)
Returns a OAuth Authenticated instance.

Parameters:
consumerKey - consumer key
consumerSecret - consumer secret
accessToken - access token
Returns:
an instance

getOAuthAuthorizedInstance

public T getOAuthAuthorizedInstance(twitter4j.http.AccessToken accessToken)
Returns a OAuth Authenticated instance.
consumer key and consumer Secret must be provided by twitter4j.properties, or system properties.

Parameters:
accessToken - access token
Returns:
an instance

getOAuthSupportInstance

public T getOAuthSupportInstance(twitter4j.http.Authorization auth)

getInstance

public T getInstance()
Returns a instance.

Returns:
default singleton instance

getInstance

public T getInstance(twitter4j.http.Authorization auth)

getInstance

public T getInstance(java.lang.String screenName,
                     java.lang.String password)
Returns a Basic Authenticated instance.

Parameters:
screenName - screen name
password - password
Returns:
an instance


Copyright © 2010. All Rights Reserved.