0

Found DeltaSpike that sort of does what I want....

Working with EJB 3.1 and really want to be able to annotate class properties so that "environment" properties are injected either at class load time or lazy on access plus the ability to allow for updates. For example:

@Environment(name="greeting.for.aliens", fetch="lazy", updates="true")
private String welcomeSign; 

The name attribute is a match on a property name pulled from different sources like Java System, environment variables (from the shell), JNDI, property files and so forth. The fetch either says load on initiation or lazy (underpinned by Instance wrapper). Then if the "environment" properties are updated the interested "class" properties listen for that event.

More amazed that nobody has put together something (beyond DeltaSpikes) like this for EJB/CDI? Or I haven't found a good combination of Google keys words to get me to the right implementation for me.

4

0 回答 0