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

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -