Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License").
  * You may not use this file except in compliance with the License.
  * A copy of the License is located at
  *
  *  http://aws.amazon.com/apache2.0
  *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */
package com.amazonaws.services.simpleworkflow.flow.spring;
        @Override
        protected POJOWorkflowImplementationFactory getImplementationFactory(Class<?> workflowImplementationType,
                Class<?> workflowIntefaceWorkflowType workflowType) {
            final Object instanceProxy = .get(workflowImplementationType);
            if (instanceProxy == null) {
                throw new IllegalArgumentException("unknown workflowImplementationType: " + workflowImplementationType);
            }
            return new POJOWorkflowImplementationFactory() {
                @Override
                public Object newInstance(DecisionContext decisionContextthrows Exception {
                    WorkflowScope.setDecisionContext(decisionContext);
                    return instanceProxy;
                }
                @Override
                public void deleteInstance(Object instance) {
                    WorkflowScope.removeDecisionContext();
                }
            };
        }
    };
    private final Map<Class<?>, ObjectworkflowImplementations = new HashMap<Class<?>, Object>();
    @Override
        return .getWorkflowDefinitionFactory(workflowType);
    }
    @Override
        return .getWorkflowTypesToRegister();
    }
    public void setWorkflowImplementations(Iterable<ObjectworkflowImplementations)
            throws InstantiationExceptionIllegalAccessException {
        for (Object workflowImplementation : workflowImplementations) {
            addWorkflowImplementation(workflowImplementation);
        }
    }
        return .values();
    }
    
    public void addWorkflowImplementation(Object workflowImplementationthrows InstantiationExceptionIllegalAccessException {
        Class<? extends ObjectimplementationClass = workflowImplementation.getClass();
        .put(implementationClassworkflowImplementation);
        .addWorkflowImplementationType(implementationClass);
    }
    public DataConverter getDataConverter() {
        return .getDataConverter();
    }
    public void setDataConverter(DataConverter converter) {
        .setDataConverter(converter);
    }
    
New to GrepCode? Check out our FAQ X