本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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.");
}
}
示例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;
}
}
示例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();
}
示例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();
}
示例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);
}
示例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());
}
示例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;
}
示例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);
}
示例12: setConfigurationContextService
import org.wso2.carbon.utils.ConfigurationContextService; //导入方法依赖的package包/类
protected void setConfigurationContextService(ConfigurationContextService contextService) {
this.configContext = contextService.getServerConfigContext();
}
示例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();
}