import javax.inject.Inject;
public class UserService {
@Inject
private UserRepository userRepository;
public void saveUser(User user) {
userRepository.save(user);
}
}
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
bean-discovery-mode="all">
<interceptors>
<class>com.example.LoggingInterceptor</class>
</interceptors>
</beans>