Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose UserProfileAdmin as an OSGi service #2499

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.osgi.service.component.annotations.ReferencePolicy;
import org.wso2.carbon.identity.core.util.IdentityCoreInitializedEvent;
import org.wso2.carbon.identity.core.util.IdentityDatabaseUtil;
import org.wso2.carbon.identity.user.profile.mgt.UserProfileAdmin;
import org.wso2.carbon.identity.user.profile.mgt.listener.ProfileMgtEventListener;
import org.wso2.carbon.identity.user.profile.mgt.util.ServiceHodler;
import org.wso2.carbon.identity.user.store.configuration.listener.UserStoreConfigListener;
Expand Down Expand Up @@ -73,6 +74,17 @@ protected void activate(ComponentContext ctxt) {
} else {
log.error("User profile management - ProfileMgtEventListener could not be registered.");
}

ServiceRegistration userProfileAdminSR =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exposing an admin service as an OSGi layer directly doesn't sound right. Can we introduce the separate OSGi service?
You can use the same OSGi service within the admin service as well.

ctxt.getBundleContext().registerService(UserProfileAdmin.class.getName(),
new UserProfileAdmin(), null);
if (userProfileAdminSR != null) {
if (log.isDebugEnabled()) {
log.debug("User profile management - UserProfileAdmin registered.");
}
} else {
log.error("User profile management - UserProfileAdmin could not be registered.");
}
} catch (Throwable e) {
log.error("Failed to activate ProfileMgt bundle ", e);
}
Expand Down