LBFactory Class Reference
[Database]

An interface for generating database load balancers. More...

Inherited by LBFactory_Multi, and LBFactory_Simple.

List of all members.

Public Member Functions

 __construct ($conf)
 Construct a factory based on a configuration array (typically from $wgLBFactoryConf).
 newMainLB ($wiki=false)
 Create a new load balancer object.
 getMainLB ($wiki=false)
 Get a cached (tracked) load balancer object.
 newExternalLB ($cluster, $wiki=false)
getExternalLB ($cluster, $wiki=false)
 forEachLB ($callback, $params=array())
 Execute a function for each tracked load balancer The callback is called with the load balancer as the first parameter, and $params passed as the subsequent parameters.
 shutdown ()
 Prepare all tracked load balancers for shutdown STUB.
 forEachLBCallMethod ($methodName, $args=array())
 Call a method of each tracked load balancer.
 callMethod ($loadBalancer, $methodName, $args)
 Private helper for forEachLBCallMethod.
 commitMasterChanges ()
 Commit changes on all master connections.

Static Public Member Functions

static & singleton ()
 Get an LBFactory instance.
static destroyInstance ()
 Shut down, close connections and destroy the cached instance.

Static Public Attributes

static $instance


Detailed Description

An interface for generating database load balancers.

Definition at line 11 of file LBFactory.php.


Constructor & Destructor Documentation

LBFactory::__construct ( conf  )  [abstract]

Construct a factory based on a configuration array (typically from $wgLBFactoryConf).

Reimplemented in LBFactory_Simple, and LBFactory_Multi.


Member Function Documentation

LBFactory::callMethod ( loadBalancer,
methodName,
args 
)

Private helper for forEachLBCallMethod.

Definition at line 101 of file LBFactory.php.

References $args.

LBFactory::commitMasterChanges (  ) 

Commit changes on all master connections.

Definition at line 108 of file LBFactory.php.

References forEachLBCallMethod().

Referenced by LBFactory_Multi::shutdown(), and LBFactory_Simple::shutdown().

static LBFactory::destroyInstance (  )  [static]

Shut down, close connections and destroy the cached instance.

Definition at line 30 of file LBFactory.php.

LBFactory::forEachLB ( callback,
params = array() 
) [abstract]

Execute a function for each tracked load balancer The callback is called with the load balancer as the first parameter, and $params passed as the subsequent parameters.

Reimplemented in LBFactory_Simple, and LBFactory_Multi.

Referenced by forEachLBCallMethod().

LBFactory::forEachLBCallMethod ( methodName,
args = array() 
)

Call a method of each tracked load balancer.

Definition at line 94 of file LBFactory.php.

References $args, and forEachLB().

Referenced by commitMasterChanges().

& LBFactory::getExternalLB ( cluster,
wiki = false 
) [abstract]

Reimplemented in LBFactory_Simple, and LBFactory_Multi.

LBFactory::getMainLB ( wiki = false  )  [abstract]

Get a cached (tracked) load balancer object.

Parameters:
string $wiki Wiki ID, or false for the current wiki
Returns:
LoadBalancer

Reimplemented in LBFactory_Simple, and LBFactory_Multi.

LBFactory::newExternalLB ( cluster,
wiki = false 
) [abstract]

Reimplemented in LBFactory_Simple, and LBFactory_Multi.

LBFactory::newMainLB ( wiki = false  )  [abstract]

Create a new load balancer object.

The resulting object will be untracked, not chronology-protected, and the caller is responsible for cleaning it up.

Parameters:
string $wiki Wiki ID, or false for the current wiki
Returns:
LoadBalancer

Reimplemented in LBFactory_Simple, and LBFactory_Multi.

LBFactory::shutdown (  ) 

Prepare all tracked load balancers for shutdown STUB.

Reimplemented in LBFactory_Simple, and LBFactory_Multi.

Definition at line 89 of file LBFactory.php.

static& LBFactory::singleton (  )  [static]

Get an LBFactory instance.

Definition at line 17 of file LBFactory.php.

References $wgLBFactoryConf.

Referenced by wfGetLBFactory().


Member Data Documentation

LBFactory::$instance [static]

Definition at line 12 of file LBFactory.php.


The documentation for this class was generated from the following file:

Generated on Sat Sep 5 02:08:40 2009 for MediaWiki by  doxygen 1.5.9