@Test(expected=IllegalArgumentException.class) public void getRequiresInterface() throws ClassNotFoundException { Guicer guicer = messageGuicer( bind(DummyInterfaces.Alpha.class, DummySimpleServices.SimpleAlpha.class, true), bind(DummyInterfaces.Beta.class, DummySimpleServices.SimpleBeta.class, false), bind(DummyInterfaces.Gamma.class, DummySimpleServices.SimpleGamma.class, false) ); startRequiredServices(guicer); Object a = guicer.get(DummyInterfaces.Alpha.class, MESSAGING_ACTIONS); Object b = guicer.get(DummyInterfaces.Alpha.class, MESSAGING_ACTIONS); assertEquals("two different gets", a, b); guicer.get(DummySimpleServices.SimpleAlpha.class, MESSAGING_ACTIONS); }
public <T> T get(Class<T> serviceClass, ServiceLifecycleActions<?> withActions) { if(!serviceClass.isInterface()) { throw new IllegalArgumentException("Interface required"); } final T instance = _injector.getInstance(serviceClass); return startService(serviceClass, instance, withActions); }
Guicer { public <T> T get(Class<T> serviceClass, ServiceLifecycleActions<?> withActions) { if(!serviceClass.isInterface()) { throw new IllegalArgumentException("Interface required"); } final T instance = _injector.getInstance(serviceClass); return startService(serviceClass, instance, withActions); } }
Guicer { public <T> T get(Class<T> serviceClass, ServiceLifecycleActions<?> withActions) { if(!serviceClass.isInterface()) { throw new IllegalArgumentException("Interface required"); } final T instance = _injector.getInstance(serviceClass); return startService(serviceClass, instance, withActions); } private  Guicer(Class<? extends ServiceManagerBase> serviceManagerInterfaceClass, ServiceManagerBase serviceManager,
                   Collection<ServiceBinding> serviceBindings, List<String> priorities,
                   Collection<? extends Module> modules); }
Guicer { public <T> T get(Class<T> serviceClass, ServiceLifecycleActions<?> withActions) { if(!serviceClass.isInterface()) { throw new IllegalArgumentException("Interface required"); } final T instance = _injector.getInstance(serviceClass); return startService(serviceClass, instance, withActions); } private  Guicer(Class<? extends ServiceManagerBase> serviceManagerInterfaceClass, ServiceManagerBase serviceManager,
                   Collection<ServiceBinding> serviceBindings, List<String> priorities,
                   Collection<? extends Module> modules); Collection<Class<?>> directlyRequiredClasses(); void stopAllServices(ServiceLifecycleActions<?> withActions); T get(Class<T> serviceClass, ServiceLifecycleActions<?> withActions); boolean serviceIsStarted(Class<?> serviceClass); boolean isRequired(Class<?> interfaceClass); boolean isBoundTo(Class<?> interfaceClass, Class<?> targetClass); List<?> dependenciesFor(Class<?> rootClass); static Guicer forServices(Collection<ServiceBinding> serviceBindings); static Guicer forServices(Class<M> serviceManagerInterfaceClass,
                                                                    M serviceManager,
                                                                    Collection<ServiceBinding> serviceBindings,
                                                                    List<String> priorities,
                                                                    Collection<? extends Module> modules); List<Class<?>> servicesClassesInStartupOrder(); }
Guicer { public <T> T get(Class<T> serviceClass, ServiceLifecycleActions<?> withActions) { if(!serviceClass.isInterface()) { throw new IllegalArgumentException("Interface required"); } final T instance = _injector.getInstance(serviceClass); return startService(serviceClass, instance, withActions); } private  Guicer(Class<? extends ServiceManagerBase> serviceManagerInterfaceClass, ServiceManagerBase serviceManager,
                   Collection<ServiceBinding> serviceBindings, List<String> priorities,
                   Collection<? extends Module> modules); Collection<Class<?>> directlyRequiredClasses(); void stopAllServices(ServiceLifecycleActions<?> withActions); T get(Class<T> serviceClass, ServiceLifecycleActions<?> withActions); boolean serviceIsStarted(Class<?> serviceClass); boolean isRequired(Class<?> interfaceClass); boolean isBoundTo(Class<?> interfaceClass, Class<?> targetClass); List<?> dependenciesFor(Class<?> rootClass); static Guicer forServices(Collection<ServiceBinding> serviceBindings); static Guicer forServices(Class<M> serviceManagerInterfaceClass,
                                                                    M serviceManager,
                                                                    Collection<ServiceBinding> serviceBindings,
                                                                    List<String> priorities,
                                                                    Collection<? extends Module> modules); List<Class<?>> servicesClassesInStartupOrder();  }