I have a method to start up my application:
public void start() throws IOException {
final Map initParams = new HashMap
You can implement InjectableProvider. For example:
@Provider
public class FooProvider
implements InjectableProvider {
public ComponentScope getScope() {
return ComponentScope.PerRequest;
}
public Injectable getInjectable(ComponentContext ic, Resource resource, Type type) {
return new Injectable() {
public Object getValue() {
return new Foo();
}
};
}
}
and then annotate field in your resource:
@Resource private Foo foo;