ef-labs / vertx-hk2

Create Vert.x Verticles with dependency injection using HK2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to pass a parameter to a binder?

yingqiaomxi opened this issue · comments

I am using vertx-jersey with vertx-hk2. I have one problem. Is it possible that I can set up a custom binder with a parameter?
For example, I have a startupbinder as below:

public class StartupBinder extends AbstractBinder{

private JsonObject iEnvConfig;

public StartupBinder(JsonObject aEnvConfig){
	iEnvConfig = aEnvConfig;
}

@Override
public void configure(){
	bind(iEnvConfig).to(JsonObject.class).named("EnvConfig");
}

}

However, I don't know how to make it be invoked.