/**
  * @param string $contextReferenceId
  */
 public function __construct($contextReferenceId)
 {
     $this->logger = OvoLogger::getLogger(get_class($this));
     $this->prototypeBeanCreator = new PrototypeBeanCreatorImpl();
     $this->singletonBeanCreator = new SingletonBeanCreatorImpl($contextReferenceId);
     $this->sessionBeanCreator = new SessionBeanCreatorImpl($contextReferenceId);
 }
Example #2
0
 public function __construct($file, $contextReferenceId, Serializer $serializer)
 {
     $this->logger = OvoLogger::getLogger(get_class($this));
     $this->file = $file;
     $this->serializer = $serializer;
     $this->contextReader = $this->getReaderFromSession();
 }
 private function __construct($contextReferenceId)
 {
     self::$instance[$contextReferenceId] = $this;
     $this->logger = OvoLogger::getLogger(get_class($this));
     $this->sessionContextName = OvoSession::getName($contextReferenceId);
     $this->serializer = SessionSerializer::getInstance($contextReferenceId);
     $this->getSessionBeans();
 }
 public function __construct(Configuration $configuration, $contextReferenceId, Serializer $serializer)
 {
     $this->logger = OvoLogger::getLogger(get_class($this));
     $this->serializer = $serializer;
     $this->getPreLoadedBeansRepository();
     $this->init($configuration, $contextReferenceId);
     $configuration->save();
 }
Example #5
0
 private function __construct($contextReferenceId)
 {
     $this->logger = OvoLogger::getLogger(get_class($this));
     $this->sessionName = OvoSession::getName($contextReferenceId);
     self::$instance[$contextReferenceId] = $this;
     $this->contextReferenceId = $contextReferenceId;
     $this->unserializeObjects();
 }
Example #6
0
 /**
  * All Objects with static factory method are created here
  *
  * @param string $name the name of the Object to create
  * @param array $args construct args
  * @param string $factoryMethod the static method used to create the Object instance
  *
  * @return Object
  */
 public static function createObjectFromFactoryMethod($name, $args, $factoryMethod)
 {
     $logger = OvoLogger::getLogger('ObjectCreator');
     $logger->debug('Create Object ' . $name . ' form static method ' . $factoryMethod);
     try {
         $reflectionMethod = new \ReflectionMethod($name, $factoryMethod);
         return $reflectionMethod->invokeArgs(null, $args);
     } catch (\ReflectionException $e) {
         $logger->error('Reflection Error: ' . $e->getMessage());
         throw new OvoContainerException('Can not create Object (from factory) ' . $name . ' - ' . $e->getMessage());
     }
 }
 /**
  * Resolve dependency for bean $beanStructure
  *
  * @param BeanEnvelope $beanEnvelope
  *
  * @return void
  */
 public static function resolve(BeanEnvelope $beanEnvelope)
 {
     self::$logger = OvoLogger::getLogger(get_class());
     self::$logger->debug('Get dependencies form bean ' . $beanEnvelope->getClass());
     $beanInstance = $beanEnvelope->getInstance();
     $dependencies = $beanEnvelope->getProperties();
     if ($dependencies) {
         foreach ($dependencies as $dependency) {
             self::injectPropertyDependency($dependency, $beanInstance, $beanEnvelope->getContextReferenceId());
         }
     }
 }
 public function __construct($path, $dir = null)
 {
     $this->logger = OvoLogger::getLogger(get_class($this));
     $this->logger->debug('Annotation context on path ' . $path);
     $this->basicPath = $path;
     $cacheDir = PropertiesLoader::getProperty(self::ANNOTATION_CACHE);
     if (!isset($cacheDir) or $cacheDir == '') {
         $cacheDir = sys_get_temp_dir();
     }
     $this->logger->debug('Create annotation reader with cache dir: ' . $cacheDir);
     $this->annotationReader = new FileCacheReader(new AnnotationReader(), $cacheDir, PropertiesLoader::getProperty(self::ANNOTATION_DEBUG));
     $this->registerAnnotationFile();
     $this->scanContext($this->scanClassPath($path));
 }
 /**
  * @param string $contextReferenceId
  */
 private function __construct($contextReferenceId)
 {
     $this->logger = OvoLogger::getLogger(get_class($this));
     self::$instance[$contextReferenceId] = $this;
 }
 public function __construct(ContextReader $reader, $contextReferenceId)
 {
     $this->contextReferenceId = $contextReferenceId;
     $this->logger = OvoLogger::getLogger(get_class($this));
     $this->contextReader = $reader;
 }
 public function unserialize($serialized)
 {
     $unserializedData = unserialize($serialized);
     $this->preLoadedBeans = isset($unserializedData[ConfigurationLoader::PRE_LOADED_BEANS]) ? $unserializedData[ConfigurationLoader::PRE_LOADED_BEANS] : array();
     $this->logger = OvoLogger::getLogger(get_class($this));
 }
 public function __construct()
 {
     $this->logger = OvoLogger::getLogger(get_class($this));
 }
Example #13
0
 public function __wakeup()
 {
     $this->logger = OvoLogger::getLogger(get_class($this));
     $this->logger->debug('re-create Logger');
 }