AppserverIo\Appserver\MessageQueue\QueueManager::injectResourceLocator PHP Méthode

injectResourceLocator() public méthode

Injects the resource locator that locates the requested queue.
public injectResourceLocator ( AppserverIo\Psr\Pms\ResourceLocatorInterface $resourceLocator ) : void
$resourceLocator AppserverIo\Psr\Pms\ResourceLocatorInterface The resource locator
Résultat void
    public function injectResourceLocator(ResourceLocatorInterface $resourceLocator)
    {
        $this->resourceLocator = $resourceLocator;
    }

Usage Example

 /**
  * The main method that creates new instances in a separate context.
  *
  * @param \AppserverIo\Psr\Application\ApplicationInterface         $application          The application instance to register the class loader with
  * @param \AppserverIo\Appserver\Core\Api\Node\ManagerNodeInterface $managerConfiguration The manager configuration
  *
  * @return void
  */
 public static function visit(ApplicationInterface $application, ManagerNodeInterface $managerConfiguration)
 {
     // initialize the stackable containers
     $queues = new GenericStackable();
     $workers = new GenericStackable();
     $messages = new GenericStackable();
     // initialize the queue locator
     $queueLocator = new QueueLocator();
     // initialize the queue manager
     $queueManager = new QueueManager();
     $queueManager->injectQueues($queues);
     $queueManager->injectWorkers($workers);
     $queueManager->injectMessages($messages);
     $queueManager->injectApplication($application);
     $queueManager->injectResourceLocator($queueLocator);
     // attach the instance
     $application->addManager($queueManager, $managerConfiguration);
 }
All Usage Examples Of AppserverIo\Appserver\MessageQueue\QueueManager::injectResourceLocator