单次请求的初始化

@throws BaseException
429831
public function init()
    {
        /**
         * 设置默认时区
         */
        if ($this->timezone)
        {
            date_default_timezone_set($this->timezone);
        }

        /**
         * 设置地区信息（地域信息）
         */
        if ($this->locale)
        {
            setlocale(LC_ALL, $this->locale);
        }

        if ($this->charset && function_exists('mb_internal_encoding'))
        {
            mb_internal_encoding($this->charset);
        }

        /**
         * 当输入字符的编码是无效的，或者字符代码不存在于输出的字符编码中时，可以为其指定一个替代字符。
         *
         * @link http://www.php.net/manual/function.mb-substitute-character.php
         */
        mb_substitute_character('none');

        // 确保输入的数据安全
        $_GET = Security::sanitize($_GET);
        $_POST = Security::sanitize($_POST);
        $_COOKIE = Security::sanitize($_COOKIE);

        self::cleanComponents();
    }
304609
public List<String> getBaseTables() throws SQLException {

		List<String> baseTables = new ArrayList<String>();

		List<ExtendedRelation> extendedRelations = queryForAll();
		for (ExtendedRelation extendedRelation : extendedRelations) {
			baseTables.add(extendedRelation.getBaseTableName());
		}

		return baseTables;
	}
867131
public void train() throws Exception {

			//建立字典管理器

			
			Pipe lpipe = new Target2Label(al);
			Pipe fpipe = new StringArray2IndexArray(factory, true);
			//构造转换器组
			SeriesPipes pipe = new SeriesPipes(new Pipe[]{lpipe,fpipe});



			InstanceSet instset = new InstanceSet(pipe,factory);
			instset.loadThruStagePipes(new SimpleFileReader(trainFile," ",true,Type.LabelData)); 
			Generator gen = new SFGenerator();
			ZeroOneLoss l = new ZeroOneLoss();
			Inferencer ms = new LinearMax(gen, factory.getLabelSize());
			Update update = new LinearMaxPAUpdate(l);
			OnlineTrainer trainer = new OnlineTrainer(ms, update,l, factory, 50,0.005f);
			Linear pclassifier = trainer.train(instset,instset);
			pipe.removeTargetPipe();
			pclassifier.setPipe(pipe);
			factory.setStopIncrement(true);
			pclassifier.saveTo(modelFile);
		}
1153281
@Override
    public synchronized void release() throws Exception
    {
        Exception       baseException = null;

        for ( InterProcessLock lock : reverse(locks) )
        {
            try
            {
                lock.release();
            }
            catch ( Exception e )
            {
                ThreadUtils.checkInterrupted(e);
                if ( baseException == null )
                {
                    baseException = e;
                }
                else
                {
                    baseException = new Exception(baseException);
                }
            }
        }

        if ( baseException != null )
        {
            throw baseException;
        }
    }
738819
public void setBase(String base) {
        if (base != null) {
            this.base = LdapUtils.newLdapName(base);
        } else {
            this.base = LdapUtils.emptyLdapName();
        }
    }
779558
public void train() throws Exception {

		loadData();
		/**
		 * 
		 * 更新参数的准则
		 */
		Update update;
		// viterbi解码
		Inferencer inference;

		HammingLoss loss = new HammingLoss();
		if (standard) {
			inference = new LinearViterbi(templets, labels.size());
			update = new LinearViterbiPAUpdate((LinearViterbi) inference, loss);
		} else {
			inference = new HigherOrderViterbi(templets, labels.size());
			update = new HigherOrderViterbiPAUpdate(templets, labels.size(), true);
		}

		OnlineTrainer trainer;

		if(cl!=null){
			trainer = new OnlineTrainer(cl, update, loss, factory,iterNum, c);
		}else{
			trainer = new OnlineTrainer(inference, update, loss,
					factory, iterNum, c);
		}

		cl = trainer.train(trainSet, testSet);

		if(cl!=null&&newmodel!=null)
			saveTo(newmodel);
		else
			saveTo(model);

	}
1051095
@PostConstruct
	protected void init() throws IOException {
		// base configuration from XML file
		if (null != configurationFile) {
			log.debug("Get base configuration from {}", configurationFile);
			manager = new DefaultCacheManager(configurationFile);
		} else {
			GlobalConfigurationBuilder builder = new GlobalConfigurationBuilder();
			builder.globalJmxStatistics().allowDuplicateDomains(true);
			manager = new DefaultCacheManager(builder.build());
		}

		if (listener == null) {
			listener = new InfinispanCacheListener();
		}
		manager.addListener(listener);

		// cache for caching the cache configurations (hmmm, sounds a bit strange)
		Map<String, Map<CacheCategory, CacheService>> cacheCache = 
				new HashMap<String, Map<CacheCategory, CacheService>>();

		// build default configuration
		if (null != defaultConfiguration) {
			setCaches(cacheCache, null, defaultConfiguration);
		}

		// build layer specific configurations
		for (Layer layer : layerMap.values()) {
			CacheInfo ci = configurationService.getLayerExtraInfo(layer.getLayerInfo(), CacheInfo.class);
			if (null != ci) {
				setCaches(cacheCache, layer, ci);
			}
		}
	}
1076832
public function getName()
    {
        return isset($this->name) && $this->name ? $this->name : class_basename($this);
    }
