本文整理汇总了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;
}
示例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: 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;
}
示例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;
}
示例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";
}
示例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;
}
示例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);
}
示例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);
}
示例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.");
}
}
示例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;
}
示例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);
}
示例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);
}
示例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");
}
}
示例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);
}
示例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);
}