@Test public void testGetServiceInstance() throws Exception { assertTrue(serviceLocator.getServiceInstance("testServiceLocator", ServiceLocator.class, null, null) instanceof ServiceLocator); assertTrue(serviceLocator.getServiceInstance(ServiceSpringKeys.DELIVERY_ASSEMBLER, DeliveryAssembler.class, null, null) instanceof DeliveryAssembler); }
@Override public <T> T getServiceInstance(final String serviceUrl, final Class<T> iface, final String loginName, final String password) { LOG.debug("Get {} as {}", serviceUrl, iface.getName()); try { return getInstantiationStrategy(serviceUrl).getInstance(serviceUrl, iface, loginName, password); } catch (Exception e) { throw new RuntimeException( MessageFormatUtils.format ("Can not create {} instance. Given interface is {}. See root cause for more detail", serviceUrl, iface.getName()), e); } }
ServiceLocatorImpl implements ServiceLocator { @Override public <T> T getServiceInstance(final String serviceUrl, final Class<T> iface, final String loginName, final String password) { LOG.debug("Get {} as {}", serviceUrl, iface.getName()); try { return getInstantiationStrategy(serviceUrl).getInstance(serviceUrl, iface, loginName, password); } catch (Exception e) { throw new RuntimeException( MessageFormatUtils.format ("Can not create {} instance. Given interface is {}. See root cause for more detail", serviceUrl, iface.getName()), e); } } }
ServiceLocatorImpl implements ServiceLocator { @Override public <T> T getServiceInstance(final String serviceUrl, final Class<T> iface, final String loginName, final String password) { LOG.debug("Get {} as {}", serviceUrl, iface.getName()); try { return getInstantiationStrategy(serviceUrl).getInstance(serviceUrl, iface, loginName, password); } catch (Exception e) { throw new RuntimeException( MessageFormatUtils.format ("Can not create {} instance. Given interface is {}. See root cause for more detail", serviceUrl, iface.getName()), e); } } ServiceLocatorImpl();  ServiceLocatorImpl(final List<InstantiationStrategy> strategies); }
ServiceLocatorImpl implements ServiceLocator { @Override public <T> T getServiceInstance(final String serviceUrl, final Class<T> iface, final String loginName, final String password) { LOG.debug("Get {} as {}", serviceUrl, iface.getName()); try { return getInstantiationStrategy(serviceUrl).getInstance(serviceUrl, iface, loginName, password); } catch (Exception e) { throw new RuntimeException( MessageFormatUtils.format ("Can not create {} instance. Given interface is {}. See root cause for more detail", serviceUrl, iface.getName()), e); } } ServiceLocatorImpl();  ServiceLocatorImpl(final List<InstantiationStrategy> strategies); @Override T getServiceInstance(final String serviceUrl,
                                    final Class<T> iface,
                                    final String loginName,
                                    final String password); @Override void register(final InstantiationStrategy instantiationStrategy); }
ServiceLocatorImpl implements ServiceLocator { @Override public <T> T getServiceInstance(final String serviceUrl, final Class<T> iface, final String loginName, final String password) { LOG.debug("Get {} as {}", serviceUrl, iface.getName()); try { return getInstantiationStrategy(serviceUrl).getInstance(serviceUrl, iface, loginName, password); } catch (Exception e) { throw new RuntimeException( MessageFormatUtils.format ("Can not create {} instance. Given interface is {}. See root cause for more detail", serviceUrl, iface.getName()), e); } } ServiceLocatorImpl();  ServiceLocatorImpl(final List<InstantiationStrategy> strategies); @Override T getServiceInstance(final String serviceUrl,
                                    final Class<T> iface,
                                    final String loginName,
                                    final String password); @Override void register(final InstantiationStrategy instantiationStrategy);  }