Java 类com.amazonaws.services.lambda.runtime.RequestHandler 实例源码

项目:ooso    文件:AWSLambdaAsyncMockClient.java   
private void invokeLambda(Class functionClass, ByteBuffer payload) throws IllegalAccessException, InstantiationException, InvocationTargetException, ExecutionException, InterruptedException {
    Class lambdaPayloadClass = getLambdaPayloadClass(functionClass);
    Object lambdaPayload = getPayloadObjectFromJson(payload, lambdaPayloadClass);

    RequestHandler functionClassInstance = ((RequestHandler) functionClass.newInstance());
    threadPool.submit(() -> functionClassInstance.handleRequest(lambdaPayload, new MockContext()));
}
项目:spring-aws-lambda    文件:SpringVoidRequestHandlerTest.java   
@Test
@SuppressWarnings("unchecked")
public void handle() {
    final RequestHandler handler = mock(RequestHandler.class);
    when(mockApplicationContext.getBean(RequestHandler.class)).thenReturn(handler);
    final TestSpringVoidRequestHandler testHandler = new TestSpringVoidRequestHandler();
    final Context mockContext = mock(Context.class);
    final String input = "foo";
    testHandler.handleRequest(input, mockContext);
    verify(mockApplicationContext).getBean(RequestHandler.class);
    verify(handler).handleRequest(input, mockContext);
}
项目:power-jambda    文件:AbstractEventExecutor.java   
private Optional<EventResultT> handleEvent(Supplier<Optional<EventT>> eventSupplier, Context context) {
    return eventSupplier.get().map(e -> {
        RequestHandler<EventT, EventResultT> handler = getEventHandler().get();
        return handler.handleRequest(e, context);
    });
}
项目:power-jambda    文件:ScheduledEventExecutor.java   
@Override
public Supplier<RequestHandler<ScheduledEvent, ScheduledEventResult>> getEventHandler() {
    return () -> new ScheduledEventHandler(getApplicationContext());
}
项目:power-jambda    文件:SnsEventExecutor.java   
@Override
public Supplier<RequestHandler<SnsEvent, SnsEventResult>> getEventHandler() {
    return () -> new SnsEventHandler(getApplicationContext());
}
项目:power-jambda    文件:DynamoDbEventExecutor.java   
@Override
public Supplier<RequestHandler<DynamoDbEvent, DynamoDbEventResult>> getEventHandler() {
    return supplier;
}
项目:power-jambda    文件:S3EventExecutor.java   
@Override
public Supplier<RequestHandler<S3EventNotification, S3EventResult>> getEventHandler() {
    return () -> new S3EventHandler(getApplicationContext(), s3Action);
}
项目:power-jambda    文件:DynamoDbV2EventExecutor.java   
@Override
public Supplier<RequestHandler<DynamoDbEvent, DynamoDbEventResult>> getEventHandler() {
    return supplier;
}
项目:spring-aws-lambda    文件:SpringRequestHandler.java   
public SpringRequestHandler() {
    handler = getApplicationContext().getBean(RequestHandler.class);
}
项目:spring-aws-lambda    文件:JacksonSpringRequestHandler.java   
/**
 * To work around type erasure, pass the input type class here. AWS Lambda
 * requires a no-arg constructor for their handler classes however, so be
 * sure to provide one while calling this constructor in it.
 *
 * @param inputClass the class of this class's input type parameter, I.
 */
protected JacksonSpringRequestHandler(@NotNull final Class<I> inputClass) {
    this.inputClass = inputClass;
    this.handler = getApplicationContext().getBean(RequestHandler.class);
}
项目:power-jambda    文件:EventResolver.java   
Supplier<RequestHandler<EventT, R>> getEventHandler();