java - Inject the same Instance of an Interface across my Application? -
in gwt/gwtp app have interface instantiate in entrypoint class:
@override public void onmoduleload() { final a = gwt.create(a.class); }
now want inject interface instance in presenters this:
private final a; @inject public apppresenter(final eventbus eventbus, final myview view, final myproxy proxy, a) { super(eventbus, view, proxy); this.a = a; }
my idea bind interface in gin module like:
bind(a.class).aseagersingleton();
this guarantee 1 instance. problem interface has no constructor fail.
ho instantiate of interface across application?
Comments
Post a Comment