ActivityMapper with Gin and AsyncProvider

I just started a project built using the new GWT archetype .

ActivityMapper looks like this:

public interface Factory { HomeActivity homeActivity(); GreetingActivity greetingActivity(String user); } private final Factory factory; @Inject MainActivityMapper(Factory factory) { this.factory = factory; } @Override public Activity getActivity(Place place) { if (place instanceof HomePlace) { return factory.homeActivity(); } if (place instanceof GreetingPlace) { GreetingPlace greetingPlace = (GreetingPlace) place; return factory.greetingActivity(greetingPlace.getUser()); } logger.severe("Unhandled place type: " + place.getClass().getName()); return null; } 

Now I am trying to implement code separation using AsyncProvider based on this example , but I cannot get it to work.

What to do when using ActivityAsyncProxy? return ActivityAsyncProxy from getActivity (placement)? but then, how can I create ActivityAsyncProxy from the factory?

How would you recommend making the activity mapper play well with code splitting?

+4
source share
1 answer

AFAICT, you cannot use AsyncProvider with an auxiliary injection (this would be a great addition to the GIN). This means that you cannot use the generated runAsync calls, you will have to do them yourself.

See http://code.google.com/p/google-web-toolkit/issues/detail?id=5129 for a discussion of this issue with several suggestions.

Also see https://groups.google.com/d/msg/google-web-toolkit-contributors/bUFYWEFskBI/ja2aJ0tBgdwJ for my own capture (also available on <a2> ).

+3
source

All Articles