/*----------------------- MembershipListener ------------------------
171401
public void viewAccepted(View new_view) {
        List<Address> new_mbrs=new_view.getMembers();
        if(new_mbrs != null) {
            notifyViewChange(new_view);
            members.clear();
            members.addAll(new_mbrs);
        }
		//if size is bigger than one, there are more peers in the group
		//otherwise there is only one server.
        send_message=members.size() > 1;
    }
189559
@Override
    public Void visitMemberSelect(MemberSelectTree node, Set<String> p) {
        add(p, node.getIdentifier());
        return super.visitMemberSelect(node, p);
    }
1114393
public void addListener(final ParticipantsListener participantsListener) {
        if (participantsListener != null) {
            MessagingListener messagingListener = new MessagingListener() {

                @Override
                public void onParticipantAdded(ParticipantAddedEvent event) {
                    participantsListener.onParticipantAdded(event);
                }

                @Override
                public void onParticipantUpdated(ParticipantUpdatedEvent event) {
                    participantsListener.onParticipantUpdated(event);
                }

                @Override
                public void onParticipantRemoved(ParticipantRemovedEvent event) {
                    participantsListener.onParticipantRemoved(event);
                }
            };
            participantsListeners.put(participantsListener, messagingListener);
            client.addListener(messagingListener);
        }
    }
665612
function(memberName) {
        var parent = this.super;
        do { parent = Object.getPrototypeOf(parent); } while (!parent.hasOwnProperty(memberName));
        return parent && parent[memberName];
    }
1138480
private void preDelete(MembershipType type) throws Exception
   {
      for (MembershipTypeEventListener listener : listeners)
      {
         listener.preDelete(type);
      }
   }
187772
private void fireMemberRemoved(MemberId exMember) {
        GL.debug(GL.CLUSTER_LOGGER_NAME, "Firing member removed for: {}", exMember);
        for (MembershipEventListener listener : membershipEventListeners) {
            try {
                listener.memberRemoved(exMember);
            } catch (Throwable e) {
                GL.error(GL.CLUSTER_LOGGER_NAME, "Error in member removed event {}", e);
            }
        }
    }
71738
private void removeMemberships(Node membershipTypeNode) throws Exception
   {
      PropertyIterator refTypes = membershipTypeNode.getReferences();
      while (refTypes.hasNext())
      {
         Property refTypeProp = refTypes.nextProperty();

         Node refTypeNode = refTypeProp.getParent();
         Node refUserNode = refTypeNode.getParent();

         membershipHandler.removeMembership(refUserNode, refTypeNode);
      }
   }
1363867
private CompletionStage<Void> emitMembershipUpdateEvent() {
        final IRI membershipResource = parent.getMembershipResource().map(MutatingLdpHandler::removeHashFragment)
            .orElse(null);
        if (membershipResource != null) {
            return allOf(getServices().getResourceService().touch(membershipResource).toCompletableFuture(),
                getServices().getResourceService().get(membershipResource).thenAccept(res -> {
                    if (res.getIdentifier() != null) {
                        getServices().getEventService().emit(new SimpleEvent(getUrl(res.getIdentifier()),
                                    getSession().getAgent(), asList(PROV.Activity, AS.Update),
                                    asList(res.getInteractionModel())));
                    }
                }).toCompletableFuture());
        }
        return completedFuture(null);
    }
187171
private void checkMembers(XMember<?>[] members) {
		for (int index = 0; index < members.length; index++) {
			final XMember<?> member = members[index];
			if (!member.getMember().getDeclaringClass()
					.isAssignableFrom(getTargetClass())) {
				throw new IllegalArgumentException("Member [" + member
						+ "] does not belong to the target class ["
						+ targetClass + "].");
			}
		}
	}
1165623
function (memberValue, memberName) {
        if (this._filterAttribute(memberName, memberValue)) {
            return;
        }
        var newVisibility = _gpfVisibilityKeywords.indexOf(memberName);
        if (_GPF_VISIBILITY_UNKNOWN === newVisibility) {
            return this._addMember(memberName, memberValue, this._deduceVisibility(memberName));
        }
        if (_GPF_VISIBILITY_UNKNOWN !== this._defaultVisibility) {
            gpf.Error.classInvalidVisibility();
        }
        this._processDefinition(memberValue, newVisibility);
    }
228858
void register(Object listener) {
    Multimap<Class<?>, Subscriber> listenerMethods = findAllSubscribers(listener);

    for (Map.Entry<Class<?>, Collection<Subscriber>> entry : listenerMethods.asMap().entrySet()) {
      Class<?> eventType = entry.getKey();
      Collection<Subscriber> eventMethodsInListener = entry.getValue();

      CopyOnWriteArraySet<Subscriber> eventSubscribers = subscribers.get(eventType);

      if (eventSubscribers == null) {
        CopyOnWriteArraySet<Subscriber> newSet = new CopyOnWriteArraySet<Subscriber>();
        eventSubscribers =
            MoreObjects.firstNonNull(subscribers.putIfAbsent(eventType, newSet), newSet);
      }

      eventSubscribers.addAll(eventMethodsInListener);
    }
  }
957676
public void addMemberHeader(ExecutableElement member, Content methodsContentTree) {
        methodsContentTree.addContent(getHead(member));
        methodsContentTree.addContent(getSignature(member));
    }
657992
private MembershipByUserGroupTypeWrapper findMembership(Session session, String id) throws Exception
   {
      IdComponents ids;
      try
      {
         ids = utils.splitId(id);
      }
      catch (IndexOutOfBoundsException e)
      {
         throw new ItemNotFoundException("Can not find membership by id=" + id, e);
      }

      Node groupNode = session.getNodeByUUID(ids.groupNodeId);
      Node refUserNode = groupNode.getNode(JCROrganizationServiceImpl.JOS_MEMBERSHIP).getNode(ids.userName);
      Node refTypeNode =
         refUserNode.getNode(ids.type.equals(MembershipTypeHandler.ANY_MEMBERSHIP_TYPE)
            ? JCROrganizationServiceImpl.JOS_MEMBERSHIP_TYPE_ANY : ids.type);

      String groupId = utils.getGroupIds(groupNode).groupId;

      MembershipImpl membership = new MembershipImpl();
      membership.setId(id);
      membership.setGroupId(groupId);
      membership.setMembershipType(ids.type);
      membership.setUserName(ids.userName);

      putInCache(membership);

      return new MembershipByUserGroupTypeWrapper(membership, refUserNode, refTypeNode);
   }
141848
function getMembers(index) {
  if (this._members === undefined) {
    this._members = _(getValue(this, 'member') || getValue(this, 'memberOf'))
      .split(/,\s*/)
      .compact()
      .sort(util.compareNatural)
      .value();
  }
  var result = this._members;
  return index === undefined ? result : result[index];
}
551647
@Override
	public void subscribeToEvent(EventListener eventListener, Class<? extends AbstractTaskEvent> eventType) {
		this.eventHandler.subscribeToEvent(eventListener, eventType);
	}
1123002
private MembershipType readMembershipType(Node node) throws Exception
   {
      MembershipTypeImpl mt = new MembershipTypeImpl();
      mt.setName(node.getName().equals(JCROrganizationServiceImpl.JOS_MEMBERSHIP_TYPE_ANY) ? ANY_MEMBERSHIP_TYPE : node
         .getName());
      mt.setInternalId(node.getUUID());
      mt.setDescription(utils.readString(node, MembershipTypeProperties.JOS_DESCRIPTION));
      mt.setCreatedDate(utils.readDate(node, MembershipTypeProperties.EXO_DATE_CREATED));
      mt.setModifiedDate(utils.readDate(node, MembershipTypeProperties.EXO_DATE_MODIFIED));

      return mt;
   }
477379
@Override
    public void addEventListener(EventListener listener) {
        if (listener instanceof SessionListener) {
            sessionListeners.add((SessionListener)listener);
        }
        if (listener instanceof SessionAttributeListener) {
            sessionAttributeListeners.add((SessionAttributeListener)listener);
        }
    }