public static function beansOfType(ApplicationInterface $applicationContext, $class)
    {
        /**
         * @var $objectManager ObjectManagerInterface
         */
        $objectManager = $applicationContext->search("ObjectManagerInterface");
        $initialContext = new InitialContext();
        $initialContext->injectApplication($applicationContext);
        $beans = array();
        foreach ($objectManager->getObjectDescriptors() as $descriptor) {
            if ($descriptor instanceof ComponentDescriptorInterface) {
                if (is_subclass_of($descriptor->getClassName(), $class)) {
                    $beans[$descriptor->getName()] = $initialContext->lookup($descriptor->getName());
                }
            }
        }
        return $beans;
    }