current.notify(layer, appContext);
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(); }
private static void notifyListeners(Map<String, List<RegistrationListener>> map) { Set<Map.Entry<String, List<RegistrationListener>>> entrySet = map.entrySet(); for (Map.Entry<String, List<RegistrationListener>> entry : entrySet) { List<RegistrationListener> listeners = map.get(entry.getKey()); if (listeners != null && listeners.size() > 0) { String[] dIds = decomposeRegisID(entry.getKey()); for (RegistrationListener listener : listeners) { listener.notify(dIds[0], dIds[1]); } } } } }
private static void notifyListeners(Map<String, List<RegistrationListener>> map) { Set<Map.Entry<String, List<RegistrationListener>>> entrySet = map.entrySet(); for (Map.Entry<String, List<RegistrationListener>> entry : entrySet) { List<RegistrationListener> listeners = map.get(entry.getKey()); if (listeners != null && listeners.size() > 0) { String[] dIds = decomposeRegisID(entry.getKey()); for (RegistrationListener listener : listeners) { listener.notify(dIds[0], dIds[1]); } } } } }
listener.notify(layer,appContext);
public boolean removeRegistration(String registrationID) { if (registrationID == null) throw PicketBoxMessages.MESSAGES.invalidNullArgument("registrationID"); RegistrationListener listener = this.keyToRegistrationListenerMap.get(registrationID); RegistrationContext rc = this.keyToRegistrationContextMap.get(registrationID); // remove the provider and notify listener of the change. boolean removed = (this.keyToAuthConfigProviderMap.remove(registrationID) != null); if (removed && listener != null) listener.notify(rc.getMessageLayer(), rc.getAppContext()); this.keyToRegistrationContextMap.remove(registrationID); return removed; }
public String registerConfigProvider(AuthConfigProvider provider, String layer, String appContext, String description) { String registrationID = new StringBuilder().append(layer).append(appContext).toString(); // check if we already have a registration for the layer/appContext key. AuthConfigProvider oldProvider = this.keyToAuthConfigProviderMap.put(registrationID, provider); if (oldProvider != null) { // registration already exists and provider has been replaced. Update the registration context. JBossRegistrationContext context = (JBossRegistrationContext) this.keyToRegistrationContextMap.get(registrationID); context.setDescription(description); context.setIsPersistent(false); // if there is a listener attached to the registration, notify it that the registration has been replaced. RegistrationListener listener = this.keyToRegistrationListenerMap.get(registrationID); if (listener != null) listener.notify(layer, appContext); } else { // create a registration context for the new registration. RegistrationContext context = new JBossRegistrationContext(layer, appContext, description, false); this.keyToRegistrationContextMap.put(registrationID, context); } return registrationID; }
current.notify(layer, appContext);
current.notify(layer, appContext);
/** * @see AuthConfigFactory#removeRegistration(String) */ public boolean removeRegistration(String registrationID) { if(registrationID == null) throw new IllegalArgumentException("registrationID is null"); String key = (String)idKeyMap.get(registrationID); if(key != null) { RegistrationListener listener = (RegistrationListener)this.keyListenerMap.get(key); RegistrationContext rc = this.getRegistrationContext(registrationID); this.keyProviderMap.remove(key); //Notify the listener of the change if(listener != null) listener.notify(rc.getMessageLayer(),rc.getAppContext()); return true; } return false; } }
appContext.equals(wrapper.getAppContext())) { registration.listeners.remove(wrapper); wrapper.listener.notify(wrapper.messageLayer, wrapper.appContext); if (appContext.equals(wrapper.getAppContext())) { registration.listeners.remove(wrapper); wrapper.listener.notify(wrapper.messageLayer, wrapper.appContext); layer != null && layer.equals(wrapper.getMessageLayer())) { registration.listeners.remove(wrapper); wrapper.listener.notify(wrapper.messageLayer, wrapper.appContext); wrapper.listener.notify(wrapper.messageLayer, wrapper.appContext);
appContext.equals(wrapper.getAppContext())) { registration.listeners.remove(wrapper); wrapper.listener.notify(wrapper.messageLayer, wrapper.appContext); if (appContext.equals(wrapper.getAppContext())) { registration.listeners.remove(wrapper); wrapper.listener.notify(wrapper.messageLayer, wrapper.appContext); layer != null && layer.equals(wrapper.getMessageLayer())) { registration.listeners.remove(wrapper); wrapper.listener.notify(wrapper.messageLayer, wrapper.appContext); wrapper.listener.notify(wrapper.messageLayer, wrapper.appContext);
listener.notify(layer, appContext);
@Override public boolean removeRegistration(String registrationID) { RegistrationContextImpl registration = null; if (DEFAULT_REGISTRATION_ID.equals(registrationID)) { registration = defaultRegistration.remove(registrationID); } if (registration == null) { registration = layerAppContextRegistrations.remove(registrationID); } if (registration == null) { registration = appContextRegistrations.remove(registrationID); } if (registration == null) { registration = layerRegistrations.remove(registrationID); } if (registration == null) { return false; } else { for (RegistrationListenerWrapper wrapper : registration.listeners) { wrapper.getListener().notify(wrapper.getMessageLayer(), wrapper.getAppContext()); } if (registration.isPersistent()) { savePersistentRegistrations(); } return true; } }
@Override public boolean removeRegistration(String registrationID) { RegistrationContextImpl registration = null; if (DEFAULT_REGISTRATION_ID.equals(registrationID)) { registration = defaultRegistration.remove(registrationID); } if (registration == null) { registration = layerAppContextRegistrations.remove(registrationID); } if (registration == null) { registration = appContextRegistrations.remove(registrationID); } if (registration == null) { registration = layerRegistrations.remove(registrationID); } if (registration == null) { return false; } else { for (RegistrationListenerWrapper wrapper : registration.listeners) { wrapper.getListener().notify(wrapper.getMessageLayer(), wrapper.getAppContext()); } if (registration.isPersistent()) { savePersistentRegistrations(); } return true; } }
public synchronized boolean removeRegistration(String registrationID) throws SecurityException { SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new AuthPermission("removeAuthRegistration")); } ConfigProviderInfo ctx = getRegistrations().remove(registrationID); saveConfig(); if (ctx != null) { List<RegistrationListener> listeners = ctx.getListeners(); for (RegistrationListener listener : listeners) { listener.notify(ctx.getMessageLayer(), ctx.getAppContext()); } return true; } return false; }
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(); }
listener.notify(info.getMessageLayer(), info.getAppContext());