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.pojo;
 
 
 
 
     private final Method activity;
 
     private final Object activitiesImplmentationObject;
 
 
     private final DataConverter converter;
 
 
     public POJOActivityImplementation(Object activitiesImplmentationObjectMethod activity,
             ActivityTypeRegistrationOptions registrationOptionsActivityTypeExecutionOptions executionOptions,
             DataConverter converter) {
         this. = activitiesImplmentationObject;
         this. = activity;
         this. = registrationOptions;
         this. = executionOptions;
         this. = converter;
     }
 
     @Override
     protected String execute(String inputActivityExecutionContext context
             throws ActivityFailureExceptionCancellationException {
         //TODO: Support ability to call activity using old client 
         // after new parameters were added to activity method
         // It requires creation of inputParameters array of the correct size and
         // populating the new parameter values with default values for each type
         Object[] inputParameters = .fromData(inputObject[].class);
         CurrentActivityExecutionContext.set(context);
         Object result = null;
         try {
             result = .invoke(inputParameters);
         }
         catch (InvocationTargetException invocationException) {
             throwActivityFailureException(invocationException.getTargetException() != null 
                     ? invocationException.getTargetException() : invocationException);
         }
         catch (IllegalArgumentException illegalArgumentException) {
             throwActivityFailureException(illegalArgumentException);
         }
         catch (IllegalAccessException illegalAccessException) {
             throwActivityFailureException(illegalAccessException);
         }
         finally {
             CurrentActivityExecutionContext.unset();
         }
         return .toData(result);
     }
 
     @Override
         return ;
     }
 
     @Override
         return ;
     }
     
     void throwActivityFailureException(Throwable exception
             throws ActivityFailureExceptionCancellationException {
         
         if (exception instanceof CancellationException) {
             throw (CancellationException)exception;
         }
         
         String reason = WorkflowExecutionUtils.truncateReason(exception.getMessage());
        String details = null;
        try {
            details = .toData(exception);
        } catch (DataConverterException dataConverterException) {
            if (dataConverterException.getCause() == null) {
                dataConverterException.initCause(exception);
            }
            throw dataConverterException;
        }
        
        throw new ActivityFailureException(reasondetails);
    }
    public Method getMethod() {
        return ;
    }
        return ;
    }
New to GrepCode? Check out our FAQ X