Mr.Eddart
Mr.Eddart

Reputation: 10273

Enabling CDI Alternative based on environmental properties

I know that it is possible to configure Alternatives in the "beans.xml" file that is embedded in the EAR to be deployed.

The problem is that I use the same EAR for all the environments, and the set of properties or specific configurations are stored in some folder outside the package.

I need to configure the Alternative that I will use based on an "external beans.xml" or some similar mechanism (something that is outside the EAR).

Any ideas?

Thank you very much.

Upvotes: 0

Views: 351

Answers (1)

fantarama
fantarama

Reputation: 880

You can't use alternatives if properties are outside the package. You can write a CDI producer that read the properties and with BeanManager return the write implementation.

Upvotes: 2

Related Questions