private void createAndSendMessage(ClientMembershipEvent event,int type){
  InternalDistributedSystem ds=null;
  Cache cacheInstance=AbstractCacheServer.this.cache;
  if (cacheInstance != null && !(cacheInstance instanceof CacheCreation)) {
    ds=(InternalDistributedSystem)cacheInstance.getDistributedSystem();
  }
 else {
    ds=InternalDistributedSystem.getAnyInstance();
  }
  if (ds != null && ds.isConnected()) {
    DM dm=ds.getDistributionManager();
    Set adminMemberSet=dm.getAdminMemberSet();
    if (!adminMemberSet.isEmpty()) {
      DistributedMember member=event.getMember();
      ClientMembershipMessage msg=new ClientMembershipMessage(event.getMemberId(),member == null ? null : member.getHost(),type);
      msg.setRecipients(adminMemberSet);
      dm.putOutgoing(msg);
    }
  }
}

private void createAndSendMessage ( ClientMembershipEvent event , int type ) { InternalDistributedSystem ds = null ; Cache cacheInstance = AbstractCacheServer . this . cache ; if ( cacheInstance != null && ! ( cacheInstance instanceof CacheCreation ) ) { ds = ( InternalDistributedSystem ) cacheInstance . getDistributedSystem ( ) ; } else { ds = InternalDistributedSystem . getAnyInstance ( ) ; } if ( ds != null && ds . isConnected ( ) ) { DM dm = ds . getDistributionManager ( ) ; Set adminMemberSet = dm . getAdminMemberSet ( ) ; if ( ! adminMemberSet . isEmpty ( ) ) { DistributedMember member = event . getMember ( ) ; ClientMembershipMessage msg = new ClientMembershipMessage ( event . getMemberId ( ) , member == null ? null : member . getHost ( ) , type ) ; msg . setRecipients ( adminMemberSet ) ; dm . putOutgoing ( msg ) ; } } }
method to create & send the clientmembershipmessage to admin members . the message is sent only if there are any admin members in the distribution system .
