@BeforeStep in abstract class
I want to do following thing but spring is throwing a exception.
Code:
public abstract class myAbstractClass{
@BeforeStep
public void doSomething()
}
public class myClass extends myAbstractClass{
public void doSomething(){
//Do something here
}
Its throwing the following exception
Code:
Caused by: java.lang.IllegalArgumentException: found more than one method on target class [myClass] with the annotation type [BeforeStep].
Now the exception goes away if I put the @BeforeStep in my concrete class. However, I want to enforce whoever extends myAbstractClass to make sure that doSomething method executed before the step. I know I can implement StepExecutionListener but I will be only using beforeStep method which means I will be implementing afterStep with nothing in the method body but that's just not nice though. Anyone has solution to this?