commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "DiFrango, Ronald (CONT)" <Ronald.DiFra...@capitalone.com>
Subject Conditional Configuration Keys
Date Thu, 13 Feb 2014 19:53:55 GMT
All,

I searched around and could find an answer, I have a set of properties where I want to conditionally
select them based upon environment variables.  For example, I have the following set:

schemas.default=DB
schemas.perf=PERF
schemas.qa=QA
schemas.int=INT

And I would like to do something to the effect of:

If (env.variable == 'qa')
schemas=QA
else If (env.variable == 'perf')
schemas=PERF
else If (env.variable == 'int)
schemas=int
else
schemas=DB

The way I accomplished this today is that I created an AOP interceptor that does this work
and when the clients request "schema" it does this logic.

My preference would be to handle this during property loading time.  Are there any extensions
where I could do such a thing?

Thanks,

Ron

________________________________________________________

The information contained in this e-mail is confidential and/or proprietary to Capital One
and/or its affiliates. The information transmitted herewith is intended only for use by the
individual or entity to which it is addressed.  If the reader of this message is not the intended
recipient, you are hereby notified that any review, retransmission, dissemination, distribution,
copying or other use of, or taking of any action in reliance upon this information is strictly
prohibited. If you have received this communication in error, please contact the sender and
delete the material from your computer.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message