Skip to content

Commit

Permalink
Fixed introspection beans (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
musketyr authored Jul 15, 2024
1 parent b85327d commit d7fcfc0
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 3 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

slug=agorapulse/micronaut-aws-sdk
group=com.agorapulse
micronautVersion = 4.5.0
micronautGradlePluginVersion = 4.4.0
micronautVersion = 4.2.0
micronautGradlePluginVersion = 4.2.0
gruVersion = 2.0.5
awsSdkVersion = 1.12.692
awsSdk2Version = 2.25.22
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package com.agorapulse.micronaut.amazon.awssdk.dynamodb;

import com.agorapulse.micronaut.amazon.awssdk.dynamodb.annotation.Service;
import io.micronaut.aop.InterceptorBean;
import io.micronaut.aop.MethodInterceptor;
import io.micronaut.aop.MethodInvocationContext;
import io.micronaut.core.annotation.AnnotationValue;
Expand All @@ -27,6 +28,7 @@
* Introduction for {@link com.agorapulse.micronaut.amazon.awssdk.dynamodb.annotation.Service} annotation.
*/
@Singleton
@InterceptorBean(Service.class)
public class ServiceIntroduction implements MethodInterceptor<Object, Object> {

private final DynamoDbServiceIntroduction introduction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.agorapulse.micronaut.amazon.awssdk.kinesis.annotation.Stream;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.micronaut.aop.InterceptorBean;
import io.micronaut.aop.MethodInterceptor;
import io.micronaut.aop.MethodInvocationContext;
import io.micronaut.context.BeanContext;
Expand All @@ -45,6 +46,7 @@
import java.util.UUID;

@Singleton
@InterceptorBean(KinesisClient.class)
@Requires(classes = software.amazon.awssdk.services.kinesis.KinesisClient.class)
public class KinesisClientIntroduction implements MethodInterceptor<Object, Object> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.agorapulse.micronaut.amazon.awssdk.lambda.annotation.LambdaClient;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.micronaut.aop.InterceptorBean;
import io.micronaut.aop.MethodInterceptor;
import io.micronaut.aop.MethodInvocationContext;
import io.micronaut.context.BeanContext;
Expand All @@ -45,6 +46,7 @@
import java.util.function.Function;

@Singleton
@InterceptorBean(LambdaClient.class)
@Requires(classes = software.amazon.awssdk.services.lambda.LambdaClient.class)
public class LambdaClientIntroduction implements MethodInterceptor<Object, Object> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.agorapulse.micronaut.amazon.awssdk.sns.annotation.Topic;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.micronaut.aop.InterceptorBean;
import io.micronaut.aop.MethodInterceptor;
import io.micronaut.aop.MethodInvocationContext;
import io.micronaut.context.BeanContext;
Expand All @@ -42,6 +43,7 @@
import java.util.function.Function;

@Singleton
@InterceptorBean(NotificationClient.class)
public class NotificationClientIntroduction implements MethodInterceptor<Object, Object> {

private static final String SUBJECT = "subject";
Expand All @@ -58,7 +60,7 @@ private static class PublishingArguments {
Argument<?> attributes;
Argument<?> messageGroupId;
Argument<?> messageDeduplicationId;

boolean isValid() {
return message != null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.agorapulse.micronaut.amazon.awssdk.sqs.annotation.QueueClient;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.micronaut.aop.InterceptorBean;
import io.micronaut.aop.MethodInterceptor;
import io.micronaut.aop.MethodInvocationContext;
import io.micronaut.context.BeanContext;
Expand All @@ -39,6 +40,7 @@
import java.util.function.Function;

@Singleton
@InterceptorBean(QueueClient.class)
@Requires(classes = SqsClient.class)
public class QueueClientIntroduction implements MethodInterceptor<Object, Object> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.amazonaws.services.dynamodbv2.datamodeling.IDynamoDBMapper;
import com.amazonaws.services.dynamodbv2.model.ResourceNotFoundException;
import groovy.lang.Closure;
import io.micronaut.aop.InterceptorBean;
import io.micronaut.aop.MethodInterceptor;
import io.micronaut.aop.MethodInvocationContext;
import io.micronaut.context.annotation.Requires;
Expand All @@ -45,6 +46,7 @@
* Introduction for {@link Service} annotation.
*/
@Singleton
@InterceptorBean(Service.class)
@Requires(classes = IDynamoDBMapper.class)
public class ServiceIntroduction implements MethodInterceptor<Object, Object> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.amazonaws.services.kinesis.model.ResourceNotFoundException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.micronaut.aop.InterceptorBean;
import io.micronaut.aop.MethodInterceptor;
import io.micronaut.aop.MethodInvocationContext;
import io.micronaut.context.BeanContext;
Expand All @@ -42,6 +43,7 @@
import java.util.*;

@Singleton
@InterceptorBean(KinesisClient.class)
@Requires(classes = AmazonKinesis.class)
public class KinesisClientIntroduction implements MethodInterceptor<Object, Object> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.amazonaws.services.lambda.model.InvokeResult;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.micronaut.aop.InterceptorBean;
import io.micronaut.aop.MethodInterceptor;
import io.micronaut.aop.MethodInvocationContext;
import io.micronaut.context.BeanContext;
Expand All @@ -46,6 +47,7 @@
import java.util.function.Function;

@Singleton
@InterceptorBean(LambdaClient.class)
@Requires(classes = AWSLambda.class)
public class LambdaClientIntroduction implements MethodInterceptor<Object, Object> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.amazonaws.services.sns.model.PublishRequest;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.micronaut.aop.InterceptorBean;
import io.micronaut.aop.MethodInterceptor;
import io.micronaut.aop.MethodInvocationContext;
import io.micronaut.context.BeanContext;
Expand All @@ -44,6 +45,7 @@
import java.util.function.Function;

@Singleton
@InterceptorBean(NotificationClient.class)
@Requires(classes = AmazonSNS.class)
public class NotificationClientIntroduction implements MethodInterceptor<Object, Object> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.amazonaws.services.sqs.model.QueueDoesNotExistException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.micronaut.aop.InterceptorBean;
import io.micronaut.aop.MethodInterceptor;
import io.micronaut.aop.MethodInvocationContext;
import io.micronaut.context.BeanContext;
Expand All @@ -39,6 +40,7 @@
import java.util.function.Function;

@Singleton
@InterceptorBean(QueueClient.class)
@Requires(classes = AmazonSQS.class)
public class QueueClientIntroduction implements MethodInterceptor<Object, Object> {

Expand Down

0 comments on commit d7fcfc0

Please sign in to comment.