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


Java ConfigurationContextService类代码示例

本文整理汇总了Java中org.wso2.carbon.utils.ConfigurationContextService的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationContextService类的具体用法?Java ConfigurationContextService怎么用?Java ConfigurationContextService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getStartedTenantWebapp

import org.wso2.carbon.utils.ConfigurationContextService; //导入依赖的package包/类
/**
 * Get the details of a deployed webapp for tenants
 *
 * @param path URI path
 * @return meta data for webapp
 */
public static WebApplication getStartedTenantWebapp(String tenantDomain, String path) {
    ConfigurationContextService contextService = IntegratorComponent.getContextService();
    ConfigurationContext configContext;
    ConfigurationContext tenantContext;
    if (null != contextService) {
        // Getting server's configContext instance
        configContext = contextService.getServerConfigContext();
        tenantContext = TenantAxisUtils.getTenantConfigurationContext(tenantDomain, configContext);
        Map<String, WebApplicationsHolder> webApplicationsHolderMap = WebAppUtils.getAllWebappHolders(tenantContext);
        WebApplication matchedWebApplication;
        for (WebApplicationsHolder webApplicationsHolder : webApplicationsHolderMap.values()) {
            for (WebApplication webApplication : webApplicationsHolder.getStartedWebapps().values()) {
                if (path.contains(webApplication.getContextName())) {
                    matchedWebApplication = webApplication;
                    return matchedWebApplication;
                }
            }
        }
    }
    return null;
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:28,代码来源:Utils.java

示例2: getTenantAxisService

import org.wso2.carbon.utils.ConfigurationContextService; //导入依赖的package包/类
/**
 * Get the details of a deployed webapp for tenants
 *
 * @param serviceURL URI path
 * @return meta data for webapp
 */
private static AxisService getTenantAxisService(String tenant, String serviceURL) throws AxisFault {
    ConfigurationContextService contextService = IntegratorComponent.getContextService();
    ConfigurationContext configContext;
    ConfigurationContext tenantContext;
    if (null != contextService) {
        // Getting server's configContext instance
        configContext = contextService.getServerConfigContext();
        String[] urlparts = serviceURL.split("/");
        //urlpart[0] is tenant domain
        tenantContext = TenantAxisUtils.getTenantConfigurationContext(tenant, configContext);
        AxisService tenantAxisService = tenantContext.getAxisConfiguration().getService(urlparts[1]);
        if (tenantAxisService == null) {
            AxisServiceGroup axisServiceGroup = tenantContext.getAxisConfiguration().getServiceGroup(urlparts[1]);
            if (axisServiceGroup != null) {
                return axisServiceGroup.getService(urlparts[2]);
            } else {
                // for dss samples
                return tenantContext.getAxisConfiguration().getService(urlparts[2]);
            }
        } else {
            return tenantAxisService;
        }
    }
    return null;
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:32,代码来源:Utils.java

示例3: getServerBaseHttpsUrl

import org.wso2.carbon.utils.ConfigurationContextService; //导入依赖的package包/类
public static String getServerBaseHttpsUrl() {
    String hostName = "localhost";
    try {
        hostName = NetworkUtils.getMgtHostName();
    } catch (Exception ignored) {
    }
    String mgtConsoleTransport = CarbonUtils.getManagementTransport();
    ConfigurationContextService configContextService =
            DeviceManagementDataHolder.getInstance().getConfigurationContextService();
    int port = CarbonUtils.getTransportPort(configContextService, mgtConsoleTransport);
    int httpsProxyPort =
            CarbonUtils.getTransportProxyPort(configContextService.getServerConfigContext(),
                    mgtConsoleTransport);
    if (httpsProxyPort > 0) {
        port = httpsProxyPort;
    }
    return "https://" + hostName + ":" + port;
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:19,代码来源:DeviceManagerUtil.java

示例4: getServerBaseHttpUrl

import org.wso2.carbon.utils.ConfigurationContextService; //导入依赖的package包/类
public static String getServerBaseHttpUrl() {
    String hostName = "localhost";
    try {
        hostName = NetworkUtils.getMgtHostName();
    } catch (Exception ignored) {
    }
    ConfigurationContextService configContextService =
            DeviceManagementDataHolder.getInstance().getConfigurationContextService();
    int port = CarbonUtils.getTransportPort(configContextService, "http");
    int httpProxyPort =
            CarbonUtils.getTransportProxyPort(configContextService.getServerConfigContext(),
                    "http");
    if (httpProxyPort > 0) {
        port = httpProxyPort;
    }
    return "http://" + hostName + ":" + port;
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:18,代码来源:DeviceManagerUtil.java

示例5: getServerUrl

import org.wso2.carbon.utils.ConfigurationContextService; //导入依赖的package包/类
private String getServerUrl() {
    // Hostname
    String hostName = "localhost";
    try {
        hostName = NetworkUtils.getMgtHostName();
    } catch (Exception ignored) {
    }
    // HTTPS port
    String mgtConsoleTransport = CarbonUtils.getManagementTransport();
    ConfigurationContextService configContextService =
            UrlPrinterDataHolder.getInstance().getConfigurationContextService();
    int port = CarbonUtils.getTransportPort(configContextService, mgtConsoleTransport);
    int httpsProxyPort =
            CarbonUtils.getTransportProxyPort(configContextService.getServerConfigContext(), mgtConsoleTransport);
    if (httpsProxyPort > 0) {
        port = httpsProxyPort;
    }
    return "https://" + hostName + ":" + port + "/devicemgt";
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:20,代码来源:URLPrinterStartupHandler.java

示例6: getFileName

import org.wso2.carbon.utils.ConfigurationContextService; //导入依赖的package包/类
private String getFileName(ConfigurationContextService configCtxService,
                           HttpServletRequest request,
                           String fileID) {
    //Trying to get the fileName from the client-configuration context
    Map fileResourcesMap =
            (Map) configCtxService.getClientConfigContext().
                    getProperty(ServerConstants.FILE_RESOURCE_MAP);
    String fileName = (String) fileResourcesMap.get(fileID);

    if (fileName == null) {
        String requestURI = request.getRequestURI();
        ConfigurationContext configContext = configCtxService.getServerConfigContext();
        fileResourcesMap = (Map) configContext.getProperty(ServerConstants.FILE_RESOURCE_MAP);
        fileName = (String) fileResourcesMap.get(fileID);
    }
    return fileName;
}
 
开发者ID:apache,项目名称:stratos,代码行数:18,代码来源:FileDownloadUtil.java

示例7: setConfigurationContextService

import org.wso2.carbon.utils.ConfigurationContextService; //导入依赖的package包/类
@Reference(
        name = "config.context.service",
        service = ConfigurationContextService.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetConfigurationContextService"
)
protected void setConfigurationContextService(ConfigurationContextService configCtxtService) {
    if (log.isDebugEnabled()) {
        log.debug("ConfigurationContextService set in EntitlementServiceComponent bundle.");
    }
    EntitlementConfigHolder.getInstance().setConfigurationContextService(configCtxtService);
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:14,代码来源:EntitlementServiceComponent.java

示例8: setConfigurationContextService

import org.wso2.carbon.utils.ConfigurationContextService; //导入依赖的package包/类
@Reference(
        name = "configuration.context.service",
        service = ConfigurationContextService.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetConfigurationContextService"
)
protected void setConfigurationContextService(ConfigurationContextService configContextService) {
    if (log.isDebugEnabled()) {
        log.debug("Setting the Configuration Context Service");
    }
    ApplicationManagementServiceComponentHolder.getInstance().setConfigContextService(configContextService);
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:14,代码来源:ApplicationManagementServiceComponent.java

示例9: setConfigurationContextService

import org.wso2.carbon.utils.ConfigurationContextService; //导入依赖的package包/类
@Reference(
        name = "config.context.service",
        service = ConfigurationContextService.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetConfigurationContextService"
)
protected void setConfigurationContextService(ConfigurationContextService configurationContextService) {
    ApplicationMgtServiceComponentHolder.getInstance().setConfigurationContextService(configurationContextService);
    if (log.isDebugEnabled()) {
        log.debug("ConfigurationContextService Instance was set.");
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:14,代码来源:ApplicationMgtUIServiceComponent.java

示例10: setConfigurationContext

import org.wso2.carbon.utils.ConfigurationContextService; //导入依赖的package包/类
@Reference(
         name = "configuration.context", 
         service = org.wso2.carbon.utils.ConfigurationContextService.class, 
         cardinality = ReferenceCardinality.MANDATORY, 
         policy = ReferencePolicy.DYNAMIC, 
         unbind = "unsetConfigurationContext")
protected void setConfigurationContext(ConfigurationContextService configurationContext) {
    this.configurationContext = configurationContext;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:10,代码来源:ThriftAuthenticationServiceComponent.java

示例11: setConfigurationContextService

import org.wso2.carbon.utils.ConfigurationContextService; //导入依赖的package包/类
@Reference(
        name = "config.context.service",
        service = ConfigurationContextService.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetConfigurationContextService"
)
protected void setConfigurationContextService(ConfigurationContextService contextService) {
    if (log.isDebugEnabled()) {
        log.debug("Setting the ConfigurationContext");
    }
    configContextService = contextService;
    SecurityServiceHolder.setConfigurationContextService(contextService);
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:15,代码来源:SecurityMgtServiceComponent.java

示例12: unsetConfigurationContextService

import org.wso2.carbon.utils.ConfigurationContextService; //导入依赖的package包/类
protected void unsetConfigurationContextService(ConfigurationContextService contextService) {
    if (log.isDebugEnabled()) {
        log.debug("Unsetting the ConfigurationContext");
    }
    this.configContextService = null;
    SecurityServiceHolder.setConfigurationContextService(contextService);
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:8,代码来源:SecurityMgtServiceComponent.java

示例13: setConfigurationContextService

import org.wso2.carbon.utils.ConfigurationContextService; //导入依赖的package包/类
@Reference(
        name = "config.context.service",
        service = ConfigurationContextService.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetConfigurationContextService"
)
protected void setConfigurationContextService(ConfigurationContextService contextService) {
    if (log.isDebugEnabled()) {
        log.info("Setting the ConfigurationContextService");
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:13,代码来源:UserStoreConfigComponent.java

示例14: setConfigurationContextService

import org.wso2.carbon.utils.ConfigurationContextService; //导入依赖的package包/类
@Reference(
         name = "org.wso2.carbon.utils.contextservice", 
         service = org.wso2.carbon.utils.ConfigurationContextService.class, 
         cardinality = ReferenceCardinality.MANDATORY, 
         policy = ReferencePolicy.DYNAMIC, 
         unbind = "unsetConfigurationContextService")
protected void setConfigurationContextService(ConfigurationContextService contextService) {
    WorkflowServiceDataHolder.getInstance().setConfigurationContextService(contextService);
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:10,代码来源:WorkflowMgtServiceComponent.java

示例15: setConfigurationContextService

import org.wso2.carbon.utils.ConfigurationContextService; //导入依赖的package包/类
protected void setConfigurationContextService(ConfigurationContextService configurationContextService) {
    if (log.isDebugEnabled()) {
        log.debug("Setting ConfigurationContextService");
    }

    DeviceTypeManagementDataHolder.getInstance().setConfigurationContextService(configurationContextService);

}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:9,代码来源:DeviceTypeManagementServiceComponent.java


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