Package restx

Examples of restx.AppSettings


        public CompileAppCommandRunner(List<String> args) {
        }

        @Override
        public void run(RestxShell shell) throws Exception {
            AppSettings appSettings = shell.getFactory()
                    .getComponent(AppSettings.class);
            compileMode.compile(
                    shell,
                    Paths.get(appSettings.targetClasses()),
                    Paths.get(appSettings.targetDependency()),
                    Paths.get(appSettings.mainSources()),
                    Paths.get(appSettings.mainResources()),
                    null);
        }
View Full Code Here


            }
        }

        @Override
        public void run(RestxShell shell) throws Exception {
            AppSettings appSettings = shell.getFactory()
                    .getComponent(AppSettings.class);
            Optional<String> pack = Optional.absent();
            if (appClassName == null) {
                pack = Apps.with(appSettings)
                        .guessAppBasePackage(shell.currentLocation());
                if (!pack.isPresent()) {
                    shell.printIn("can't find base app package, src/main/java should contain a AppServer.java source file somewhere",
                            RestxShell.AnsiCodes.ANSI_RED);
                    shell.println("");
                    shell.println("alternatively you can provide the class to run with `app generate-start-script <class.to.Run>`");
                    return;
                }
                appClassName = pack.get() + ".AppServer";
            } else {
                pack = Optional.of(appClassName.substring(0, appClassName.lastIndexOf('.')));
            }



            String command = "java" +
                    " -cp \"" + appSettings.targetClasses() + ":" + appSettings.targetDependency() + "/*\"" +
                    " -Drestx.app.package=" + pack.get() +
                    " -Drestx.mode=prod"
                    ;

            File startSh = shell.currentLocation().resolve("start.sh").toFile();
View Full Code Here

            if(restxMode.isPresent()) {
                vmOptions.add("-Drestx.mode="+restxMode.get());
            }

            String basePack = appClassName.substring(0, appClassName.lastIndexOf('.'));
            AppSettings appSettings = shell.getFactory()
                    .concat(new SingletonFactoryMachine<>(-10000, NamedComponent.of(String.class, "restx.app.package", basePack)))
                    .getComponent(AppSettings.class);
            new ShellAppRunner(appSettings, appClassName, compileMode, quiet, daemon, vmOptions)
                .run(shell);
        }
View Full Code Here

            this.jarFile = Paths.get(args.get(2));
        }

        @Override
        public void run(RestxShell shell) throws Exception {
            AppSettings appSettings = shell.getFactory().getComponent(AppSettings.class);
            new RestxArchive(jarFile).pack(
                    shell.currentLocation(),
                    shell.currentLocation().resolve(appSettings.targetClasses()),
                    Arrays.asList("target", "tmp", "logs")
            );
        }
View Full Code Here

                    shell.println("alternatively you can provide the base package with `spec test server <base.pack>`");
                    return;
                }
                basePack = pack.get();
            }
            AppSettings appSettings = shell.getFactory()
                    .concat(new SingletonFactoryMachine<>(-10000, NamedComponent.of(String.class, "restx.app.package", basePack)))
                    .getComponent(AppSettings.class);

            if (!DepsShellCommand.depsUpToDate(shell)) {
                shell.println("restx> deps install");
View Full Code Here

                    return new BillOfMaterials(ImmutableSet.<Factory.Query<?>>of(appSettings));
                }

                @Override
                public ComponentBox<AdminPage> newComponent(SatisfiedBOM satisfiedBOM) {
                    AppSettings settings = satisfiedBOM.getOne(appSettings).get().getComponent();
                    if (!RestxContext.Modes.RECORDING.equals(settings.mode())) {
                        return new EmptyBox<>(ADMIN_PAGE_NAME);
                    }
                    return BoundlessComponentBox.FACTORY.of(new NamedComponent<>(ADMIN_PAGE_NAME,
                            new AdminPage("/@/ui/recorder/", "Recorder")));
                }
View Full Code Here

TOP

Related Classes of restx.AppSettings

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.