Class Ismo_Core_Loaders_Interceptor

Description

A loader which makes it possible to apply AOP interceptors to state classes.

This loader goes between the

  1. Ismo_Core_Application
class and the
  1. Ismo_Core_State
class. The interceptors to be applied are configured on the interceptor loader and that loader is responsible for loading the classes, using the configured state class loader.

Example:

  1. // create the loader for the state classes
  2. $stateClassLoader =& new Ismo_Core_Loaders_FileSystem();
  3. $stateClassLoader->setPath('./states');
  4.  
  5. // create the interceptor loader
  6. $interceptorLoader =& new Ismo_Core_Loaders_Interceptor();
  7. $interceptorLoader->setStateLoader($stateClassLoader);
  8.  
  9. // create an interceptor
  10. $exampleInterceptor =& new ExampleInterceptor();
  11. // and add it to the interceptor loader
  12. $interceptorLoader->addInterceptor( '*',
  13. array('execdefault'),
  14. $exampleInterceptor);

Located in /Loaders/Interceptor.php (line 168)


	
			
Variable Summary
Method Summary
Ismo_Core_Loaders_Interceptor Ismo_Core_Loaders_Interceptor ()
void addInterceptor (mixed $states, array $methods, object &$interceptorInstance)
object the &getInstance (string $className)
void setStateLoader (object &$stateLoader)
Variables
array $_interceptors = null (line 184)

The configured interceptors.

  • access: private
object $_stateLoader = null (line 176)

The loader to use when loading the states

  • access: private
Methods
Constructor Ismo_Core_Loaders_Interceptor (line 191)

The constructor

  • access: public
Ismo_Core_Loaders_Interceptor Ismo_Core_Loaders_Interceptor ()
addInterceptor (line 219)

Adds an interceptor.

  • access: public
void addInterceptor (mixed $states, array $methods, object &$interceptorInstance)
  • mixed $states: either '*' which means all states or an array containing the names of the states to apply this interceptor to
  • array $methods: either '*' which means all methods or an array containing the names of the states to apply this interceptor to
  • object $interceptorInstance: the interceptor to apply
getInstance (line 238)

Returns an instance of the requested class.

Because this is the interceptor loader the returned class is not the actual class, but instead a proxy for that class. The proxy will execute configured interceptors when methods are called on the proxy.

  • return: created instance
  • access: public
object the &getInstance (string $className)
  • string $className: the name of the class to make an instance of
setStateLoader (line 202)

Sets the state loader.

  • access: public
void setStateLoader (object &$stateLoader)
  • object $stateLoader: the state loader instance to use

Documentation generated on Mon, 14 Jun 2004 11:59:26 +0200 by phpDocumentor 1.3.0RC3