Package com.amazonaws.services.simpleworkflow.flow.core

Examples of com.amazonaws.services.simpleworkflow.flow.core.TryCatchFinally


        try {
            workflowTest.scope = new AsyncScope() {

                @Override
                protected void doAsync() throws Throwable {
                    new TryCatchFinally() {

                        @Override
                        protected void doTry() throws Throwable {
                            workflowTest.beforeEvaluate(workflowTest.decisionContext);
                            base.evaluate();
View Full Code Here


    }

    public <T> Promise<T> scheduleActivity(final ActivityType activityType, final Object[] arguments,
            final ActivitySchedulingOptions optionsOverride, final Class<T> returnType, Promise<?>... waitFor) {
        final Settable<T> result = new Settable<T>();
        new TryCatchFinally(waitFor) {

            Promise<String> stringOutput;

            @Override
            protected void doTry() throws Throwable {
View Full Code Here

    }

    private void invoke(final AsyncRunnable command, final int attempt, final long firstAttemptTime) {
        final Settable<Throwable> shouldRetry = new Settable<Throwable>();

        new TryCatchFinally() {

            Throwable failureToRetry = null;

            @Override
            protected void doTry() throws Throwable {
View Full Code Here

    @Override
    public Promise<String> execute(final String input) throws WorkflowException {
        final Settable<String> result = new Settable<String>();
        final AtomicReference<Promise> methodResult = new AtomicReference<Promise>();
        new TryCatchFinally() {

            @Override
            protected void doTry() throws Throwable {
                Object[] parameters = dataConverter.fromData(input, Object[].class);
                long startTime = workflowClock.currentTimeMillis();
View Full Code Here

    private static final List<String> trace = new ArrayList<String>();

    @Test
    public void test() throws IOException {
        new TryCatchFinally() {

            Throwable failure;

            @Override
            protected void doTry() throws Throwable {
View Full Code Here

        invocationHistory.append(" ");
        invocationHistory.append(entry);
    }

    private void executeActivityUpdatingInvocationHistory(final CronWithRetryWorkflowOptions options) {
        new TryCatchFinally() {

            boolean failed;

            @Override
            protected void doTry() throws Throwable {
View Full Code Here

        cronOptions.setCronExpression(cronExpression);

        WorkflowClock clock = workflowTest.getDecisionContext().getWorkflowClock();
        clock.createTimer(SECONDS_HOUR * 24 * 7 + 1000);
        // true constructor argument makes TryCatchFinally a daemon which causes it get cancelled after above timer firing
        new TryCatchFinally(true) {

            Throwable failure;

            @Override
            protected void doTry() throws Throwable {
View Full Code Here

        this.activityType = activity;
        this.activityArguments = activityArguments;
        this.options = options;

        // Use TryCatch to ensure that workflow is not going to fail as it causes new run not being created
        new TryCatchFinally() {

            @Override
            protected void doTry() throws Throwable {
                long startTime = clock.currentTimeMillis();
                callPeriodicActivity(startTime, Promise.Void(), Promise.Void());
View Full Code Here

        cronOptions.setCronExpression(cronExpression);

        WorkflowClock clock = workflowTest.getDecisionContext().getWorkflowClock();
        clock.createTimer(SECONDS_HOUR * 24 * 7 + 1000);
        // true constructor argument makes TryCatchFinally a daemon which causes it get cancelled after above timer firing
        new TryCatchFinally(true) {

            Throwable failure;

            @Override
            protected void doTry() throws Throwable {
View Full Code Here

        String workflowRunId = workflowContext.getWorkflowExecution().getRunId();
        File localSource = new File(sourceFilename);
        final String localSourceFilename = workflowRunId + "_" + localSource.getName();
        File localTarget = new File(targetFilename);
        final String localTargetFilename = workflowRunId + "_" + localTarget.getName();
        new TryCatchFinally() {

            @Override
            protected void doTry() throws Throwable {
                Promise<String> activityWorkerTaskList = store.download(sourceBucketName, sourceFilename, localSourceFilename);
                // chaining is a way for one promise get assigned value of another
View Full Code Here

TOP

Related Classes of com.amazonaws.services.simpleworkflow.flow.core.TryCatchFinally

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.