injectWorkers() 공개 메소드

Injects the storage for the workers.
public injectWorkers ( AppserverIo\Storage\GenericStackable $workers ) : void
$workers AppserverIo\Storage\GenericStackable An storage for the workers
리턴 void
예제 #1
0
 /**
  * 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);
 }
 /**
  * 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 default settings for message queue
     $queueManagerSettings = new QueueManagerSettings();
     $queueManagerSettings->mergeWithParams($managerConfiguration->getParamsAsArray());
     // initialize the queue manager
     $queueManager = new QueueManager();
     $queueManager->injectQueues($queues);
     $queueManager->injectWorkers($workers);
     $queueManager->injectMessages($messages);
     $queueManager->injectApplication($application);
     $queueManager->injectResourceLocator($queueLocator);
     $queueManager->injectManagerSettings($queueManagerSettings);
     // attach the instance
     $application->addManager($queueManager, $managerConfiguration);
 }