code: private void addAdminObjectService(ServiceReference<AdminObjectService> reference, String id, boolean jndiName) {
          NamedAdminObjectServiceInfo aosInfo = createNamedAdminObjectServiceInfo(id);
          aosInfo.getServices(jndiName).addReference(reference);
  
          // If the highest reference after updating is the one we just added,
          // then we need to deactivate any endpoints using the old admin object
          // and reactive them using the new admin object.
          ServiceReference<AdminObjectService> oldServiceRef = aosInfo.serviceRef;
          if (aosInfo.updateServiceRef().equals(reference)) {
              if (oldServiceRef != null) {
                  deactivateEndpoints(aosInfo.endpointFactories);
              }
              activateDeferredEndpoints(aosInfo.endpointFactories);
          }
  
          // With a new adminObjectService, there is a possibility that lookups which
          // failed earlier could now succeed, allowing endpoint activation.
          updateSchemeJndiNames(true);
      }
docs: Internal method for adding an AdminObjectService with an id.
  
  <p>Caller must hold a lock on this object.
  
  @param reference the service reference
  @param id the id or jndiName
  @param jndiName true if the id is the jndiName