Package org.lilyproject.runtime

Examples of org.lilyproject.runtime.LilyRuntime


        LilyRuntimeSettings settings = new LilyRuntimeSettings();
        settings.setRepository(resolveRepository());
        settings.setConfManager(getConfManager());

        runtime = new LilyRuntime(settings);
        runtime.setMode(Mode.getDefault());
        runtime.start();
    }
View Full Code Here


            LilyRuntimeSettings settings = new LilyRuntimeSettings();
            settings.setModel(model);
            settings.setRepository(localRepository);
            settings.setConfManager(getConfManager());

            runtime = new LilyRuntime(settings);
            runtime.setMode(getMode());

            if (startRuntime()) {
                runtime.start();
            }
View Full Code Here

        settings.setDisabledModuleIds(disabledModuleIds);
        settings.setRepository(artifactRepository);
        settings.setSourceLocations(sourceLocations);
        settings.setEnableArtifactSharing(!cmd.hasOption(disableClassSharingOption.getOpt()));

        LilyRuntime runtime = new LilyRuntime(settings);

        if (cmd.hasOption(modeOption.getOpt())) {
            String optionValue = cmd.getOptionValue(modeOption.getOpt());
            Mode mode = Mode.byName(optionValue);
            runtime.setMode(mode);
        }

        if (cmd.hasOption(versionOption.getOpt())) {
            System.out.println(runtime.buildModel().moduleInfo(System.getProperty("lilyruntime.info.module")));
            System.exit(0);
        }

        try {
            runtime.start();
            Runtime.getRuntime().addShutdownHook(new Thread(new ShutdownHandler(runtime)));
            printStartedMessage();
        } catch (Throwable e) {
            e.printStackTrace();
            System.err.println("Startup failed. Will try to shutdown and exit.");
            try {
                runtime.stop();
            } finally {
                System.exit(1);
            }
        }
View Full Code Here

        LilyRuntimeSettings settings = new LilyRuntimeSettings();
        settings.setModel(model);
        settings.setRepository(dummyRepository);
        settings.setConfManager(new ConfManagerImpl());

        LilyRuntime runtime = new LilyRuntime(settings);
        runtime.start();
        runtime.stop();

        // Test we can start the runtime a second time
        runtime = new LilyRuntime(settings);
        runtime.start();
        runtime.stop();

        // Same with connectors configured
        runtime = new LilyRuntime(settings);
        runtime.start();
        runtime.stop();

        // Test that we can't start the same runtime twice
        try {
            runtime.start();
            Assert.fail("Starting the same runtime instance twice should fail.");
        } catch (Exception e) {}

        // Test that we can't start if we don't set a repository in the config
        settings.setRepository(null);
        runtime = new LilyRuntime(settings);
        try {
            runtime.start();
            Assert.fail("Starting runtime should fail if there is no artifact repository configured.");
        } catch (Exception e) {}
    }
View Full Code Here

TOP

Related Classes of org.lilyproject.runtime.LilyRuntime

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.