@Test public void oneEndpoint() { registry.addEndpoint(new RemoteEndpoint().setServiceName(TEST_SERVICE)); Assert.assertNotNull(random.selectEndpoint(TEST_SERVICE)); }
@Override public RemoteEndpoint selectEndpoint(QName serviceName) { if (getRegistry() == null) { return null; } RemoteEndpoint selectedEp = null; List<RemoteEndpoint> eps = getRegistry().getEndpoints(serviceName); if (!eps.isEmpty()) { int idx = _random.nextInt(Integer.MAX_VALUE) % eps.size(); selectedEp = eps.get(idx); } return selectedEp; }
RandomStrategy extends BaseStrategy { @Override public RemoteEndpoint selectEndpoint(QName serviceName) { if (getRegistry() == null) { return null; } RemoteEndpoint selectedEp = null; List<RemoteEndpoint> eps = getRegistry().getEndpoints(serviceName); if (!eps.isEmpty()) { int idx = _random.nextInt(Integer.MAX_VALUE) % eps.size(); selectedEp = eps.get(idx); } return selectedEp; } }
RandomStrategy extends BaseStrategy { @Override public RemoteEndpoint selectEndpoint(QName serviceName) { if (getRegistry() == null) { return null; } RemoteEndpoint selectedEp = null; List<RemoteEndpoint> eps = getRegistry().getEndpoints(serviceName); if (!eps.isEmpty()) { int idx = _random.nextInt(Integer.MAX_VALUE) % eps.size(); selectedEp = eps.get(idx); } return selectedEp; } RandomStrategy(); }
RandomStrategy extends BaseStrategy { @Override public RemoteEndpoint selectEndpoint(QName serviceName) { if (getRegistry() == null) { return null; } RemoteEndpoint selectedEp = null; List<RemoteEndpoint> eps = getRegistry().getEndpoints(serviceName); if (!eps.isEmpty()) { int idx = _random.nextInt(Integer.MAX_VALUE) % eps.size(); selectedEp = eps.get(idx); } return selectedEp; } RandomStrategy(); @Override RemoteEndpoint selectEndpoint(QName serviceName); }
RandomStrategy extends BaseStrategy { @Override public RemoteEndpoint selectEndpoint(QName serviceName) { if (getRegistry() == null) { return null; } RemoteEndpoint selectedEp = null; List<RemoteEndpoint> eps = getRegistry().getEndpoints(serviceName); if (!eps.isEmpty()) { int idx = _random.nextInt(Integer.MAX_VALUE) % eps.size(); selectedEp = eps.get(idx); } return selectedEp; } RandomStrategy(); @Override RemoteEndpoint selectEndpoint(QName serviceName);  }