- protected BindingAwareBroker.ProviderContext getProviderContext() {
- BindingAwareBroker.ProviderContext providerContext = null;
- for (int i = 0; i < 60; i++) {
- LOG.info("Looking for ProviderContext, try {}", i);
- providerContext = getSession();
- if (providerContext != null) {
- break;
- } else {
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- LOG.warn("Interrupted while waiting for provider context", e);
- }
- }
- }
- assertNotNull("providercontext should not be null", providerContext);
- /* One more second to let the provider finish initialization */
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- LOG.warn("Interrupted while waiting for other provider", e);
- }
- return providerContext;
- }
-