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;
 
 
 public abstract class WorkflowClientFactoryExternalBase<T> implements WorkflowClientFactoryExternal<T> {
 
 
 
 
     public WorkflowClientFactoryExternalBase(AmazonSimpleWorkflow serviceString domain) {
         this(new GenericWorkflowClientExternalImpl(servicedomain));
     }
 
         this(null);
     }
 
         this. = genericClient;
     }
 
     @Override
         return ;
     }
 
     public void setGenericClient(GenericWorkflowClientExternal genericClient) {
         this. = genericClient;
     }
 
     @Override
     public DataConverter getDataConverter() {
         return ;
     }
 
     public void setDataConverter(DataConverter dataConverter) {
         this. = dataConverter;
     }
 
     @Override
         return ;
     }
 
     public void setStartWorkflowOptions(StartWorkflowOptions startWorkflowOptions) {
         this. = startWorkflowOptions;
     }
 
     @Override
     public T getClient() {
         checkGenericClient();
         String workflowId = .generateUniqueId();
         WorkflowExecution workflowExecution = new WorkflowExecution().withWorkflowId(workflowId);
         return getClient(workflowExecution);
     }
 
     @Override
     public T getClient(String workflowId) {
         if (workflowId == null || workflowId.isEmpty()) {
             throw new IllegalArgumentException("workflowId");
         }
         WorkflowExecution workflowExecution = new WorkflowExecution().withWorkflowId(workflowId);
         return getClient(workflowExecution);
     }
 
     @Override
     public T getClient(WorkflowExecution workflowExecution) {
         return getClient(workflowExecution);
     }
 
     @Override
     public T getClient(WorkflowExecution workflowExecutionStartWorkflowOptions options) {
         return getClient(workflowExecutionoptions);
     }
 
     @Override
     public T getClient(WorkflowExecution workflowExecutionStartWorkflowOptions optionsDataConverter dataConverter) {
         return getClient(workflowExecutionoptionsdataConverter);
     }
    @Override
    public T getClient(WorkflowExecution workflowExecutionStartWorkflowOptions optionsDataConverter dataConverter,
            GenericWorkflowClientExternal genericClient) {
        checkGenericClient();
        return createClientInstance(workflowExecutionoptionsdataConvertergenericClient);
    }
    private void checkGenericClient() {
        if ( == null) {
            throw new IllegalStateException("The required property genericClient is null. "
                    + "It could be caused by instantiating the factory through the default constructor instead of the one "
                    + "that takes service and domain arguments.");
        }
    }
    protected abstract T createClientInstance(WorkflowExecution workflowExecutionStartWorkflowOptions options,
            DataConverter dataConverterGenericWorkflowClientExternal genericClient);
New to GrepCode? Check out our FAQ X