Package configuration

Examples of configuration.Configuration


    public static Communicator getCommunicator() throws Exception {
        if (communicator == null) {
            Configuration.loadConfiguration();
            //get lodead configuration
            Configuration config = Configuration.getCurrentConfiguration();
            //initializing communicator based on the configuration
            initializeCommunicator(config.getClusterConfiguration());
            int rmiPort = Configuration.getCurrentConfiguration().getCurrentNodeConfiguration().getRmiRepositoryPort();
            Communicator.getCommunicator().initializeCommunicatorServer(rmiPort);
        }
        return communicator;
    }
View Full Code Here


    }

    public static void main(String[] args)
    {
        final DownloadReport report = new DownloadReport();
        Configuration conf = new Configuration();
        if (parseArgs(args, conf))
        {
            try
            {
                /* Parse the configuration xml file */
                conf.loadFile((String) conf.get("config_file"));

                /* Load the plugins */
                PluginLoader loader = new PluginLoader((String)(conf.get(Configuration.PLUGIN_FOLDER_TAG)));
                loader.load();

                /* Get the subreddits */
                List<String> subreddits = (List<String>)conf.get(Configuration.SUBREDDITS_ALLOWED_TAG);

                /* Get number of download threads and create the thread pool */
                String downloadThreads = (String)conf.get(Configuration.PARALLEL_DOWNLOAD_TAG);
                int numberOfThreads = downloadThreads == null ? 10 : Integer.valueOf(downloadThreads);
                ExecutorService threadPool = Executors.newFixedThreadPool(numberOfThreads);

                /* Connect to reddit and get the content from the source given */
                System.out.println("Connecting to reddit");
                RedditRequest reddit = new RedditRequest((String) conf.get("reddit_token"));

                System.out.println("Fetching results");

                String sourceUrl = (String) conf.get("source_url");

                String countStr = (String) conf.get("count");
                int count = countStr == null ? 25 : Integer.valueOf(countStr);
                int numberOfBatchs = count / 100 + 1;
                String lastFetched = null;

                for (int i = 0; i < numberOfBatchs; ++i)
View Full Code Here

                                                     );
        }

        reportingTripleHandler = new ReportingTripleHandler(tripleHandler);

        final Configuration configuration = DefaultConfiguration.singleton();
        extractionParameters =
                pedantic
                        ?
                new ExtractionParameters(configuration, ValidationMode.ValidateAndFix, nestingDisabled)
                        :
View Full Code Here

                                                     );
        }

        reportingTripleHandler = new ReportingTripleHandler(tripleHandler);

        final Configuration configuration = DefaultConfiguration.singleton();
        extractionParameters =
                pedantic
                        ?
                new ExtractionParameters(configuration, ValidationMode.ValidateAndFix, nestingDisabled)
                        :
View Full Code Here

TOP

Related Classes of configuration.Configuration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.