/** * Create or get from the sessions the PreLoadedBeansRepository * * @return void */ private function getPreLoadedBeansRepository() { $this->preLoadedBeansRepository = $this->serializer->getObject(self::PRE_LOADED_BEANS); if ($this->preLoadedBeansRepository == null) { $this->preLoadedBeansRepository = new SimplePreLoadedBeansRepositoryImpl(); } $this->serializer->serializeObject(self::PRE_LOADED_BEANS, $this->preLoadedBeansRepository); }
/** * Search if exists the session Reader Object. * If not, ora data modified it's different, reload it * * @return ContextReader */ private function getReaderFromSession() { $this->logger->debug('Try to get ContextReader from the session'); $contextReader = $this->serializer->getObject(self::READER); $storedModificationData = $this->serializer->getObject(self::CONFIGURATION_FILE_MODIFICATON_DATE); $actualModificationData = filemtime($this->file); //if datemod Config file is different from data configfile in session, reload it //TODO check this for all the config file (ex: <include-file path='other.xml'>) if ($contextReader instanceof ContextReader and $storedModificationData != $actualModificationData) { $this->logger->debug('Reload configuration [ ' . $storedModificationData . ' - ' . $actualModificationData . ' ]'); $this->serializer->serializeObject(self::CONFIGURATION_FILE_MODIFICATON_DATE, $actualModificationData); $contextReader->reload(); $this->reload = true; } return $contextReader; }
/** * Save the object in the serializer */ public function store() { $this->serializer->serializeObject(self::REPO, $this->sessionBeans); }
/** * Method to serialize the session's beans created * * @return void */ private function serializingSessionBeans() { $this->sessionRepository->store(); $this->serializer->serializeObject(self::SESSION_BEANS_CREATED, $this->sessionBeansCreated); $this->serializer->store(); }