当前位置: 首页>>代码示例>>Java>>正文


Java PrivilegedCarbonContext.getOSGiService方法代码示例

本文整理汇总了Java中org.wso2.carbon.context.PrivilegedCarbonContext.getOSGiService方法的典型用法代码示例。如果您正苦于以下问题:Java PrivilegedCarbonContext.getOSGiService方法的具体用法?Java PrivilegedCarbonContext.getOSGiService怎么用?Java PrivilegedCarbonContext.getOSGiService使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.wso2.carbon.context.PrivilegedCarbonContext的用法示例。


在下文中一共展示了PrivilegedCarbonContext.getOSGiService方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getIntegrationClientService

import org.wso2.carbon.context.PrivilegedCarbonContext; //导入方法依赖的package包/类
public static IntegrationClientService getIntegrationClientService() {
    if (integrationClientService == null) {
        synchronized (DeviceMgtAPIUtils.class) {
            if (integrationClientService == null) {
                PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
                integrationClientService = (IntegrationClientService) ctx.getOSGiService(IntegrationClientService.class, null);
                if (integrationClientService == null) {
                    String msg = "IntegrationClientService is not initialized";
                    log.error(msg);
                    throw new IllegalStateException(msg);
                }
            }
        }
    }
    return integrationClientService;
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:17,代码来源:DeviceMgtAPIUtils.java

示例2: getUserStoreCountRetrieverService

import org.wso2.carbon.context.PrivilegedCarbonContext; //导入方法依赖的package包/类
public static UserStoreCountRetriever getUserStoreCountRetrieverService()
        throws UserStoreCounterException, UserStoreException {
    PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
    List<Object> countRetrieverFactories = ctx.getOSGiServices(AbstractCountRetrieverFactory.class, null);
    RealmService realmService = (RealmService) ctx.getOSGiService(RealmService.class, null);
    RealmConfiguration realmConfiguration = realmService.getBootstrapRealmConfiguration();
    String userStoreType;
    if(DeviceMgtAPIUtils.getUserStoreManager() instanceof JDBCUserStoreManager) {
        userStoreType = JDBCCountRetrieverFactory.JDBC;
    } else {
        userStoreType = InternalCountRetrieverFactory.INTERNAL;
    }
    AbstractCountRetrieverFactory countRetrieverFactory = null;
    for (Object countRetrieverFactoryObj : countRetrieverFactories) {
        countRetrieverFactory = (AbstractCountRetrieverFactory) countRetrieverFactoryObj;
        if (userStoreType.equals(countRetrieverFactory.getCounterType())) {
            break;
        }
    }
    if (countRetrieverFactory == null) {
        return null;
    }
    return countRetrieverFactory.buildCountRetriever(realmConfiguration);
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:25,代码来源:DeviceMgtAPIUtils.java

示例3: getAnalyticsDataAPI

import org.wso2.carbon.context.PrivilegedCarbonContext; //导入方法依赖的package包/类
/**
 * @return AnalyticthsDataAPI for the context
 */
public static AnalyticsDataAPI getAnalyticsDataAPI() {
    PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
    AnalyticsDataAPI analyticsDataAPI =
            (AnalyticsDataAPI) ctx.getOSGiService(AnalyticsDataAPI.class, null);
    if (analyticsDataAPI == null) {
        String msg = "Analytics api service has not initialized.";
        log.error(msg);
        throw new IllegalStateException(msg);
    }
    return analyticsDataAPI;
}
 
开发者ID:wso2,项目名称:product-iots,代码行数:15,代码来源:APIUtil.java

示例4: getEventPublisherService

import org.wso2.carbon.context.PrivilegedCarbonContext; //导入方法依赖的package包/类
public static EventsPublisherService getEventPublisherService() {
    PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
    EventsPublisherService eventsPublisherService =
            (EventsPublisherService) ctx.getOSGiService(EventsPublisherService.class, null);
    if (eventsPublisherService == null) {
        String msg = "Event Publisher service has not initialized.";
        log.error(msg);
        throw new IllegalStateException(msg);
    }
    return eventsPublisherService;
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:12,代码来源:DeviceMgtAPIUtils.java

示例5: getSCEPManagerService

import org.wso2.carbon.context.PrivilegedCarbonContext; //导入方法依赖的package包/类
public static SCEPManager getSCEPManagerService() {

        PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
        SCEPManager scepManagerService = (SCEPManager)
                ctx.getOSGiService(SCEPManager.class, null);

        if (scepManagerService == null) {
            String msg = "SCEPManagerImpl Management service not initialized.";
            log.error(msg);
            throw new IllegalStateException(msg);
        }

        return scepManagerService;
    }
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:15,代码来源:CertificateMgtAPIUtils.java

示例6: getRealmService

import org.wso2.carbon.context.PrivilegedCarbonContext; //导入方法依赖的package包/类
public static RealmService getRealmService() throws UserStoreException {
    RealmService realmService;
    PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
    realmService = (RealmService) ctx.getOSGiService(RealmService.class, null);
    if (realmService == null) {
        String msg = "Realm service has not initialized.";
        log.error(msg);
        throw new IllegalStateException(msg);
    }
    return realmService;
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:12,代码来源:DeviceMgtAPIUtils.java

示例7: getSearchManagerService

import org.wso2.carbon.context.PrivilegedCarbonContext; //导入方法依赖的package包/类
public static SearchManagerService getSearchManagerService() {
    PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
    SearchManagerService searchManagerService =
            (SearchManagerService) ctx.getOSGiService(SearchManagerService.class, null);
    if (searchManagerService == null) {
        throw new IllegalStateException("DeviceImpl search manager service is not initialized.");
    }
    return searchManagerService;
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:10,代码来源:DeviceMgtAPIUtils.java

示例8: getRealmService

import org.wso2.carbon.context.PrivilegedCarbonContext; //导入方法依赖的package包/类
public static RealmService getRealmService() {
    PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
    RealmService realmService =
            (RealmService) ctx.getOSGiService(RealmService.class, null);
    if (realmService == null) {
        String msg = "Device Management service has not initialized.";
        log.error(msg);
        throw new IllegalStateException(msg);
    }
    return realmService;
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:12,代码来源:APIUtil.java

示例9: getAnalyticsDataAPI

import org.wso2.carbon.context.PrivilegedCarbonContext; //导入方法依赖的package包/类
private static AnalyticsDataAPI getAnalyticsDataAPI() {
    PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
    AnalyticsDataAPI analyticsDataAPI =
            (AnalyticsDataAPI) ctx.getOSGiService(AnalyticsDataAPI.class, null);
    if (analyticsDataAPI == null) {
        String msg = "Analytics api service has not initialized.";
        log.error(msg);
        throw new IllegalStateException(msg);
    }
    return analyticsDataAPI;
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:12,代码来源:DeviceEventManagementServiceImpl.java

示例10: getUserStoreManager

import org.wso2.carbon.context.PrivilegedCarbonContext; //导入方法依赖的package包/类
public static UserStoreManager getUserStoreManager() throws UserStoreException {
    RealmService realmService;
    UserStoreManager userStoreManager;
    PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
    realmService = (RealmService) ctx.getOSGiService(RealmService.class, null);
    if (realmService == null) {
        String msg = "Realm service has not initialized.";
        log.error(msg);
        throw new IllegalStateException(msg);
    }
    int tenantId = ctx.getTenantId();
    userStoreManager = realmService.getTenantUserRealm(tenantId).getUserStoreManager();
    return userStoreManager;
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:15,代码来源:DeviceMgtAPIUtils.java

示例11: getAPIManagementProviderService

import org.wso2.carbon.context.PrivilegedCarbonContext; //导入方法依赖的package包/类
public static APIManagementProviderService getAPIManagementProviderService() {
    PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
    APIManagementProviderService apiManagementProviderService =
            (APIManagementProviderService) ctx.getOSGiService(APIManagementProviderService.class, null);
    if (apiManagementProviderService == null) {
        String msg = "API management provider service has not initialized.";
        log.error(msg);
        throw new IllegalStateException(msg);
    }
    return apiManagementProviderService;
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:12,代码来源:APIUtil.java

示例12: getAnalyticsDataAPI

import org.wso2.carbon.context.PrivilegedCarbonContext; //导入方法依赖的package包/类
public static AnalyticsDataAPI getAnalyticsDataAPI() {
    PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
    AnalyticsDataAPI analyticsDataAPI =
            (AnalyticsDataAPI) ctx.getOSGiService(AnalyticsDataAPI.class, null);
    if (analyticsDataAPI == null) {
        String msg = "Analytics api service has not initialized.";
        log.error(msg);
        throw new IllegalStateException(msg);
    }
    return analyticsDataAPI;
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:12,代码来源:DeviceMgtAPIUtils.java

示例13: getAppManagementService

import org.wso2.carbon.context.PrivilegedCarbonContext; //导入方法依赖的package包/类
public static ApplicationManagementProviderService getAppManagementService() {
    PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
    ApplicationManagementProviderService applicationManagementProviderService =
            (ApplicationManagementProviderService) ctx.getOSGiService(ApplicationManagementProviderService.class, null);
    if (applicationManagementProviderService == null) {
        throw new IllegalStateException("AuthenticationImpl management service has not initialized.");
    }
    return applicationManagementProviderService;
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:10,代码来源:DeviceMgtAPIUtils.java

示例14: getDeviceManagementService

import org.wso2.carbon.context.PrivilegedCarbonContext; //导入方法依赖的package包/类
/**
 * @return Device management service of current context
 */
public static DeviceManagementProviderService getDeviceManagementService() {
    PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
    DeviceManagementProviderService deviceManagementProviderService =
            (DeviceManagementProviderService) ctx.getOSGiService(DeviceManagementProviderService.class, null);
    if (deviceManagementProviderService == null) {
        String msg = "Device Management service has not initialized.";
        log.error(msg);
        throw new IllegalStateException(msg);
    }
    return deviceManagementProviderService;
}
 
开发者ID:wso2,项目名称:product-iots,代码行数:15,代码来源:APIUtil.java

示例15: getJWTClientManagerService

import org.wso2.carbon.context.PrivilegedCarbonContext; //导入方法依赖的package包/类
public static JWTClientManagerService getJWTClientManagerService() {
    JWTClientManagerService jwtClientManagerService;
    PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
    jwtClientManagerService = (JWTClientManagerService) ctx.getOSGiService(JWTClientManagerService.class, null);
    if (jwtClientManagerService == null) {
        String msg = "jwtClientManagerServicehas not initialized.";
        log.error(msg);
        throw new IllegalStateException(msg);
    }
    return jwtClientManagerService;
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:12,代码来源:GeoLocationProviderServiceImpl.java


注:本文中的org.wso2.carbon.context.PrivilegedCarbonContext.getOSGiService方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。