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
private  Configuration conf
           
private static long serialVersionUID
           
 
Constructor Summary
AsyncTwitterFactory()
          Creates an AsyncTwitterFactory with the root configuration, with no listener.
AsyncTwitterFactory(Configuration conf)
          Creates an AsyncTwitterFactory with the given configuration.
AsyncTwitterFactory(java.lang.String configTreePath)
          Creates a AsyncTwitterFactory with the specified config tree, with given listener
 
Method Summary
 AsyncTwitter getInstance()
          Returns a default singleton instance.
 AsyncTwitter getInstance(AccessToken accessToken)
          Returns a OAuth Authenticated instance.
consumer key and consumer Secret must be provided by twitter4j.properties, or system properties.
Unlike OAuthSupport.setOAuthAccessToken(twitter4j.auth.AccessToken), this factory method potentially returns a cached instance.
 AsyncTwitter getInstance(Authorization auth)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conf

private final Configuration conf

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

AsyncTwitterFactory

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


AsyncTwitterFactory

public AsyncTwitterFactory(Configuration conf)
Creates an AsyncTwitterFactory with the given configuration.

Parameters:
conf - the configuration to use
Since:
Twitter4J 2.1.1

AsyncTwitterFactory

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

Parameters:
configTreePath - the path
Since:
Twitter4J 2.1.12
Method Detail

getInstance

public AsyncTwitter getInstance()
Returns a default singleton instance.

Returns:
default singleton instance

getInstance

public AsyncTwitter getInstance(AccessToken accessToken)
Returns a OAuth Authenticated instance.
consumer key and consumer Secret must be provided by twitter4j.properties, or system properties.
Unlike OAuthSupport.setOAuthAccessToken(twitter4j.auth.AccessToken), this factory method potentially returns a cached instance.

Parameters:
accessToken - access token
Returns:
an instance

getInstance

public AsyncTwitter getInstance(Authorization auth)
Parameters:
auth - authorization
Returns:
an instance