本文整理汇总了Java中org.apache.axis2.description.AxisServiceGroup.addParameter方法的典型用法代码示例。如果您正苦于以下问题:Java AxisServiceGroup.addParameter方法的具体用法?Java AxisServiceGroup.addParameter怎么用?Java AxisServiceGroup.addParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axis2.description.AxisServiceGroup
的用法示例。
在下文中一共展示了AxisServiceGroup.addParameter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createServiceGroupForService
import org.apache.axis2.description.AxisServiceGroup; //导入方法依赖的package包/类
private AxisServiceGroup createServiceGroupForService(AxisService svc) throws AxisFault {
AxisServiceGroup svcGroup = new AxisServiceGroup();
svcGroup.setServiceGroupName(svc.getName());
svcGroup.addService(svc);
svcGroup.addParameter(new Parameter(CarbonConstants.PRESERVE_SERVICE_HISTORY_PARAM, "true"));
return svcGroup;
}
示例2: createServiceGroupForService
import org.apache.axis2.description.AxisServiceGroup; //导入方法依赖的package包/类
private AxisServiceGroup createServiceGroupForService(AxisService svc) throws AxisFault {
AxisServiceGroup svcGroup = new AxisServiceGroup();
svcGroup.setServiceGroupName(svc.getName());
svcGroup.addService(svc);
// Checking configured using files param is not a good solution. We must figure out a way to handle this
// at Carbon persistence manager layer.
if (svc.getParameter(CarbonConstants.PRESERVE_SERVICE_HISTORY_PARAM) != null &&
svc.getParameter(BusinessProcessConstants.CONFIGURED_USING_BPEL_PKG_CONFIG_FILES) == null) {
svcGroup.addParameter(new Parameter(CarbonConstants.PRESERVE_SERVICE_HISTORY_PARAM, "true"));
}
return svcGroup;
}
示例3: editRuleService
import org.apache.axis2.description.AxisServiceGroup; //导入方法依赖的package包/类
/**
* Updates an existing service
*
* @param fileExtension rule service file extension
* @param name name of the service to be updated
* @param ruleServiceXML eta data required to update the rule service
* @throws RuleServiceAdminException for any errors during service edit operation
*/
public void editRuleService(String fileExtension,
String name,
OMElement ruleServiceXML) throws RuleServiceAdminException {
validateName(name);
validateElement(ruleServiceXML);
try {
RuleService ruleService = RuleServiceHelper.getRuleService(ruleServiceXML);
validateRuleServiceDescription(ruleService, ruleServiceXML);
AxisConfiguration axisConfig = getAxisConfig();
AxisService axisService = axisConfig.getService(name);
if (axisService == null) {
// if there is no one add a new rule service
addRuleService(fileExtension, name, ruleServiceXML);
return;
}
// set the KEEP_SERVICE_HISTORY_PARAM to true in AxisService
axisService.addParameter(CarbonConstants.KEEP_SERVICE_HISTORY_PARAM, "true");
// set the KEEP_SERVICE_HISTORY_PARAM and PRESERVE_SERVICE_HISTORY_PARAM to
// true in AxisServiceGroup
AxisServiceGroup axisServiceGroup = axisService.getAxisServiceGroup();
axisServiceGroup.addParameter(CarbonConstants.KEEP_SERVICE_HISTORY_PARAM, "true");
axisServiceGroup.addParameter(CarbonConstants.PRESERVE_SERVICE_HISTORY_PARAM, "true");
RuleServiceAdminHandler adminHandler = getRuleServiceAdminHandler(fileExtension);
adminHandler.saveRuleService(getAxisConfig(), axisService, ruleService);
} catch (AxisFault axisFault) {
throw new RuleServiceAdminException("Error while accessing " +
"the service with the name : " + name, axisFault);
} catch (RuleConfigurationException e) {
throw new RuleServiceAdminException("Error when parsing the rule xml");
}
}
示例4: saveDataService
import org.apache.axis2.description.AxisServiceGroup; //导入方法依赖的package包/类
/**
* Saves the data service in service repository.
* @param serviceName The name of the data service to be saved
* @param serviceHierarchy The hierarchical path of the service
* @param serviceContents The content of the service
* @throws AxisFault
*/
public void saveDataService(String serviceName, String serviceHierarchy,
String serviceContents) throws AxisFault {
String dataServiceFilePath;
ConfigurationContext configCtx = this.getConfigContext();
AxisConfiguration axisConfig = configCtx.getAxisConfiguration();
AxisService axisService = DBUtils.getActiveAxisServiceAccordingToDataServiceGroup(axisConfig, serviceName);
// This is a workaround to fix DS-1075. The proper fix should be in kernel but it could break
// existing functionality
if (serviceName.contains("/")) {
String[] splitArray = serviceName.split("\\/");
if (splitArray.length >= 1) {
String fullServiceName = serviceName;
serviceName = splitArray[splitArray.length - 1];
serviceHierarchy = splitArray[splitArray.length - 2];
serviceContents = serviceContents.replace(fullServiceName,serviceName);
}
}
if (serviceHierarchy == null) {
serviceHierarchy = "";
}
if (axisService == null) {
/* new service */
String axis2RepoDirectory = axisConfig.getRepository().getPath();
String repoDirectory = (String) configCtx.getProperty(DBConstants.DB_SERVICE_REPO);
String fileExtension = this.getDataServiceFileExtension();
String dataServiceDirectory = axis2RepoDirectory + File.separator + repoDirectory
+ File.separator + serviceHierarchy;
dataServiceFilePath = dataServiceDirectory + File.separator + serviceName + "."
+ fileExtension;
/* create the directory, if it does not exist */
/*
Security Comment :
This dataServiceDirectory path is trustworthy, constructed dataServiceDirectory path cannot be access by the user.
*/
File directory = new File(dataServiceDirectory);
if (!directory.exists() && !directory.mkdirs()) {
throw new AxisFault("Cannot create directory: " + directory.getAbsolutePath());
}
} else {
dataServiceFilePath = ((DataService) axisService.getParameter(
DBConstants.DATA_SERVICE_OBJECT).getValue()).getDsLocation();
AxisServiceGroup axisServiceGroup = axisService.getAxisServiceGroup();
axisServiceGroup.addParameter(CarbonConstants.KEEP_SERVICE_HISTORY_PARAM, Boolean.TRUE.toString());
axisServiceGroup.addParameter(CarbonConstants.PRESERVE_SERVICE_HISTORY_PARAM, Boolean.TRUE.toString());
axisService.addParameter(CarbonConstants.KEEP_SERVICE_HISTORY_PARAM, Boolean.TRUE.toString());
axisService.addParameter(CarbonConstants.PRESERVE_SERVICE_HISTORY_PARAM, Boolean.TRUE.toString());
}
serviceContents = DBUtils.prettifyXML(serviceContents);
/* save contents to .dbs file */
try {
/*
Security Comment :
This path is trustworthy, constructed file path cannot be access by the user.
*/
BufferedWriter out = new BufferedWriter(new FileWriter(dataServiceFilePath));
out.write(serviceContents);
out.close();
} catch (IOException e) {
log.error("Error while saving " + serviceName, e);
throw new AxisFault(
"Error occurred while writing the contents for the service config file for the new service "
+ serviceName, e);
}
}