Package com.asakusafw.yaess.core

Examples of com.asakusafw.yaess.core.ProfileContext


    private CommandScriptHandlerDispatcher create(Map<String, String> conf) throws InterruptedException, IOException {
        ServiceProfile<CommandScriptHandlerDispatcher> profile = new ServiceProfile<CommandScriptHandlerDispatcher>(
                PREFIX,
                CommandScriptHandlerDispatcher.class,
                conf,
                new ProfileContext(
                        getClass().getClassLoader(),
                        new VariableResolver(Collections.<String, String>emptyMap())));
        return profile.newInstance();
    }
View Full Code Here


    QueueHadoopScriptHandler create() {
        ServiceProfile<QueueHadoopScriptHandler> profile = new ServiceProfile<QueueHadoopScriptHandler>(
                "testing",
                QueueHadoopScriptHandler.class,
                map("prop.s", "service", "1.url", "http://example.com"),
                new ProfileContext(getClass().getClassLoader(), new VariableResolver(map())));
        try {
            return profile.newInstance();
        } catch (Exception e) {
            throw new AssertionError(e);
        }
View Full Code Here

                "LOCATION", lockDir.getAbsolutePath()));
        Map<String, String> conf = new HashMap<String, String>();
        conf.put(BasicLockProvider.KEY_DIRECTORY, "${LOCATION}");

        ServiceProfile<ExecutionLockProvider> profile = new ServiceProfile<ExecutionLockProvider>(
                "testing", BasicLockProvider.class, conf, new ProfileContext(getClass().getClassLoader(), var));
        ExecutionLockProvider instance = profile.newInstance();
        ExecutionLock lock = instance.newInstance("batch");
        try {
            lock.beginFlow("flow", "exec");
            assertThat(lockDir.list().length, is(greaterThan(start)));
View Full Code Here

                "LOCATION", lockDir.getAbsolutePath()));
        Map<String, String> conf = new HashMap<String, String>();
        conf.put(BasicLockProvider.KEY_DIRECTORY, "${__INVALID__}");

        ServiceProfile<ExecutionLockProvider> profile = new ServiceProfile<ExecutionLockProvider>(
                "testing", BasicLockProvider.class, conf, new ProfileContext(getClass().getClassLoader(), var));
        profile.newInstance();
    }
View Full Code Here

        Configuration result = new Configuration();
        result.mode = computeMode(flowId, executionId, phaseName);

        LOG.debug("Loading profile: {}", profile);
        try {
            ProfileContext context = ProfileContext.system(loader);
            Properties properties = CommandLineUtil.loadProperties(new File(profile));
            result.profile = YaessProfile.load(properties, context);
        } catch (Exception e) {
            YSLOG.error(e, "E01001", profile);
            throw new IllegalArgumentException(MessageFormat.format(
View Full Code Here

                "testing",
                QueueHadoopScriptHandler.class,
                map(new String[] {
                        "1.url", "http://www.example.com/jobqueue"
                }),
                new ProfileContext(getClass().getClassLoader(), new VariableResolver(map(new String[] {
                }))));
        JobClientProfile profile = JobClientProfile.convert(original);
        assertThat(profile.getPrefix(), is("testing"));
        assertThat(profile.getTimeout(), is(JobClientProfile.DEFAULT_TIMEOUT));
        assertThat(profile.getPollingInterval(), is(JobClientProfile.DEFAULT_POLLING_INTERVAL));
View Full Code Here

                        "1.url", "http://www.example.com/jobqueue/1",
                        "2.url", "http://www.example.com/jobqueue/2",
                        "2.user", "u2",
                        "2.password", "p2",
                }),
                new ProfileContext(getClass().getClassLoader(), new VariableResolver(map(new String[] {
                }))));
        JobClientProfile profile = JobClientProfile.convert(original);
        assertThat(profile.getPrefix(), is("testing"));
        assertThat(profile.getTimeout(), is(JobClientProfile.DEFAULT_TIMEOUT + 1));
        assertThat(profile.getPollingInterval(), is(JobClientProfile.DEFAULT_POLLING_INTERVAL + 2));
View Full Code Here

                        JobClientProfile.KEY_POLLING_INTERVAL, "${pollingInterval}",
                        "1.url", "${url}",
                        "1.user", "${user}",
                        "1.password", "${password}",
                }),
                new ProfileContext(getClass().getClassLoader(), new VariableResolver(map(new String[] {
                        "timeout", "1234",
                        "pollingInterval", "567",
                        "url", "http://www.example.com/jq",
                        "user", "u",
                        "password", "p",
View Full Code Here

                QueueHadoopScriptHandler.class,
                map(new String[] {
                        JobClientProfile.KEY_TIMEOUT, "?",
                        "1.url", "http://www.example.com/jobqueue/",
                }),
                new ProfileContext(getClass().getClassLoader(), new VariableResolver(map(new String[] {
                }))));
        JobClientProfile.convert(original);
    }
View Full Code Here

                QueueHadoopScriptHandler.class,
                map(new String[] {
                        JobClientProfile.KEY_TIMEOUT, "-1",
                        "1.url", "http://www.example.com/jobqueue/",
                }),
                new ProfileContext(getClass().getClassLoader(), new VariableResolver(map(new String[] {
                }))));
        JobClientProfile.convert(original);
    }
View Full Code Here

TOP

Related Classes of com.asakusafw.yaess.core.ProfileContext

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.