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 ) ; }
Internal method for adding an AdminObjectService with an id .