Skip to content

Commit 6e7c546

Browse files
Add provided capabilities
1 parent a685976 commit 6e7c546

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

core/org.wso2.carbon.ndatasource.core/src/main/java/org/wso2/carbon/ndatasource/core/DataSourceService.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,19 @@
1818
import java.util.ArrayList;
1919
import java.util.List;
2020

21+
import org.osgi.annotation.bundle.Capability;
2122
import org.wso2.carbon.ndatasource.common.DataSourceException;
2223

2324
/**
2425
* This class represents the data source OSGi service.
2526
*/
27+
@Capability(
28+
namespace = "osgi.service",
29+
attribute = {
30+
"objectClass=org.wso2.carbon.ndatasource.core.DataSourceService",
31+
"service.scope=singleton"
32+
}
33+
)
2634
public class DataSourceService {
2735

2836
public List<CarbonDataSource> getAllDataSources() throws DataSourceException {

core/org.wso2.carbon.registry.core/src/main/java/org/wso2/carbon/registry/core/secure/AuthorizeRoleListener.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import org.apache.commons.logging.Log;
2222
import org.apache.commons.logging.LogFactory;
23+
import org.osgi.annotation.bundle.Capability;
2324
import org.wso2.carbon.registry.core.ActionConstants;
2425
import org.wso2.carbon.registry.core.config.RegistryContext;
2526
import org.wso2.carbon.registry.core.utils.RegistryUtils;
@@ -37,6 +38,13 @@
3738
* permissions to registry resource permissions and thereby manage accessibility to various resource
3839
* paths based on the amount of permissions available to a given role.
3940
*/
41+
@Capability(
42+
namespace = "osgi.service",
43+
attribute = {
44+
"objectClass=org.wso2.carbon.user.core.listener.AuthorizationManagerListener",
45+
"service.scope=singleton"
46+
}
47+
)
4048
public class AuthorizeRoleListener extends AbstractAuthorizationManagerListener
4149
implements AuthorizationManagerListener {
4250

core/org.wso2.carbon.server.admin/src/main/java/org/wso2/carbon/server/admin/service/ServerAdmin.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.apache.axis2.transport.http.HTTPConstants;
2525
import org.apache.commons.logging.Log;
2626
import org.apache.commons.logging.LogFactory;
27+
import org.osgi.annotation.bundle.Capability;
2728
import org.wso2.carbon.CarbonConstants;
2829
import org.wso2.carbon.base.ServerConfiguration;
2930
import org.wso2.carbon.base.api.ServerConfigurationService;
@@ -55,6 +56,13 @@
5556
/**
5657
* Admin service to manage server related operations
5758
*/
59+
@Capability(
60+
namespace = "osgi.service",
61+
attribute = {
62+
"objectClass=org.wso2.carbon.server.admin.common.IServerAdmin",
63+
"service.scope=singleton"
64+
}
65+
)
5866
public class ServerAdmin extends AbstractAdmin implements ServerAdminMBean, IServerAdmin {
5967
private static final Log log = LogFactory.getLog(ServerAdmin.class);
6068
private static final int SECONDS_PER_DAY = 3600 * 24;

core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core/common/DefaultRealm.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import org.apache.commons.logging.Log;
2121
import org.apache.commons.logging.LogFactory;
22+
import org.osgi.annotation.bundle.Capability;
2223
import org.wso2.carbon.caching.impl.CachingConstants;
2324
import org.wso2.carbon.caching.impl.Util;
2425
import org.wso2.carbon.user.api.RealmConfiguration;
@@ -51,6 +52,13 @@
5152

5253
import static org.wso2.carbon.user.core.constants.UserCoreErrorConstants.ErrorMessages.ERROR_CODE_DUPLICATE_ERROR_WHILE_ADDING_CLAIM_MAPPINGS;
5354

55+
@Capability(
56+
namespace = "osgi.service",
57+
attribute = {
58+
"objectClass=org.wso2.carbon.user.core.UserRealm",
59+
"service.scope=singleton"
60+
}
61+
)
5462
public class DefaultRealm implements UserRealm {
5563

5664
private static Log log = LogFactory.getLog(DefaultRealm.class);

0 commit comments

Comments
 (0)