I have a few services in com.example.engine.manager package:
DealManager
BookManager
TransManager
but I wanted to disable some service like DealManager and the rest of services will be still running.
Therefore I put this "exclude-filter" into bean.xml, but it doesn't work.
any wrong with my syntax (i ran it without error though) or any that I don't know?
I tried search with google but the results are not helpful.
Any master here can give me a clue ?
Thanks in advance.
Regards
From NickyEng
Diploma in Computer Studies
SCJP 1.4
SCWCD 1.4
Formula 1 app by Maxis (Playbook)
Well, I can't help with regex, I don't know regex, nor want to know it. ;)
You can do a couple of approaches. I see that you turned off the default filters which are includes for @Service, @Repository etc.
I do know your order might not make it work, where the first include included your DealManager and therefore the exclude after is overwritten, or maybe the other way around.
One approach I like in this scenario is to create my own set of Annotations and use those in your class and filters where type="Annotations" (Always make sure you include package for your Annotation in the value)
I had three web apps all sharing the same Core project that had Services that in some apps needed and in others didn't. And I couldn't come up with a good filter at that time. Since then and after I left that company, I realized that creating my own Annotation, one for each app, I could put those on those classes and write a clean filter and get exactly the classes I want.
So say I have an app called Moo and another called Bark, I would create an @Moo and a @Bark annotation, I could annotate those annotations with @Service or @Component, then put one or both on Managers that I need in that particular app. Then just