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


Java ConfigurationContextService.getServerConfigContext方法代码示例

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


在下文中一共展示了ConfigurationContextService.getServerConfigContext方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例4: getConfigContext

import org.wso2.carbon.utils.ConfigurationContextService; //导入方法依赖的package包/类
protected ConfigurationContext getConfigContext() {

        // If a tenant has been set, then try to get the ConfigurationContext of that tenant
        PrivilegedCarbonContext carbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext();
        ConfigurationContextService configurationContextService =
                (ConfigurationContextService) carbonContext.getOSGiService(ConfigurationContextService.class);
        ConfigurationContext mainConfigContext = configurationContextService.getServerConfigContext();
        String domain = carbonContext.getTenantDomain();
        if (domain != null && !MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(domain)) {
            return TenantAxisUtils.getTenantConfigurationContext(domain, mainConfigContext);
        } else if (carbonContext.getTenantId() == MultitenantConstants.SUPER_TENANT_ID) {
            return mainConfigContext;
        } else {
            throw new UnsupportedOperationException("Tenant domain unidentified. " +
                    "Upstream code needs to identify & set the tenant domain & tenant ID. " +
                    " The TenantDomain SOAP header could be set by the clients or " +
                    "tenant authentication should be carried out.");
        }
    }
 
开发者ID:apache,项目名称:stratos,代码行数:20,代码来源:AbstractApi.java

示例5: getServiceHandler

import org.wso2.carbon.utils.ConfigurationContextService; //导入方法依赖的package包/类
public ODataServiceHandler getServiceHandler(String serviceKey, String tenantDomain) {
    // Load tenant configs
    if (null == this.registry.get(tenantDomain) &&
        !MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) {
        try {
            ConfigurationContextService contextService = DataServicesDSComponent.getContextService();
            ConfigurationContext configContext;
            if (null != contextService) {
                // Getting server's configContext instance
                configContext = contextService.getServerConfigContext();
                TenantAxisUtils.getTenantConfigurationContext(tenantDomain, configContext);
            } else {
                throw new ODataServiceFault("ConfigurationContext is not found.");
            }
        } catch (Exception e) {
            log.error("ConfigurationContext is not found.", e);
        }
    }
    if (this.registry.get(tenantDomain) != null) {
        return this.registry.get(tenantDomain).get(serviceKey);
    } else {
        return null;
    }
}
 
开发者ID:wso2,项目名称:carbon-data,代码行数:25,代码来源:ODataServiceRegistry.java

示例6: setConfigurationContextService

import org.wso2.carbon.utils.ConfigurationContextService; //导入方法依赖的package包/类
/**
 * @param contextService
 */
protected void setConfigurationContextService(ConfigurationContextService contextService) {
    if (log.isDebugEnabled()) {
        log.debug("ConfigurationContextService set in Identity Provider bundle");
    }
    configContext = contextService.getServerConfigContext();
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:10,代码来源:IdentityProviderServiceComponent.java

示例7: setConfigurationContextService

import org.wso2.carbon.utils.ConfigurationContextService; //导入方法依赖的package包/类
/**
 * @param contextService
 */
protected void setConfigurationContextService(ConfigurationContextService contextService) {
    if (log.isDebugEnabled()) {
        log.info("ConfigurationContextService set in Identity STS Mgt bundle");
    }
    this.configContext = contextService.getServerConfigContext();
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:10,代码来源:IdentitySTSMgtServiceComponent.java

示例8: sendAddSubscriptionClusterMessage

import org.wso2.carbon.utils.ConfigurationContextService; //导入方法依赖的package包/类
/**
    * This is to send clusterMessage to inform other nodes about subscription added to the system, so that everyone can add new one.
    * @param topicName
    * @param subsciptionID
    * @param tenantID
    * @param tenantName
    * @throws ClusteringFault
    */
public static void sendAddSubscriptionClusterMessage(String topicName,String subsciptionID, 
		int tenantID, String tenantName) throws ClusteringFault{
	ConfigurationContextService configContextService = (ConfigurationContextService) PrivilegedCarbonContext
			.getThreadLocalCarbonContext().getOSGiService(ConfigurationContextService.class);
	ConfigurationContext configContext = configContextService.getServerConfigContext();
	ClusteringAgent agent = configContext.getAxisConfiguration().getClusteringAgent();

	agent.sendMessage(new SubscriptionClusterMessage(topicName,subsciptionID,tenantID, tenantName), false);
}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:18,代码来源:SharedMemoryCacheUtil.java

示例9: setConfigurationContextService

import org.wso2.carbon.utils.ConfigurationContextService; //导入方法依赖的package包/类
/**
     * @param contextService
     */
    protected void setConfigurationContextService(ConfigurationContextService contextService) {
        if (log.isDebugEnabled()) {
            log.info("ConfigurationContextService set in Registry WS API bundle");
        }
        configContext = contextService.getServerConfigContext();
//        configContext.getAxisConfiguration().addObservers(new WSDeploymentInterceptor());
    }
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:11,代码来源:WSRegistryServiceComponent.java

示例10: getClusteringAgent

import org.wso2.carbon.utils.ConfigurationContextService; //导入方法依赖的package包/类
private ClusteringAgent getClusteringAgent() throws TaskException {
    ConfigurationContextService configCtxService = TasksDSComponent
            .getConfigurationContextService();
    if (configCtxService == null) {
        throw new TaskException("ConfigurationContextService not available "
                + "for notifying the cluster", Code.UNKNOWN);
    }
    ConfigurationContext configCtx = configCtxService.getServerConfigContext();
    ClusteringAgent agent = configCtx.getAxisConfiguration().getClusteringAgent();
    if (log.isDebugEnabled()) {
        log.debug("Clustering Agent: " + agent);
    }
    return agent;
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:15,代码来源:RemoteTaskManager.java

示例11: setConfigurationContextService

import org.wso2.carbon.utils.ConfigurationContextService; //导入方法依赖的package包/类
protected void setConfigurationContextService(ConfigurationContextService ccService) {
    ConfigurationContext serverCtx = ccService.getServerConfigContext();
    AxisConfiguration serverConfig = serverCtx.getAxisConfiguration();
    LocalTransportReceiver.CONFIG_CONTEXT = new ConfigurationContext(serverConfig);
    LocalTransportReceiver.CONFIG_CONTEXT.setServicePath("services");
    LocalTransportReceiver.CONFIG_CONTEXT.setContextRoot("local:/");

    DataHolder.getInstance().setConfigurationContextService(ccService);
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:10,代码来源:VirtualHostClusterServiceComponent.java

示例12: setConfigurationContextService

import org.wso2.carbon.utils.ConfigurationContextService; //导入方法依赖的package包/类
protected void setConfigurationContextService(ConfigurationContextService contextService) {
    this.configContext = contextService.getServerConfigContext();
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:4,代码来源:StatisticsServiceComponent.java

示例13: setConfigurationContextService

import org.wso2.carbon.utils.ConfigurationContextService; //导入方法依赖的package包/类
protected void setConfigurationContextService(ConfigurationContextService cfgCtxService) {
    if (log.isDebugEnabled()) {
        log.debug("ConfigurationContextService bound to the discovery proxy component");
    }
    cfgCtx = cfgCtxService.getServerConfigContext();
}
 
开发者ID:wso2,项目名称:carbon-governance,代码行数:7,代码来源:DiscoveryProxyComponent.java


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