PHP Class AppserverIo\Appserver\MessageQueue\QueueManager

Author: Tim Wagner ([email protected])
Author: Markus Stockbauer ([email protected])
Author: Bernhard Wick ([email protected])
Inheritance: extends AppserverIo\Appserver\Core\AbstractManager, implements AppserverIo\Psr\Pms\QueueContextInterface
ファイルを表示 Open project: appserver-io/appserver Class Usage Examples

Public Methods

Method Description
createSenderForQueue ( string $lookupName, string $sessionId = null ) : AppserverIo\Messaging\QueueSender Return a new sender for the message queue with the passed lookup name.
getIdentifier ( ) : string Initializes the manager instance.
getManagerSettings ( ) : AppserverIo\Appserver\MessageQueue\QueueManagerSettingsInterface Return's the queue settings.
getQueues ( ) : array Returns the array with queue names and the MessageListener class names as values.
getResourceLocator ( ) : AppserverIo\Psr\Pms\ResourceLocatorInterface Return the resource locator instance.
hasQueue ( AppserverIo\Psr\Pms\QueueInterface $queue ) : boolean Returns TRUE if the application is related with the passed queue instance.
initialize ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void Has been automatically invoked by the container after the application instance has been created.
injectManagerSettings ( AppserverIo\Appserver\Application\Interfaces\ManagerSettingsInterface $managerSettings ) : void Injects the queue settings.
injectMessages ( AppserverIo\Storage\GenericStackable $messages ) : void Injects the storage for the messages.
injectQueues ( AppserverIo\Storage\GenericStackable $queues ) : void Injects the storage for the queues.
injectResourceLocator ( AppserverIo\Psr\Pms\ResourceLocatorInterface $resourceLocator ) : void Injects the resource locator that locates the requested queue.
injectWorkers ( AppserverIo\Storage\GenericStackable $workers ) : void Injects the storage for the workers.
locate ( AppserverIo\Psr\Pms\QueueInterface $queue ) : AppserverIo\Psr\Pms\QueueInterface Tries to locate the queue that handles the request and returns the instance if one can be found.
lookup ( string $lookupName, string $sessionId = null, array $args = [] ) : AppserverIo\Psr\Pms\QueueInterface Runs a lookup for the message queue with the passed lookup name and session ID.
stop ( ) : void Shutdown the session manager instance.
updateMonitor ( AppserverIo\Psr\Pms\MessageInterface $message ) : void Updates the message monitor.

Protected Methods

Method Description
registeMessageQueue ( AppserverIo\Appserver\Core\Api\Node\MessageQueueNodeInterface $messageQueueNode ) : void Deploys the message queue described by the passed node.
registerMessageQueues ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void Deploys the message queues.

Method Details

createSenderForQueue() public method

Return a new sender for the message queue with the passed lookup name.
public createSenderForQueue ( string $lookupName, string $sessionId = null ) : AppserverIo\Messaging\QueueSender
$lookupName string The lookup name of the queue to return a sender for
$sessionId string The session-ID to be passed to the queue session
return AppserverIo\Messaging\QueueSender The sender instance

getIdentifier() public method

Initializes the manager instance.
See also: AppserverIo\Psr\Application\ManagerInterface::initialize()
public getIdentifier ( ) : string
return string

getManagerSettings() public method

Return's the queue settings.
public getManagerSettings ( ) : AppserverIo\Appserver\MessageQueue\QueueManagerSettingsInterface
return AppserverIo\Appserver\MessageQueue\QueueManagerSettingsInterface The queue settings

getQueues() public method

Returns the array with queue names and the MessageListener class names as values.
public getQueues ( ) : array
return array The registered queues

getResourceLocator() public method

Return the resource locator instance.
public getResourceLocator ( ) : AppserverIo\Psr\Pms\ResourceLocatorInterface
return AppserverIo\Psr\Pms\ResourceLocatorInterface The resource locator instance

hasQueue() public method

Returns TRUE if the application is related with the passed queue instance.
public hasQueue ( AppserverIo\Psr\Pms\QueueInterface $queue ) : boolean
$queue AppserverIo\Psr\Pms\QueueInterface The queue the application has to be related to
return boolean TRUE if the application is related, else FALSE

initialize() public method

Has been automatically invoked by the container after the application instance has been created.
See also: AppserverIo\Psr\Application\ManagerInterface::initialize()
public initialize ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void
$application AppserverIo\Psr\Application\ApplicationInterface The application instance
return void

injectManagerSettings() public method

Injects the queue settings.
public injectManagerSettings ( AppserverIo\Appserver\Application\Interfaces\ManagerSettingsInterface $managerSettings ) : void
$managerSettings AppserverIo\Appserver\Application\Interfaces\ManagerSettingsInterface The queue settings
return void

injectMessages() public method

Injects the storage for the messages.
public injectMessages ( AppserverIo\Storage\GenericStackable $messages ) : void
$messages AppserverIo\Storage\GenericStackable An storage for the messages
return void

injectQueues() public method

Injects the storage for the queues.
public injectQueues ( AppserverIo\Storage\GenericStackable $queues ) : void
$queues AppserverIo\Storage\GenericStackable An storage for the queues
return void

injectResourceLocator() public method

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
return void

injectWorkers() public method

Injects the storage for the workers.
public injectWorkers ( AppserverIo\Storage\GenericStackable $workers ) : void
$workers AppserverIo\Storage\GenericStackable An storage for the workers
return void

locate() public method

Tries to locate the queue that handles the request and returns the instance if one can be found.
public locate ( AppserverIo\Psr\Pms\QueueInterface $queue ) : AppserverIo\Psr\Pms\QueueInterface
$queue AppserverIo\Psr\Pms\QueueInterface The queue request
return AppserverIo\Psr\Pms\QueueInterface The requested queue instance

lookup() public method

Runs a lookup for the message queue with the passed lookup name and session ID.
public lookup ( string $lookupName, string $sessionId = null, array $args = [] ) : AppserverIo\Psr\Pms\QueueInterface
$lookupName string The queue lookup name
$sessionId string The session ID
$args array The arguments passed to the queue
return AppserverIo\Psr\Pms\QueueInterface The requested queue instance

registeMessageQueue() protected method

Deploys the message queue described by the passed node.
protected registeMessageQueue ( AppserverIo\Appserver\Core\Api\Node\MessageQueueNodeInterface $messageQueueNode ) : void
$messageQueueNode AppserverIo\Appserver\Core\Api\Node\MessageQueueNodeInterface The node that describes the message queue
return void

registerMessageQueues() protected method

Deploys the message queues.
protected registerMessageQueues ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void
$application AppserverIo\Psr\Application\ApplicationInterface The application instance
return void

stop() public method

Shutdown the session manager instance.
public stop ( ) : void
return void \AppserverIo\Psr\Application\ManagerInterface::stop()

updateMonitor() public method

Updates the message monitor.
public updateMonitor ( AppserverIo\Psr\Pms\MessageInterface $message ) : void
$message AppserverIo\Psr\Pms\MessageInterface The message to update the monitor for
return void