951985
public void init(BaseField field)
    {
        super.init(field);
        m_BehaviorList = new Vector<BaseListener>();
        m_dependentListener = null;
    }
541209
private void setBaseEntry(Map<String, Object> configProps) throws WIMException {
/*
 * Map<String, List<Map<String, Object>>> configMap = Nester.nest(configProps, BASE_ENTRY);
 *
 * for (Map<String, Object> entry : configMap.get(BASE_ENTRY)) {
 * baseEntryName = (String) entry.get(BASE_ENTRY_NAME);
 * }
 */
        baseEntryName = (String) configProps.get(BASE_ENTRY);

        if (baseEntryName == null) {
            throw new WIMApplicationException(WIMMessageKey.MISSING_BASE_ENTRY, Tr.formatMessage(tc, WIMMessageKey.MISSING_BASE_ENTRY,
                                                                                                 WIMMessageHelper.generateMsgParms(reposId)));
        }
    }
333289
@Override
  public final synchronized void init() throws Exception {
    FactoryBldServices<ResultSet> factoryBldServices =
      new FactoryBldServices<ResultSet>();
    factoryBldServices.setFactoryAppBeans(this);
    setFactoryBldServices(factoryBldServices);
    FactoryReplicatorXmlHttps<ResultSet> factoryReplicatorXmlHttps =
      new FactoryReplicatorXmlHttps<ResultSet>();
    factoryReplicatorXmlHttps.setFactoryAppBeans(this);
    setFactoryReplicatorXmlHttps(factoryReplicatorXmlHttps);
    FactoryDatabaseWriterXml<ResultSet> factoryDatabaseWriterXml =
      new FactoryDatabaseWriterXml<ResultSet>();
    factoryDatabaseWriterXml.setFactoryAppBeans(this);
    setFactoryDatabaseWriterXml(factoryDatabaseWriterXml);
  }
355281
@Override
  public final synchronized void init() throws Exception {
    FactoryBldAccServices<ResultSet> factoryBldAccServices =
      new FactoryBldAccServices<ResultSet>();
    factoryBldAccServices.setFactoryAppBeans(this);
    setFactoryBldServices(factoryBldAccServices);
    FactoryAccServices<ResultSet> factoryAccServices =
      new FactoryAccServices<ResultSet>();
    factoryAccServices.setFactoryAppBeans(this);
    factoryAccServices.setFactoryBldAccServices(factoryBldAccServices);
    factoryBldAccServices.setFactoryAccServices(factoryAccServices);
    setFactoryOverBeans(factoryAccServices);
    FactoryAccReplicatorXmlHttps<ResultSet> factoryReplicatorXmlHttps =
      new FactoryAccReplicatorXmlHttps<ResultSet>();
    factoryReplicatorXmlHttps.setFactoryAppBeans(this);
    setFactoryReplicatorXmlHttps(factoryReplicatorXmlHttps);
    FactoryAccDatabaseWriterXml<ResultSet> factoryDatabaseWriterXml =
      new FactoryAccDatabaseWriterXml<ResultSet>();
    factoryDatabaseWriterXml.setFactoryAppBeans(this);
    setFactoryDatabaseWriterXml(factoryDatabaseWriterXml);
  }
1047567
public static BaseException translateException(Exception exception) {
        if (exception instanceof BaseException) {
            return (BaseException) exception;
        } else {
            for (SeedExceptionTranslator exceptionTranslator : exceptionTranslators) {
                if (exceptionTranslator.canTranslate(exception)) {
                    return exceptionTranslator.translate(exception);
                }
            }
            return SeedException.wrap(exception, CoreErrorCode.UNEXPECTED_EXCEPTION);
        }
    }
1351527
private function validateRequiredProperties()
    {
        if ($this->base_url == null) {
            throw new \Exception('The base_url property was not set.');
        }

        if (is_numeric($this->total_records)) {
            $this->total_records = intval($this->total_records);
        } else {
            throw new \Exception('The total_records property was not set.');
        }

        if (!is_numeric($this->page_number_value)) {
            throw new \Exception('The page_number_value property was not set.');
        }
    }
747040
public function execute()
    {
        $this->rendered['sub-elements'] = array();
        try {
            $this->hook('pre-render');
            $this->hook('beforeRender');
            $this->recursiveRender();
            if (isset($_GET['cut_object'])) {
                throw new BaseException("Unable to cut object with name='".$_GET['cut_object']."'. ".
                    "It wasn't initialized");
            }
            if (isset($_GET['cut_region'])) {
                // @todo Imants: This looks something obsolete. At least property cut_region_result is never defined.
                if (!$this->cut_region_result) {
                    throw new BaseException("Unable to cut region with name='".$_GET['cut_region']."'");
                }
                echo $this->cut_region_result;

                return;
            }
        } catch (Exception $e) {
            if ($e instanceof Exception_Stop) {
                $this->hook('cut-output');
                if (isset($e->result)) {
                    echo $e->result;
                }
                $this->hook('post-render-output');

                return;
            }
            throw $e;
        }
    }
141997
public function init()
  {
    parent::init();
    if($this->basePath===null)
      $this->basePath=Yii::$app->getAlias('@app');
    $this->prepare();
  }
565405
public function handleException(ServerRequestInterface $request, ResponseInterface $response, BaseException $exception)
    {
        return $this
            ->getContentTypeHandler($request)
            ->handleException($request, $response, $exception);
    }