}
Bundle bundle = serviceReference.getBundle();
try {
BundleServletContext bundleServletContext =
httpSupport.getBundleServletContext(bundle);
if (action != ACTION_ADDING) {
unregisterService(bundleServletContext, serviceReference);
}
if (action != ACTION_REMOVED) {
String contextId = GetterUtil.getString(
serviceReference.getProperty("contextId"));
HttpContext httpContext = httpSupport.getHttpContext(contextId);
if (httpContext == null) {
httpContext = bundleServletContext.getHttpContext();
}
registerService(
bundleServletContext, serviceReference, service,
initParameters, httpContext);