public function getFactory()
    {
        $nb_engine = CNabuEngine::getEngine();

        if (!($this->nb_messaging_pool_manager instanceof CNabuMessagingPoolManager)) {
            $this->nb_messaging_pool_manager = CNabuEngine::getEngine()->getMessagingPoolManager();
        }

        if (!($this->nb_messaging_factory instanceof CNabuMessagingFactory)) {
            $this->nb_messaging_factory = $this->nb_messaging_pool_manager->getFactory($this);
        }

        return $this->nb_messaging_factory;
    }