private LambdaRequestDeserializer createDeserializer(Class<?> handlerClass, @Nullable Class<? extends LambdaRequestDeserializer<?>> cls) { if (cls == null) { if (RequestStreamHandler.class.isAssignableFrom(handlerClass)) { return new LambdaProxyRequestStreamDeserializer(); } else { return new LambdaProxyRequestDeserializer(); } } try { return cls.newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new IllegalArgumentException("Unable to create:" + cls, e); } }
private LambdaResponseSerializer createSerializer(Class<?> handlerClass, @Nullable Class<? extends LambdaResponseSerializer<?>> cls) { if (cls == null) { if (RequestStreamHandler.class.isAssignableFrom(handlerClass)) { return new LambdaProxyResponseStreamSerializer(); } else { return new LambdaProxyResponseSerializer(); } } try { return cls.newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new IllegalArgumentException("Unable to create:" + cls, e); } }
public SpringRequestStreamHandler() { this.handler = getApplicationContext().getBean(RequestStreamHandler.class); }