Search in sources :

Example 1 with Stopwatch

use of com.google.inject.internal.util.Stopwatch in project roboguice by roboguice.

the class RoboActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    stopwatch = new Stopwatch();
    final RoboInjector injector = RoboGuice.getInjector(this);
    stopwatch.resetAndLog("RoboActivity creation of injector");
    eventManager = injector.getInstance(EventManager.class);
    stopwatch.resetAndLog("RoboActivity creation of eventmanager");
    injector.injectMembersWithoutViews(this);
    stopwatch.resetAndLog("RoboActivity inject members without views");
    super.onCreate(savedInstanceState);
    stopwatch.resetAndLog("RoboActivity super onCreate");
    eventManager.fire(new OnCreateEvent<Activity>(this, savedInstanceState));
    stopwatch.resetAndLog("RoboActivity fire event");
}
Also used : RoboInjector(roboguice.inject.RoboInjector) EventManager(roboguice.event.EventManager) Stopwatch(com.google.inject.internal.util.Stopwatch) Activity(android.app.Activity)

Example 2 with Stopwatch

use of com.google.inject.internal.util.Stopwatch in project roboguice by roboguice.

the class RoboGuice method getOrCreateBaseApplicationInjector.

/**
     * Return the cached Injector instance for this application, or create a new one if necessary.
     * <b>One of RoboGuice's entry points</b>.
     */
public static Injector getOrCreateBaseApplicationInjector(Application application, Stage stage) {
    final Stopwatch stopwatch = new Stopwatch();
    synchronized (RoboGuice.class) {
        initializeAnnotationDatabaseFinderAndHierarchyTraversalFilterFactory(application);
        final List<Module> modules = extractModulesFromManifest(application);
        return createGuiceInjector(application, stage, stopwatch, modules.toArray(new Module[modules.size()]));
    }
}
Also used : Stopwatch(com.google.inject.internal.util.Stopwatch) Module(com.google.inject.Module) DefaultRoboModule(roboguice.config.DefaultRoboModule)

Aggregations

Stopwatch (com.google.inject.internal.util.Stopwatch)2 Activity (android.app.Activity)1 Module (com.google.inject.Module)1 DefaultRoboModule (roboguice.config.DefaultRoboModule)1 EventManager (roboguice.event.EventManager)1 RoboInjector (roboguice.inject.RoboInjector)1