@Override @Deprecated public <T> T getService(ActiveDescriptor<T> activeDescriptor, ServiceHandle<?> root) throws MultiException { return getService(activeDescriptor, root, null); }
@Override @Deprecated public <T> T getService(ActiveDescriptor<T> activeDescriptor, ServiceHandle<?> root) throws MultiException { return getService(activeDescriptor, root, null); }
@Override @Deprecated public <T> T getService(ActiveDescriptor<T> activeDescriptor, ServiceHandle<?> root) throws MultiException { return getService(activeDescriptor, root, null); }
@Override @Deprecated public <T> T getService(ActiveDescriptor<T> activeDescriptor, ServiceHandle<?> root) throws MultiException { return getService(activeDescriptor, root, null); }
@Override public void publish(T message) { if (message == null) throw new IllegalArgumentException(); TopicDistributionService distributor = locator.getService(TopicDistributionService.class); if (distributor == null) { throw new IllegalStateException("There is no implementation of the TopicDistributionService to distribute the message"); } distributor.distributeMessage(this, message); }
@Override public void publish(T message) { if (message == null) throw new IllegalArgumentException(); TopicDistributionService distributor = locator.getService(TopicDistributionService.class); if (distributor == null) { throw new IllegalStateException("There is no implementation of the TopicDistributionService to distribute the message"); } distributor.distributeMessage(this, message); }
@Override public void publish(T message) { if (message == null) throw new IllegalArgumentException(); TopicDistributionService distributor = locator.getService(TopicDistributionService.class); if (distributor == null) { throw new IllegalStateException("There is no implementation of the TopicDistributionService to distribute the message"); } distributor.distributeMessage(this, message); }
@Override public void publish(T message) { if (message == null) throw new IllegalArgumentException(); TopicDistributionService distributor = locator.getService(TopicDistributionService.class); if (distributor == null) { throw new IllegalStateException("There is no implementation of the TopicDistributionService to distribute the message"); } distributor.distributeMessage(this, message); }
@Override public Object resolve(Injectee injectee, ServiceHandle<?> root) { ActiveDescriptor<?> ad = locator.getInjecteeDescriptor(injectee); if (ad == null) { if (injectee.isOptional()) return null; throw new MultiException(new UnsatisfiedDependencyException(injectee)); } return locator.getService(ad, root, injectee); }
@Override public Object resolve(Injectee injectee, ServiceHandle<?> root) { ActiveDescriptor<?> ad = locator.getInjecteeDescriptor(injectee); if (ad == null) { if (injectee.isOptional()) return null; throw new MultiException(new UnsatisfiedDependencyException(injectee)); } return locator.getService(ad, root, injectee); }
@Override public Object resolve(Injectee injectee, ServiceHandle<?> root) { ActiveDescriptor<?> ad = locator.getInjecteeDescriptor(injectee); if (ad == null) { if (injectee.isOptional()) return null; throw new MultiException(new UnsatisfiedDependencyException(injectee)); } return locator.getService(ad, root, injectee); }
@Override public Object resolve(Injectee injectee, ServiceHandle<?> root) { ActiveDescriptor<?> ad = locator.getInjecteeDescriptor(injectee); if (ad == null) { if (injectee.isOptional()) return null; throw new MultiException(new UnsatisfiedDependencyException(injectee)); } return locator.getService(ad, root, injectee); }
private ServiceLocator initialize(final String name, final ServiceLocator parent) { if (parent != null && !(parent instanceof ServiceLocatorImpl)) { throw new AssertionError("parent must be a " + ServiceLocatorImpl.class.getName() + " instead it is a " + parent.getClass().getName()); } final ServiceLocatorImpl sli = new ServiceLocatorImpl(name, (ServiceLocatorImpl) parent); final DynamicConfigurationImpl dci = new DynamicConfigurationImpl(sli); // The service locator itself dci.bind(Utilities.getLocatorDescriptor(sli)); // The injection resolver for three thirty dci.addActiveDescriptor(Utilities.getThreeThirtyDescriptor(sli)); // The dynamic configuration utility dci.bind(BuilderHelper.link(DynamicConfigurationServiceImpl.class, false). to(DynamicConfigurationService.class). in(Singleton.class.getName()). localOnly(). build()); dci.bind(BuilderHelper.createConstantDescriptor( new DefaultClassAnalyzer(sli))); dci.commit(); GuiceBridge.getGuiceBridge().initializeGuiceBridge(sli); GuiceIntoHK2Bridge guiceBridge = sli.getService(GuiceIntoHK2Bridge.class); guiceBridge.bridgeGuiceInjector(GuiceInjectorHolder.getInjector()); return sli; }