Questions tagged [aspect]
An aspect is a module implemented in an Aspect-Oriented Programming language that contains code for a cross-cutting concern, like logging or security. For questions about the aspect ratio of images, use the aspect-ratio tag.
436
questions
0
votes
0
answers
15
views
Code practice - Spring aop call service from Aspect class [closed]
I have a class that have multiple methods , each method has a parameter of type long. I need to do some logic to replace that parameter based on some condition. I was thinking to use Aspect to ...
1
vote
0
answers
51
views
Aspect AOP not intercepting all methods within pointcut
I have created an aspect for the purpose of error logging and reporting within a microservices system but it is not intercepting all the methods that throw an exception within the pointcut.
import ...
0
votes
1
answer
49
views
AspectJ in multithreading
Currently im working on a application that runs the same process(with different input parameters in this case TaskInformation) parallelly on 16 threads. I would like to create Aspect from which i ...
0
votes
1
answer
114
views
Hibernate filter not getting applied within Async process
I have a hibernate filter defined on my entities which I am injecting using aspect for all repositories which implements my TenantableRepository.
The issue is that the filter is not getting injected ...
0
votes
0
answers
24
views
Retrieving aspect/sun exposition of geographic locations using code (e.g. python, commandline, ...)
I am looking for a tool/way to infer the topographic aspect of a location (https://en.wikipedia.org/wiki/Aspect_(geography)) or its sun exposition in hours of sun/year in an automated way.
To further ...
0
votes
0
answers
19
views
How to obtain all executed sql statements and execution time in jpa through aop or interceptor,
Now I am using cat3 for tracking monitoring. I need to track the springboot using jpa and count the execution statements and duration of sql. I have not found a suitable entrance implementation. Do ...
0
votes
1
answer
16
views
i cannot see the aspect logs when i run the method to be intercepted
thats my code and this is only showing the logs as method is executed in intellij
INFO: Publishing comment: Demo comment. Also added the dependencies but still i cant see whats the error.
package com....
1
vote
0
answers
43
views
Postsharp aspects reach to HttpContext
I am using PostSharp, and within my aspects, I want to check a header from the incoming request during the entry phase of a method. I am unable to access HttpContext. Is there a way to achieve this?
...
0
votes
0
answers
62
views
R Shiny determine plot aspect ratio
I'm building a R Shiny application focused around selecting data and creating a variety of plots using the R base plotting procedures, and place in plotOutput elements in Shiny. Since the application ...
0
votes
0
answers
30
views
Recharts changing aspect with media queries
I'm trying to make a responsive data visualization dashboard for a personal project. Everything works fine but I need to make my graphs change its aspect property (from the responsive container tag) ...
1
vote
1
answer
40
views
How do I test private annotation aspect in spring boot?
How do I test private annotation aspect in spring boot ?
Example:
@Aspect
@Component
@Slf4j
public class AspectClass {
@AfterReturning(value = "@annotation(CustomAnnotation)")
...
1
vote
1
answer
173
views
How to implement interceptors/aspects in a dotnet Maui app?
I'm implementing a dotnet Maui app, and got to the point when I'd need some aspects to hanlde errors and certain responses.
In the past, I implemented interceptors using Castle Windsor, but how can I ...
0
votes
1
answer
63
views
Does Aspect Oriented Programming require recompilation whenever an aspect changes?
One important design principle is the OCP, which states that we would like our modules to be open for extension but closed to modification.
When we use Aspect Oriented Programming, we impact the whole ...
0
votes
0
answers
11
views
I want to show compilation error or force to above method to use annotation @cacheKey for parameter(userId)
I have below annotation for method:
@Retention(RetentionPolicy.RUNTIME)
@Target(Element.Method))
public @interface Memcacheable {
int expiresAfterSeconds() default -1;
String cacheKey();
...
0
votes
0
answers
23
views
Java Aspect oriented - interface Around not working as expected when applied on a class
My interface code;
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.ANNOTATION_TYPE})
@Documented
@Inherited
public @interface JwtTokenRequired {
}
My ...
0
votes
0
answers
12
views
How do i keep a div at 16x9 based on height of the window? i am using jw player
i am using jw player and it does not play well with widescreen monitors when put into a div that is 100% height and 100% width. When the page is wider than 16x9, the player just overflows vertically ...
0
votes
0
answers
27
views
How to call another overloading Function using Aspect or Code Generator in .net
I have a question about Aspect or Code Generator.
public class Test
{
public void StartMethod(string str)
{
...
}
public void StartMethod(string str, object obj)
{
...
0
votes
1
answer
617
views
Spring AOP with Spring Webflux after authentication
I have a Enabled Spring AOP for my logging purpose and use webflux for the API entrypoint,
things work fine if the api does not go through ReactiveAuthenticationManager like my login api but the ...
0
votes
1
answer
81
views
How to change pointCut expression inside an aspect which has been compiled when I use this aspect in other project?
I have a logging aspect like this, it will print args, result or any other exceptions. I use aspectj-maven-plugin to compile this aspect. Then, the compiled result will be packaged to a jar. I will ...
0
votes
1
answer
109
views
Cannot run ajc compiled class file in the terminal using Java
I trying to learn aspectj for a project. I wish to run the java files from the terminal using ajc and java but I am unable to do so.
I have 2 files in my directory HelloWorld.java and HWTracer.aj
...
0
votes
1
answer
34
views
First time trying to use Aspect. What if I want to output a different value for specific logs?
First of all, I am not 100% sure if my code is correct, since this is the first time I am ever using Aspect in Spring, so I will be happy if you point out any errors.
First a little background.
I have ...
3
votes
1
answer
259
views
How to labeling text based on aspect term and sentiment
I have coded to label text data by term aspect then sentiment with vader lexicon. But the result is only output -1 which means negative and 1 which means positive, where there should be 3 classes of ...
0
votes
0
answers
51
views
Not going inside the Aspect in Aspect-Oriented-Programming
Hello I am new to Aspect Oriented Programming and trying to understand some concepts.
I am writing a simple Spring Boot Application where I defined a dummyEndpoint where I am calling a method of a ...
3
votes
1
answer
159
views
Golang tgbotapi v5: sendVideo has wrong aspect ratio on iOS
I am using v5.5.1 of go-telegram-bot-api to send videos with the following code. However, the actual aspect ratio 4:5 is broken and video seems as 1:1 on iOS devices.
I also have MacOS and videos have ...
1
vote
1
answer
95
views
Aspect does not triggered
I am trying to implement read-only data source in my application.
According to the following repo implementation, this aspect method should be called when a transaction happens but it never triggers ...
1
vote
1
answer
158
views
Aspect not getting called on non-spring maven project
I'm using Java 8, testng, maven and selenium for UI automation frame work and trying to use aspectj to execute aspects before and after for switching iframes(entry and exit) when any method in an ...
0
votes
1
answer
284
views
How to test Aspects
I have found and tried to follow this answer by Roman Puchkovskiy with a detailed example, but I am missing some detail.
Here is the aspect I am trying to test:
package com.company.reporting.logger....
-1
votes
1
answer
41
views
(Unity)Game view and smartphone view are different
In the game view, it appears horizontally as expected, but in the smartphone view, it appears vertically. I do not know what is the problem. How to fix?(My smartphone has 1080 x 2400 pixels, 20:9 ...
0
votes
1
answer
268
views
Exception handler is not called when exception is thrown because of Interceptor Around [duplicate]
I have a method handleException that return a ResponseEntity :
@ExceptionHandler({Exception.class})
public ResponseEntity handleException(Exception e) {
Map<String, String> data = new ...
0
votes
2
answers
95
views
Pointcut on annotated method
I'm trying to add a custom annotation for JPA repository methods to have a advice on @Query value.
Below is the piece of code I tried
MyFilter class
@Aspect
@Component
public class MyFilter {
@...
0
votes
1
answer
692
views
Aspect Method is not triggered
I'm trying to get my Aspect class to work but it gets completely ignored.
I have following files:
MyAnnotation.java
package annotations;
import java.lang.annotation.ElementType;
import java.lang....
0
votes
0
answers
124
views
Is it possible to use @Transactional annotation on aspect method instead of service method?
I have a micro-service project and I am adding a common feature to every service. For that I wrote code in my common service and it works fine as long as I put @Transactional annotation on every ...
1
vote
1
answer
685
views
Spring AOP - How to pass in a different number of parameters?
I have an Aspect:
@Aspect
@Component
public class BusinessAspect {
@Around("@annotation(Business)")
public Object getCorrespondingBusiness(ProceedingJoinPoint joinPoint, Business ...
1
vote
1
answer
634
views
Spring SQS Message Handler - add custom message attributes to existing message before sending it to Dead-Letter-Queue
Currently, the messages on source queue are sent to dead-letter-queue on every exception. My goal is to add custom attributes to the failed message so that engineers have more information about ...
0
votes
2
answers
173
views
Window aspect ratio varies depending on window size
I'm trying to understand how a program is determining the new width/height when resizing it.
One would think it's merely an aspect ratio like 4:3 (which would lead to a 1.333333 ish value) however as ...
0
votes
1
answer
340
views
Not able to read annotation property inside Aspect when writing pointcut in a method
I have a custom annotation as
annotation class MyHandler(val value:String)
I wrote an aspect for functions using this annotation, also reading the value within the annotation for my processing.
@...
3
votes
1
answer
987
views
SwiftUI clipped image still accepts tap gesture [duplicate]
I have trouble clipping the image in SwiftUI
Here is the code with minimal wrong-working example:
struct TestView: View {
var body: some View {
Image("iPhone13Pro")
....
1
vote
1
answer
429
views
SpringBoot application fails startup when I have Aspect defined on a Bean Method
Working with Springboot 2.7.0. I had a a working application and I made these changes on top of it
Aspect Configuration
@Configuration
@EnableAspectJAutoProxy
@ComponentScan
public class AspectConfig {...
1
vote
1
answer
524
views
Spring AOP, Use only one pointcut when two pointcut match
anyone have an idea of how doing that :
I have two pointcut, one generic and an one specific. The two pointcuts will intercept the same method invocation but I want to just call the specific pointcut.
...
0
votes
1
answer
483
views
How to interrupt JoinPoint execution in AOP
Is it possible to interrupt invoking the actual method from within the aspect execution?
For example:
public class CheckPermissionAspect {
@Around("@annotation(CheckPermission)")
...
1
vote
0
answers
352
views
Write an aspect class for my Dropwizard project?
Trying to write a aspectJ class for my dropwizard project. Below is the class
@Aspect
public class LoggingAspect {
@Around("execution(* javax.servlet.http.HttpServlet.*(..)) *)")
public ...
0
votes
1
answer
439
views
Is it possible to throw checked exception in Spring AOP?
Hello I'm trying to throw custom Exceptions from my @Aspect, but no matter what exception I throw, my Aspect is throwing UndeclaredThrowableException,
My custom exception is
public class ...
0
votes
0
answers
646
views
Retrieving the response body as an empty string in Spring AOP
I have a requirement wherein I need to save any request and response being passed to a Rest Controller in a database, so I decided to implement Spring AOP for the same. The issue that is now being ...
1
vote
1
answer
6k
views
as-pect.config.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module"
When I test with as-pect I get an error in CRUD dApp with NEAR. The whole error I get is as follows;
yarn test
[Error] There was a problem loading [/Users/malibilgin/Documents/Web3/order-management-...
0
votes
0
answers
59
views
@AfterReturning for multiple methods in a same controller AOP [duplicate]
I want to call multiple methods included in a same controller. But methods are different from input parameters. So I need to use one aspect method for those three methods included in same controller.
...
1
vote
0
answers
184
views
applying Aspect before spring security
I have an application that use spring security and JWT for Authorization and Authentication. Here you can see my security config
@Override
protected void configure(HttpSecurity http) throws ...
0
votes
1
answer
349
views
Spring AOP with type parameter with annotation Collection<@SomeAnnotation>
I want to advice methods which arguments are annotated. The exact designator I am trying is args(Collection<@SomeAnnotation *>) but it says "error wildcard type pattern not allowed, must ...
1
vote
1
answer
2k
views
Can I set the default retention time for log groups created in a AWS CDK v2 created pipeline?
I have an AWS VDK v2 based application stack that sets up a CodePipeline with different stages, application and all that, that works alright. But this setup creates quite some log-groups where the ...
0
votes
0
answers
428
views
Patchwork is squashing my ggplot that has correct aspect when click zoom?
I've tried to make this question clear and I'm sorry that I have not been able to provide an MRE as I wouldn't even know where to begin to make this a MRE, but let me know if you can identify an ...
0
votes
1
answer
114
views
Put some variable in json response inside Aspect
We want to add some variabale in json response, but inside aspect.
we need to do something similar to what is done in this function but instead of with the request it would be with the response.