Notifying listeners after membership deletion.

@param membership
the membership which is used in delete operation
@throws Exception
if any listener failed to handle the event
350689
private void postDelete(Membership membership) throws Exception
   {
      for (MembershipEventListener listener : listeners)
      {
         listener.postDelete(membership);
      }
   }
1112488
public void removeMembershipEventListener(MembershipEventListener listener)
   {
      SecurityHelper.validateSecurityPermission(PermissionConstants.MANAGE_LISTENERS);
      listeners.remove(listener);
   }
1226990
private void handleLeaveEvent(Node node) {
    members.compute(MemberId.from(node.id().id()), (id, member) -> member == null || !member.isActive() ? null : member);
  }
1301737
public void subscribeToEvent(final EventListener eventListener, final Class<? extends AbstractTaskEvent> eventType) {

		synchronized (this.subscriptions) {

			List<EventListener> subscribers = this.subscriptions.get(eventType);
			if (subscribers == null) {
				subscribers = new ArrayList<EventListener>();
				this.subscriptions.put(eventType, subscribers);
			}
			subscribers.add(eventListener);
		}

	}
931776
public void destroy()
            throws Exception
    {
        if (!state.compareAndSet(State.STARTED, State.STOPPING)) {
            return;
        }
        for (LifeCycleListener listener : listeners) {
            listener.stoppingLifeCycle();
        }

        List<Object> reversedInstances = Lists.newArrayList(managedInstances);
        Collections.reverse(reversedInstances);

        for (Object obj : reversedInstances) {
            for (LifeCycleListener listener : listeners) {
                listener.stoppingInstance(obj);
            }
            LifeCycleMethods methods = methodsMap.get(obj.getClass());
            for (Method preDestroy : methods.methodsFor(PreDestroy.class)) {
                for (LifeCycleListener listener : listeners) {
                    listener.preDestroyingInstance(obj, preDestroy);
                }
                preDestroy.invoke(obj);
            }
        }

        state.set(State.STOPPED);
        for (LifeCycleListener listener : listeners) {
            listener.stoppedLifeCycle();
        }
    }
54505
def remove_member(self, member, api=None):
        
        api = api or self._API
        username = Transform.to_member(member)

        api.delete(
            url=self._URL['member'].format(
                id=self.id,
                username=username
            )
        )
708044
public function deleted(MemberInvitation $invitation)
    {
        $member = Member::findOrFail($invitation->member_id);
        /** @noinspection PhpUndefinedMethodInspection */
        $member->forceDelete();
    }
621375
synchronized public void removeListener(Object listener)
    {
        if (!_listeners.contains(listener))
            throw new IllegalStateException("Invalid listener, not currently registered");

        _listeners.remove(listener);
    }
89988
private Membership removeMembership(Session session, String id, boolean broadcast) throws Exception
   {
      MembershipByUserGroupTypeWrapper mWrapper;
      try
      {
         mWrapper = findMembership(session, id);
      }
      catch (ItemNotFoundException e)
      {
         return null;
      }
      catch (PathNotFoundException e)
      {
         return null;
      }

      if (broadcast)
      {
         preDelete(mWrapper.membership);
      }

      removeMembership(mWrapper.refUserNode, mWrapper.refTypeNode);
      session.save();

      removeFromCache(mWrapper.membership);

      if (broadcast)
      {
         postDelete(mWrapper.membership);
      }

      return mWrapper.membership;
   }
565047
private void preDelete(Group group) throws Exception
   {
      for (GroupEventListener listener : listeners)
      {
         listener.preDelete(group);
      }
   }
188591
private void onMembershipChange(ClusterMembershipEvent event) {
    if (event.type() == ClusterMembershipEvent.Type.MEMBER_REMOVED) {
      recoverTransactions(transactions.entrySet().iterator(), event.subject().id());
    }
  }
1198339
public void deleteRegisteredListeners(RESTRequest request, int clientID, ObjectName source_objName, JSONConverter converter) {
        //Get the client area
        ClientNotificationArea clientArea = getInboxIfAvailable(clientID, null);

        clientArea.removeAllListeners(request, source_objName, converter);
    }
43835
public void removeConnectionEventListener(ConnectionEventListener listener) {
    log.finest("removeConnectionEventListener()");
    if (listener == null)
      throw new IllegalArgumentException("Listener is null");
    listeners.remove(listener);
  }
647713
public void removeBeanContextMembershipListener(BeanContextMembershipListener listener)
	{
		if (listener == null)
		{
			throw new NullPointerException();
		}
		synchronized (bcmListeners)
		{
			bcmListeners.remove(listener);
		}
	}
858098
private void migrateMemberships() throws Exception
   {
      Session session = service.getStorageSession();
      try
      {
         if (session.itemExists(usersStorageOld))
         {
            NodeIterator iterator = ((ExtendedNode)session.getItem(usersStorageOld)).getNodesLazily();
            MembershipHandlerImpl mh = ((MembershipHandlerImpl)service.getMembershipHandler());
            while (iterator.hasNext())
            {
               Node oldUserNode = iterator.nextNode();
               mh.migrateMemberships(oldUserNode);
               oldUserNode.remove();
               session.save();
            }
         }
      }
      finally
      {
         session.logout();
      }
   }
95886
public void removeListener(UserTransactionListener listener)
   {
      UserTransactionListenerImpl impl = listeners.get(listener);

      if (impl != null)
      {
         delegator.removeListener(impl);
         listeners.remove(listener);
      }
   }
727709
private void postDelete(UserProfile userProfile) throws Exception
   {
      for (UserProfileEventListener listener : listeners)
      {
         listener.postDelete(userProfile);
      }
   }