本文整理匯總了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()));
}
示例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);
}
示例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);
});
}
示例4: getEventHandler
import com.amazonaws.services.lambda.runtime.RequestHandler; //導入依賴的package包/類
@Override
public Supplier<RequestHandler<ScheduledEvent, ScheduledEventResult>> getEventHandler() {
return () -> new ScheduledEventHandler(getApplicationContext());
}
示例5: getEventHandler
import com.amazonaws.services.lambda.runtime.RequestHandler; //導入依賴的package包/類
@Override
public Supplier<RequestHandler<SnsEvent, SnsEventResult>> getEventHandler() {
return () -> new SnsEventHandler(getApplicationContext());
}
示例6: getEventHandler
import com.amazonaws.services.lambda.runtime.RequestHandler; //導入依賴的package包/類
@Override
public Supplier<RequestHandler<DynamoDbEvent, DynamoDbEventResult>> getEventHandler() {
return supplier;
}
示例7: getEventHandler
import com.amazonaws.services.lambda.runtime.RequestHandler; //導入依賴的package包/類
@Override
public Supplier<RequestHandler<S3EventNotification, S3EventResult>> getEventHandler() {
return () -> new S3EventHandler(getApplicationContext(), s3Action);
}
示例8: SpringRequestHandler
import com.amazonaws.services.lambda.runtime.RequestHandler; //導入依賴的package包/類
public SpringRequestHandler() {
handler = getApplicationContext().getBean(RequestHandler.class);
}
示例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);
}
示例10: getEventHandler
import com.amazonaws.services.lambda.runtime.RequestHandler; //導入依賴的package包/類
Supplier<RequestHandler<EventT, R>> getEventHandler();