you could look at Apache DeltaSpike @Configuration and he whole DS config mechanism.

It's battle proven and also the origin of microprofile-config and JSR-382.
Runs on anything EE6 ++, from Java7 to Java10


On Tuesday, 3 April 2018, 10:25:38 CEST, Matej Novotny <> wrote:

Hi Alex,

Not sure if I get what you need to do, but I'll take a shot at it.
What about using @PostConstruct interceptor, in which you take the injected Application bean and use it to set internal state in SomeManagerImpl?
Same could be done directly within constructor (with @Inject annotation) or an initializer method.


public class SomeManagerImpl implements SomeManager{} {

private MyConfiguration config;

Application app;

public void doSomeInit() {
  config = app.getConfig(); // get config from Application and appply here

If I misunderstood your question, please correct me :)


----- Original Message -----
> From: "Alex Sviridov" <>
> To: "weld-dev" <>
> Sent: Saturday, March 31, 2018 1:07:59 PM
> Subject: [weld-dev] What is the best way to pass cofiguration to CDI bean using Weld?
> Hi all
> Could anyone suggest solution for the following situation.
> Lets suppose we have:
> public interface SomeManager{}
> @ApplicationScoped
> public class SomeManagerImpl implements SomeManager{}
> @ApplicationScoped
> public class Application {} //application entry point
> In Application I need to pass configuration to SomeManagerImpl, but I don't
> want to
> add setConfiguration method to SomeManager interface. What is the best way
> to do it in Weld? Maybe I use some CDI mechanisms, or add extra classes.
> Please, help.
> Best regards, Alex Sviridov
> _______________________________________________
> weld-dev mailing list
weld-dev mailing list