dev.soffa.foundation.spring.aop.DefaultTenantAspect Maven / Gradle / Ivy
package dev.soffa.foundation.spring.aop;
import dev.soffa.foundation.annotation.DefaultTenant;
import dev.soffa.foundation.commons.Logger;
import dev.soffa.foundation.multitenancy.TenantHolder;
import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;
import java.util.function.Supplier;
@Aspect
@Component
@AllArgsConstructor
public class DefaultTenantAspect {
public static final Logger LOG = Logger.get(DefaultTenantAspect.class);
@SneakyThrows
@Around("@annotation(context)")
public Object handleOperation(ProceedingJoinPoint pjp, DefaultTenant context) {
return TenantHolder.useDefault(new Supplier
© 2015 - 2025 Weber Informatics LLC | Privacy Policy