當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。