facebook4j
Class FacebookFactory

java.lang.Object
  extended by facebook4j.FacebookFactory
All Implemented Interfaces:
java.io.Serializable

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

A factory class for Facebook.
An instance of this class is completely thread safe and can be re-used and used concurrently.

Since:
Twitter4J 2.1.0
Author:
Yusuke Yamamoto - yusuke at mac.com, Ryuji Yamashita - roundrop at gmail.com
See Also:
Serialized Form

Field Summary
private  Configuration conf
           
(package private) static Authorization DEFAULT_AUTHORIZATION
           
private static java.lang.reflect.Constructor<Facebook> FACEBOOK_CONSTRUCTOR
           
private static long serialVersionUID
           
private static Facebook SINGLETON
           
 
Constructor Summary
FacebookFactory()
          Creates a FacebookFactory with the root configuration.
FacebookFactory(Configuration conf)
          Creates a FacebookFactory with the given configuration.
FacebookFactory(java.lang.String configTreePath)
          Creates a FacebookFactory with a specified config tree
 
Method Summary
 Facebook getInstance()
          Returns a instance associated with the configuration bound to this factory.
 Facebook getInstance(AccessToken accessToken)
          Returns a OAuth Authenticated instance.
app Id and app Secret must be provided by facebook4j.properties, or system properties.
Unlike OAuthSupport.setOAuthAccessToken(facebook4j.auth.AccessToken), this factory method potentially returns a cached instance.
 Facebook getInstance(Authorization auth)
           
static Facebook getSingleton()
          Returns default singleton Facebook instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FACEBOOK_CONSTRUCTOR

private static final java.lang.reflect.Constructor<Facebook> FACEBOOK_CONSTRUCTOR

DEFAULT_AUTHORIZATION

static final Authorization DEFAULT_AUTHORIZATION

SINGLETON

private static final Facebook SINGLETON

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

conf

private final Configuration conf
Constructor Detail

FacebookFactory

public FacebookFactory()
Creates a FacebookFactory with the root configuration.


FacebookFactory

public FacebookFactory(Configuration conf)
Creates a FacebookFactory with the given configuration.

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

FacebookFactory

public FacebookFactory(java.lang.String configTreePath)
Creates a FacebookFactory with a specified config tree

Parameters:
configTreePath - the path
Method Detail

getInstance

public Facebook getInstance()
Returns a instance associated with the configuration bound to this factory.

Returns:
default singleton instance

getInstance

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

Parameters:
accessToken - access token
Returns:
an instance
Since:
Twitter4J 2.1.9

getInstance

public Facebook getInstance(Authorization auth)

getSingleton

public static Facebook getSingleton()
Returns default singleton Facebook instance.

Returns:
default singleton Facebook instance
Since:
Twitter4J 2.2.4