Java 类com.amazonaws.services.lambda.invoke.LambdaInvokerFactory 实例源码

项目:reinvent2015-practicaldynamodb    文件:FunctionInvoker.java   
private void invokeScannerOnSegment(final int segment, final String startScore) {
    new Thread() {
        @Override
        public void run() {
            SegmentScanner scanner = LambdaInvokerFactory.build(
                    SegmentScanner.class, lambda);

            SegmentScannerInput input = new SegmentScannerInput();
            input.setSegment(segment);
            input.setTotalSegments(totalSegments);
            input.setMaxConsumedCapacity(maxConsumedCapacityPerSegment);
            input.setStartScore(startScore);

            scanner.scanSegment(input);
        }
    }.start();
}
项目:lambda-selenium    文件:TestInvoker.java   
public TestResult run() {
    final LambdaSeleniumService lambdaService = LambdaInvokerFactory.builder()
            .lambdaClient(AWSLambdaClientBuilder.defaultClient())
            .build(LambdaSeleniumService.class);

    return lambdaService.runTest(request);
}
项目:jrestless    文件:FeignLambdaServiceInvokerClient.java   
FeignLambdaServiceInvokerClient(LambdaInvokerFactory.Builder builder, AWSLambda awsLambdaClient,
        String functionName, String functionAlias, String functionVersion) {
    requireNonNull(awsLambdaClient);
    requireNonNull(functionName);
    service = builder
            .lambdaFunctionNameResolver((method, annotation, config) -> functionName)
            .functionAlias(functionAlias)
            .functionVersion(functionVersion)
            .lambdaClient(awsLambdaClient)
            .build(LambdaInvokerService.class);
}
项目:jrestless    文件:FeignLambdaServiceInvokerClientTest.java   
@BeforeEach
public void setup() {
    lambdaInvokerFactoryBuilder = mock(LambdaInvokerFactory.Builder.class);
    when(lambdaInvokerFactoryBuilder.lambdaFunctionNameResolver(any())).thenReturn(lambdaInvokerFactoryBuilder);
    when(lambdaInvokerFactoryBuilder.functionAlias(any())).thenReturn(lambdaInvokerFactoryBuilder);
    when(lambdaInvokerFactoryBuilder.functionVersion(any())).thenReturn(lambdaInvokerFactoryBuilder);
    when(lambdaInvokerFactoryBuilder.lambdaClient(any())).thenReturn(lambdaInvokerFactoryBuilder);
    when(lambdaInvokerFactoryBuilder.build(LambdaInvokerService.class)).thenReturn(service);
}
项目:jrestless    文件:FeignLambdaServiceInvokerClient.java   
public FeignLambdaServiceInvokerClient(@Nonnull AWSLambda awsLambdaClient, @Nonnull String functionName,
        @Nullable String functionAlias, @Nullable String functionVersion) {
    this(LambdaInvokerFactory.builder(), awsLambdaClient, functionName, functionAlias, functionVersion);
}
项目:service-block-samples    文件:AWSLambdaConfigurerAdapter.java   
/**
 * Creates a proxy instance of a supplied interface that contains methods annotated with
 * {@link LambdaFunction}. Provides automatic credential support to authenticate with an IAM
 * access keys using {@link BasicSessionCredentials} auto-configured from Spring Boot
 * configuration properties in {@link AmazonProperties}.
 *
 * @param type
 * @param <T>
 * @return
 */
public <T> T getFunctionInstance(Class<T> type) {
    return LambdaInvokerFactory.builder()
            .lambdaClient(AWSLambdaClientBuilder.standard()
                    .withRegion(Regions.US_EAST_1)
                    .withCredentials(new LambdaCredentialsProvider(amazonProperties))
                    .build())
            .build(type);
}