public static MvcGraph graph() {
        if (graph == null) {
            graph = new MvcGraph();

            try {
                graph.getRootComponent().register(new Object() {
                    @Provides
                    @EventBusC
                    public EventBus eventBusC() {
                        return new EventBusImpl();
                    }

                    @Provides
                    @EventBusV
                    public EventBus eventBusV() {
                        return new EventBusImpl() {
                            @Override
                            public void post(final Object event) {
                                if (graph.uiThreadRunner.isOnUiThread()) {
                                    postEvent(event);
                                } else {
                                    graph.uiThreadRunner.post(new Runnable() {
                                        @Override
                                        public void run() {
                                            postEvent(event);
                                        }
                                    });
                                }
                            }

                            private void postEvent(Object event) {
                                super.post(event);
                            }
                        };
                    }

                    @Provides
                    public ExecutorService executorService() {
                        return Executors.newFixedThreadPool(10, new ThreadFactory() {
                            @Override
                            public Thread newThread(final Runnable r) {
                                return new Thread(new Runnable() {
                                    @Override
                                    public void run() {
                                        Thread.currentThread().setPriority(Thread.NORM_PRIORITY - 1);
                                        r.run();
                                    }
                                }, "MvcBackgroundThread");
                            }
                        });
                    }
                });
            } catch (ProvideException e) {
                throw new MvcGraphException("Failed to register base Mvc dependencies", e);
            } catch (ProviderConflictException e) {
                throw new MvcGraphException("Failed to register base Mvc dependencies", e);
            }
        }
        return graph;
    }
public static MvcGraph graph ( ) { if ( graph == null ) { graph = new MvcGraph ( ) ; try { graph . getRootComponent ( ) . register ( new Object ( ) { @ Provides @ EventBusC public EventBus eventBusC ( ) { return new EventBusImpl ( ) ; } @ Provides @ EventBusV public EventBus eventBusV ( ) { return new EventBusImpl ( ) { @ Override public void post ( final Object event ) { if ( graph . uiThreadRunner . isOnUiThread ( ) ) { postEvent ( event ) ; } else { graph . uiThreadRunner . post ( new Runnable ( ) { @ Override public void run ( ) { postEvent ( event ) ; } } ) ; } } private void postEvent ( Object event ) { super . post ( event ) ; } } ; } @ Provides public ExecutorService executorService ( ) { return Executors . newFixedThreadPool ( 10 , new ThreadFactory ( ) { @ Override public Thread newThread ( final Runnable r ) { return new Thread ( new Runnable ( ) { @ Override public void run ( ) { Thread . currentThread ( ) . setPriority ( Thread . NORM_PRIORITY - 1 ) ; r . run ( ) ; } } , "MvcBackgroundThread" ) ; } } ) ; } } ) ; } catch ( ProvideException e ) { throw new MvcGraphException ( "Failed to register base Mvc dependencies" , e ) ; } catch ( ProviderConflictException e ) { throw new MvcGraphException ( "Failed to register base Mvc dependencies" , e ) ; } } return graph ; }
Get the {@link MvcGraph} managing injectable objects. It comes with a default
{@link MvcComponent}.
@return