当前位置: 首页>>代码示例>>Java>>正文


Java RequestHandler类代码示例

本文整理汇总了Java中com.amazonaws.services.lambda.runtime.RequestHandler的典型用法代码示例。如果您正苦于以下问题:Java RequestHandler类的具体用法?Java RequestHandler怎么用?Java RequestHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RequestHandler类属于com.amazonaws.services.lambda.runtime包,在下文中一共展示了RequestHandler类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: invokeLambda

import com.amazonaws.services.lambda.runtime.RequestHandler; //导入依赖的package包/类
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()));
}
 
开发者ID:d2si-oss,项目名称:ooso,代码行数:8,代码来源:AWSLambdaAsyncMockClient.java

示例2: handle

import com.amazonaws.services.lambda.runtime.RequestHandler; //导入依赖的package包/类
@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);
}
 
开发者ID:ccampo133,项目名称:spring-aws-lambda,代码行数:13,代码来源:SpringVoidRequestHandlerTest.java

示例3: handleEvent

import com.amazonaws.services.lambda.runtime.RequestHandler; //导入依赖的package包/类
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);
    });
}
 
开发者ID:visionarts,项目名称:power-jambda,代码行数:7,代码来源:AbstractEventExecutor.java

示例4: getEventHandler

import com.amazonaws.services.lambda.runtime.RequestHandler; //导入依赖的package包/类
@Override
public Supplier<RequestHandler<ScheduledEvent, ScheduledEventResult>> getEventHandler() {
    return () -> new ScheduledEventHandler(getApplicationContext());
}
 
开发者ID:visionarts,项目名称:power-jambda,代码行数:5,代码来源:ScheduledEventExecutor.java

示例5: getEventHandler

import com.amazonaws.services.lambda.runtime.RequestHandler; //导入依赖的package包/类
@Override
public Supplier<RequestHandler<SnsEvent, SnsEventResult>> getEventHandler() {
    return () -> new SnsEventHandler(getApplicationContext());
}
 
开发者ID:visionarts,项目名称:power-jambda,代码行数:5,代码来源:SnsEventExecutor.java

示例6: getEventHandler

import com.amazonaws.services.lambda.runtime.RequestHandler; //导入依赖的package包/类
@Override
public Supplier<RequestHandler<DynamoDbEvent, DynamoDbEventResult>> getEventHandler() {
    return supplier;
}
 
开发者ID:visionarts,项目名称:power-jambda,代码行数:5,代码来源:DynamoDbEventExecutor.java

示例7: getEventHandler

import com.amazonaws.services.lambda.runtime.RequestHandler; //导入依赖的package包/类
@Override
public Supplier<RequestHandler<S3EventNotification, S3EventResult>> getEventHandler() {
    return () -> new S3EventHandler(getApplicationContext(), s3Action);
}
 
开发者ID:visionarts,项目名称:power-jambda,代码行数:5,代码来源:S3EventExecutor.java

示例8: SpringRequestHandler

import com.amazonaws.services.lambda.runtime.RequestHandler; //导入依赖的package包/类
public SpringRequestHandler() {
    handler = getApplicationContext().getBean(RequestHandler.class);
}
 
开发者ID:ccampo133,项目名称:spring-aws-lambda,代码行数:4,代码来源:SpringRequestHandler.java

示例9: JacksonSpringRequestHandler

import com.amazonaws.services.lambda.runtime.RequestHandler; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:ccampo133,项目名称:spring-aws-lambda,代码行数:12,代码来源:JacksonSpringRequestHandler.java

示例10: getEventHandler

import com.amazonaws.services.lambda.runtime.RequestHandler; //导入依赖的package包/类
Supplier<RequestHandler<EventT, R>> getEventHandler(); 
开发者ID:visionarts,项目名称:power-jambda,代码行数:2,代码来源:EventResolver.java


注:本文中的com.amazonaws.services.lambda.runtime.RequestHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。