@Test public void testGetDoesNotReturnUninitializedProducers() throws Exception { CountDownLatch border = new CountDownLatch(1); Future future = registerBlockingProducer(createMockProducer("uninitialized"), border); assertNull(ResourceRegistrar.get("uninitialized")); border.countDown(); future.get(); assertNotNull(ResourceRegistrar.get("uninitialized")); }
public static XAResourceProducer get(final String uniqueName) { if (uniqueName != null) { for (ProducerHolder holder : resources) { if (!holder.isInitialized()) continue; if (uniqueName.equals(holder.getUniqueName())) return holder.producer; } } return null; }
ResourceRegistrar { public static XAResourceProducer get(final String uniqueName) { if (uniqueName != null) { for (ProducerHolder holder : resources) { if (!holder.isInitialized()) continue; if (uniqueName.equals(holder.getUniqueName())) return holder.producer; } } return null; } }
ResourceRegistrar { public static XAResourceProducer get(final String uniqueName) { if (uniqueName != null) { for (ProducerHolder holder : resources) { if (!holder.isInitialized()) continue; if (uniqueName.equals(holder.getUniqueName())) return holder.producer; } } return null; } private  ResourceRegistrar(); }
ResourceRegistrar { public static XAResourceProducer get(final String uniqueName) { if (uniqueName != null) { for (ProducerHolder holder : resources) { if (!holder.isInitialized()) continue; if (uniqueName.equals(holder.getUniqueName())) return holder.producer; } } return null; } private  ResourceRegistrar(); static XAResourceProducer get(final String uniqueName); static Set<String> getResourcesUniqueNames(); static void register(XAResourceProducer producer); static void unregister(XAResourceProducer producer); static XAResourceHolder findXAResourceHolder(XAResource xaResource); }
ResourceRegistrar { public static XAResourceProducer get(final String uniqueName) { if (uniqueName != null) { for (ProducerHolder holder : resources) { if (!holder.isInitialized()) continue; if (uniqueName.equals(holder.getUniqueName())) return holder.producer; } } return null; } private  ResourceRegistrar(); static XAResourceProducer get(final String uniqueName); static Set<String> getResourcesUniqueNames(); static void register(XAResourceProducer producer); static void unregister(XAResourceProducer producer); static XAResourceHolder findXAResourceHolder(XAResource xaResource); final static String UNIQUE_NAME_CHARSET; }