@Test public void bindOne() { ServiceBindingsBuilder builder = new ServiceBindingsBuilder(); builder.bind("one", "two"); checkOnlyBinding(builder, "one", "two", false, false); }
public void bind(String interfaceName, String className, ClassLoader classLoader) { ServiceBinding binding = defineIfNecessary(interfaceName, classLoader); if (binding.isLocked()) { throw new ServiceConfigurationException(interfaceName + " is locked"); } binding.setImplementingClass(className); }
ServiceBindingsBuilder { public void bind(String interfaceName, String className, ClassLoader classLoader) { ServiceBinding binding = defineIfNecessary(interfaceName, classLoader); if (binding.isLocked()) { throw new ServiceConfigurationException(interfaceName + " is locked"); } binding.setImplementingClass(className); } }
ServiceBindingsBuilder { public void bind(String interfaceName, String className, ClassLoader classLoader) { ServiceBinding binding = defineIfNecessary(interfaceName, classLoader); if (binding.isLocked()) { throw new ServiceConfigurationException(interfaceName + " is locked"); } binding.setImplementingClass(className); }  }
ServiceBindingsBuilder { public void bind(String interfaceName, String className, ClassLoader classLoader) { ServiceBinding binding = defineIfNecessary(interfaceName, classLoader); if (binding.isLocked()) { throw new ServiceConfigurationException(interfaceName + " is locked"); } binding.setImplementingClass(className); }  void bind(String interfaceName, String className, ClassLoader classLoader); Collection<ServiceBinding> getAllBindings(boolean strict); List<String> getPriorities(); void lock(String interfaceName); void markDirectlyRequired(String interfaceName); void mustBeBound(String interfaceName); void mustBeLocked(String interfaceName); void prioritize(String interfaceName); void markSectionEnd(); void unbind(String interfaceName); }
ServiceBindingsBuilder { public void bind(String interfaceName, String className, ClassLoader classLoader) { ServiceBinding binding = defineIfNecessary(interfaceName, classLoader); if (binding.isLocked()) { throw new ServiceConfigurationException(interfaceName + " is locked"); } binding.setImplementingClass(className); }  void bind(String interfaceName, String className, ClassLoader classLoader); Collection<ServiceBinding> getAllBindings(boolean strict); List<String> getPriorities(); void lock(String interfaceName); void markDirectlyRequired(String interfaceName); void mustBeBound(String interfaceName); void mustBeLocked(String interfaceName); void prioritize(String interfaceName); void markSectionEnd(); void unbind(String interfaceName);  }