<commit_before>/*
 * Copyright 2014 hbz NRW (http://www.hbz-nrw.de/)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
import static play.mvc.Results.notFound;

import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

import models.Globals;
import play.Application;
import play.GlobalSettings;
import play.libs.F.Promise;
import play.mvc.Action;
import play.mvc.Http.Request;
import play.mvc.Http.RequestHeader;
import play.mvc.Result;

/**
 * @author <NAME>
 *
 */
public class Global extends GlobalSettings {
    @Override
    public void onStart(Application app) {
	play.Logger.info("Application has started");
	Globals.search.init(Globals.namespaces);
	Globals.taskManager.init();
	Globals.taskManager.execute();
    }

    @Override
    public void onStop(Application app) {
	// Globals.profile.saveMap();
	play.Logger.info("Application shutdown...");
	Globals.taskManager.shutdown();
    }

    public Promise<Result> onHandlerNotFound(RequestHeader request) {
	return Promise.<Result> pure(notFound("Action not found "
		+ request.uri()));
    }<commit_msg>init fedora content models on every start - to make sure that proper port is used - affects oai-pmh providing<commit_after>/*
 * Copyright 2014 hbz NRW (http://www.hbz-nrw.de/)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
import static play.mvc.Results.notFound;

import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

import models.Globals;
import play.Application;
import play.GlobalSettings;
import play.libs.F.Promise;
import play.mvc.Action;
import play.mvc.Http.Request;
import play.mvc.Http.RequestHeader;
import play.mvc.Result;
import controllers.MyUtils;

/**
 * @author <NAME>
 *
 */
public class Global extends GlobalSettings {
    @Override
    public void onStart(Application app) {
	play.Logger.info("Application has started");
	for (int i = 0; i < Globals.namespaces.length; i++) {
	    MyUtils.initContentModels(Globals.namespaces[i]);
	}
	MyUtils.initContentModels("");
	Globals.search.init(Globals.namespaces);
	Globals.taskManager.init();
	Globals.taskManager.execute();
    }

    @Override
    public void onStop(Application app) {
	// Globals.profile.saveMap();
	play.Logger.info("Application shutdown...");
	Globals.taskManager.shutdown();
    }

    public Promise<Result> onHandlerNotFound(RequestHeader request) {
	return Promise.<Result> pure(notFound("Action not found "
		+ request.uri()));
    }
{'fraction_non_alphanumeric': 0.11114198388441233, 'fraction_numerical': 0.004723534315087524, 'mean_word_length': 4.070422535211268, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1724298', 'n_tokens_mistral': 1090, 'n_tokens_neox': 1066, 'n_words': 328}