활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
In a project I am working on there are multiple servlets, services with an activate function with @activate annotation where the function has no body, said activate function is taking a configuration as parameter. The configuration has a single field. I am attaching code snippet for one such case below for reference.
What is the reason behind these empty activate functions, as they are not passing any value from configuration. furthermore what impact might removing such activate function can cause.
해결되었습니다! 솔루션으로 이동.
조회 수
답글
좋아요 수
Hi @shubham_naik to me it looks like a dead code. In my opinion having empty activate method does not bring any benefit. I think that removing such an empty activate method will not affect component/service functionality. In other words it should be safe to remove those methods. There is a nice documentation page that explains OSGi component lifecycle including activate, modify, deactivate annotation/methods usage - maybe this could be useful for you.
Hi @shubham_naik to me it looks like a dead code. In my opinion having empty activate method does not bring any benefit. I think that removing such an empty activate method will not affect component/service functionality. In other words it should be safe to remove those methods. There is a nice documentation page that explains OSGi component lifecycle including activate, modify, deactivate annotation/methods usage - maybe this could be useful for you.
Yes I agree with @lukasz-m here, if you want to understand OCD with @activate ,modify and deactivate annotations , please refer this : https://aem4beginner.blogspot.com/ocd-issue-with-activate-annotation.
Thanks a lot for the confirmation and resources @DEBAL_DAS