String registerConfigProvider(AuthConfigProvider provider, String layer, String appContext, String description, boolean persistent) { Registration registration = null; List<RegistrationListener> existingListeners; synchronized(layerContextRegistration) { LayerContextKey key = new LayerContextKey(layer, appContext); registration = layerContextRegistration.get(key); if (registration == null) { registration = new Registration(layer, appContext); layerContextRegistration.put(key, registration); existingListeners = Collections.emptyList(); } else { existingListeners = registration.clearListeners(); } registration.setDescription(description); registration.setPersistent(persistent); registration.setAuthConfigProvider(provider, provider == null); } // Handle notify outside the synchronized block in case they want to re-register. for (RegistrationListener current : existingListeners) { current.notify(layer, appContext); } return registration.getRegistrationId(); }
String registerConfigProvider(AuthConfigProvider provider, String layer, String appContext, String description, boolean persistent) { Registration registration = null; List<RegistrationListener> existingListeners; synchronized(layerContextRegistration) { LayerContextKey key = new LayerContextKey(layer, appContext); registration = layerContextRegistration.get(key); if (registration == null) { registration = new Registration(layer, appContext); layerContextRegistration.put(key, registration); existingListeners = Collections.emptyList(); } else { existingListeners = registration.clearListeners(); } registration.setDescription(description); registration.setPersistent(persistent); registration.setAuthConfigProvider(provider, provider == null); } // Handle notify outside the synchronized block in case they want to re-register. for (RegistrationListener current : existingListeners) { current.notify(layer, appContext); } return registration.getRegistrationId(); }
String registerConfigProvider(AuthConfigProvider provider, String layer, String appContext, String description, boolean persistent) { Registration registration = null; List<RegistrationListener> existingListeners; synchronized(layerContextRegistration) { LayerContextKey key = new LayerContextKey(layer, appContext); registration = layerContextRegistration.get(key); if (registration == null) { registration = new Registration(layer, appContext); layerContextRegistration.put(key, registration); existingListeners = Collections.emptyList(); } else { existingListeners = registration.clearListeners(); } registration.setDescription(description); registration.setPersistent(persistent); registration.setAuthConfigProvider(provider, provider == null); } // Handle notify outside the synchronized block in case they want to re-register. for (RegistrationListener current : existingListeners) { current.notify(layer, appContext); } return registration.getRegistrationId(); }