PHP Class Prooph\ServiceBus\Plugin\ServiceLocatorPlugin

This plugin can be used to lazy load message handlers. Initialize it with a Interop\Container\ContainerInterface and route your messages to the service id only.
Author: Alexander Miertsch ([email protected])
Inheritance: implements Prooph\Common\Event\ActionEventListenerAggregate, use trait Prooph\Common\Event\DetachAggregateHandlers
Show file Open project: prooph/service-bus Class Usage Examples

Protected Properties

Property Type Description
$serviceLocator Interop\Container\ContainerInterface

Public Methods

Method Description
__construct ( Interop\Container\ContainerInterface $serviceLocator )
attach ( Prooph\Common\Event\ActionEventEmitter $events ) : void
onLocateMessageHandler ( Prooph\Common\Event\ActionEvent $actionEvent )

Method Details

__construct() public method

public __construct ( Interop\Container\ContainerInterface $serviceLocator )
$serviceLocator Interop\Container\ContainerInterface

attach() public method

public attach ( Prooph\Common\Event\ActionEventEmitter $events ) : void
$events Prooph\Common\Event\ActionEventEmitter
return void

onLocateMessageHandler() public method

public onLocateMessageHandler ( Prooph\Common\Event\ActionEvent $actionEvent )
$actionEvent Prooph\Common\Event\ActionEvent

Property Details

$serviceLocator protected property

protected ContainerInterface,Interop\Container $serviceLocator
return Interop\Container\ContainerInterface