本文整理汇总了Java中org.apache.axis2.description.Parameter.setParameterElement方法的典型用法代码示例。如果您正苦于以下问题:Java Parameter.setParameterElement方法的具体用法?Java Parameter.setParameterElement怎么用?Java Parameter.setParameterElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axis2.description.Parameter
的用法示例。
在下文中一共展示了Parameter.setParameterElement方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTokenCancelerConfigParameter
import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
public static Parameter getTokenCancelerConfigParameter() {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMElement paramElem = fac.createOMElement(new QName("parameter"), null);
paramElem.addAttribute(fac.createOMAttribute("name",
null,
TokenCancelerConfig.TOKEN_CANCELER_CONFIG.
getLocalPart()));
paramElem.addAttribute(fac.createOMAttribute("type",
null, Integer.toString(Parameter.OM_PARAMETER).
toString()));
fac.createOMElement(TokenCancelerConfig.TOKEN_CANCELER_CONFIG,
paramElem);
Parameter param = new Parameter();
param.setName(TokenCancelerConfig.TOKEN_CANCELER_CONFIG.getLocalPart());
param.setParameterElement(paramElem);
param.setValue(paramElem);
param.setParameterType(Parameter.OM_PARAMETER);
return param;
}
示例2: enableServiceDiscovery
import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
/**
* Enable publishing services using WS-Discovery to the specified Discovery proxy
*
* @param proxyURL URL of the target discovery proxy
* @throws Exception on error
*/
public void enableServiceDiscovery(String proxyURL) throws Exception {
AxisConfiguration axisConfig = getAxisConfig();
if (axisConfig.getParameter(DiscoveryConstants.DISCOVERY_PROXY) != null) {
return;
}
Parameter param = new Parameter(DiscoveryConstants.DISCOVERY_PROXY, proxyURL);
param.setParameterElement(AXIOMUtil.stringToOM("<parameter name=\"" +
DiscoveryConstants.DISCOVERY_PROXY + "\">" + proxyURL + "</parameter>"));
axisConfig.addParameter(param);
Util.registerServiceObserver(axisConfig);
DiscoveryMgtUtils.persistPublisherConfiguration(proxyURL, true, getConfigSystemRegistry());
}
示例3: getSCTIssuerConfigParameter
import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
public static Parameter getSCTIssuerConfigParameter(String cryptoImpl,
Properties cryptoProperties,
int keyComputation,
String proofKeyType,
boolean addRequestedAttachedRef,
boolean addRequestedUnattachedRef) throws Exception {
if (cryptoImpl == null || "".equals(cryptoImpl)) {
throw new Exception("Crypto impl missing");
}
OMFactory fac = OMAbstractFactory.getOMFactory();
OMElement paramElem = fac.createOMElement(new QName("parameter"), null);
paramElem.addAttribute(fac.createOMAttribute("name",
null,
SCTIssuerConfig.SCT_ISSUER_CONFIG.
getLocalPart()));
paramElem.addAttribute(fac.createOMAttribute("type",
null, Integer.toString(Parameter.OM_PARAMETER)));
OMElement elem = fac.createOMElement(
SCTIssuerConfig.SCT_ISSUER_CONFIG, paramElem);
OMElement cryptoPropElem = fac.createOMElement(
AbstractIssuerConfig.CRYPTO_PROPERTIES, elem);
OMElement cryptoElem = fac.createOMElement(
AbstractIssuerConfig.CRYPTO, cryptoPropElem);
cryptoElem.addAttribute(fac.createOMAttribute("provider", null,
cryptoImpl));
Enumeration keysEnum = cryptoProperties.keys();
while (keysEnum.hasMoreElements()) {
String key = (String) keysEnum.nextElement();
OMElement prop = fac.createOMElement(new QName("property"), cryptoElem);
prop.addAttribute(fac.createOMAttribute("name", null, key));
prop.setText(cryptoProperties.getProperty(key));
}
if (!(keyComputation == AbstractIssuerConfig.KeyComputation.KEY_COMP_PROVIDE_ENT ||
keyComputation == AbstractIssuerConfig.KeyComputation.KEY_COMP_USE_OWN_KEY ||
keyComputation == AbstractIssuerConfig.KeyComputation.KEY_COMP_USE_REQ_ENT)) {
keyComputation = AbstractIssuerConfig.KeyComputation.KEY_COMP_USE_OWN_KEY;
}
OMElement keyCompElem = fac.createOMElement(
AbstractIssuerConfig.KeyComputation.KEY_COMPUTATION, elem);
keyCompElem.setText(Integer.toString(keyComputation));
if (proofKeyType == null || "".equals(proofKeyType)) {
proofKeyType = TokenIssuerUtil.BINARY_SECRET;
} else if (!(TokenIssuerUtil.BINARY_SECRET.equals(proofKeyType)) ||
TokenIssuerUtil.ENCRYPTED_KEY.equals(proofKeyType)) {
throw new Exception("Invalid proof token type configuration : " + proofKeyType);
}
OMElement proofKeyTypeElem = fac.createOMElement(AbstractIssuerConfig.PROOF_KEY_TYPE, elem);
proofKeyTypeElem.setText(proofKeyType);
if (addRequestedAttachedRef) {
fac.createOMElement(AbstractIssuerConfig.ADD_REQUESTED_ATTACHED_REF, elem);
}
if (addRequestedUnattachedRef) {
fac.createOMElement(AbstractIssuerConfig.ADD_REQUESTED_UNATTACHED_REF, elem);
}
Parameter param = new Parameter();
param.setName(SCTIssuerConfig.SCT_ISSUER_CONFIG.getLocalPart());
param.setParameterType(Parameter.OM_PARAMETER);
param.setValue(paramElem);
param.setParameterElement(paramElem);
return param;
}
示例4: processParameters
import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
private void processParameters(Iterator parameters, ParameterInclude parameterInclude,
ParameterInclude parent) throws DeploymentException {
while (parameters.hasNext()) {
// this is to check whether some one has locked the parmeter at the
// top level
OMElement parameterElement = (OMElement) parameters.next();
Parameter parameter = new Parameter();
// setting parameterElement
parameter.setParameterElement(parameterElement);
// setting parameter Name
OMAttribute paramName = parameterElement.getAttribute(new QName(ATTRIBUTE_NAME));
if (paramName == null) {
throw new DeploymentException(Messages.getMessage(
DeploymentErrorMsgs.BAD_PARAMETER_ARGUMENT, parameterElement.toString()));
}
parameter.setName(paramName.getAttributeValue());
// setting parameter Value (the child element of the parameter)
OMElement paramValue = parameterElement.getFirstElement();
if (paramValue != null) {
parameter.setValue(parameterElement);
parameter.setParameterType(Parameter.OM_PARAMETER);
} else {
String paratextValue = parameterElement.getText();
parameter.setValue(paratextValue);
parameter.setParameterType(Parameter.TEXT_PARAMETER);
}
// setting locking attribute
OMAttribute paramLocked = parameterElement.getAttribute(new QName(ATTRIBUTE_LOCKED));
Parameter parentParam = null;
if (parent != null) {
parentParam = parent.getParameter(parameter.getName());
}
if (paramLocked != null) {
String lockedValue = paramLocked.getAttributeValue();
if (BOOLEAN_TRUE.equals(lockedValue)) {
// if the parameter is locked at some level parameter value
// replace by that
if ((parent != null) && parent.isParameterLocked(parameter.getName())) {
throw new DeploymentException(Messages.getMessage(
DeploymentErrorMsgs.CONFIG_NOT_FOUND, parameter.getName()));
} else {
parameter.setLocked(true);
}
} else {
parameter.setLocked(false);
}
}
try {
if (parent != null) {
if ((parentParam == null) || !parent.isParameterLocked(parameter.getName())) {
parameterInclude.addParameter(parameter);
}
} else {
parameterInclude.addParameter(parameter);
}
} catch (AxisFault axisFault) {
throw new DeploymentException(axisFault);
}
}
}
示例5: processParameters
import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
/**
* Gets the Parameter object from the OM.
*
* @param parameters <code>Parameter</code>
* @param parameterInclude <code>ParameterInclude</code>
* @param parent <code>ParameterInclude</code>
*/
protected void processParameters(Iterator parameters,
ParameterInclude parameterInclude,
ParameterInclude parent)
throws DeploymentException {
while (parameters.hasNext()) {
// this is to check whether some one has locked the parmeter at the
// top level
OMElement parameterElement = (OMElement) parameters.next();
Parameter parameter = new Parameter();
// setting parameterElement
parameter.setParameterElement(parameterElement);
// setting parameter Name
OMAttribute paramName = parameterElement.getAttribute(new QName(ATTRIBUTE_NAME));
if (paramName == null) {
throw new DeploymentException(Messages.getMessage(
DeploymentErrorMsgs.BAD_PARAMETER_ARGUMENT,
parameterElement.toString()));
}
parameter.setName(paramName.getAttributeValue());
// setting parameter Value (the child element of the parameter)
OMElement paramValue = parameterElement.getFirstElement();
if (paramValue != null) {
parameter.setValue(parameterElement);
parameter.setParameterType(Parameter.OM_PARAMETER);
} else {
String paratextValue = parameterElement.getText();
parameter.setValue(paratextValue);
parameter.setParameterType(Parameter.TEXT_PARAMETER);
}
// setting locking attribute
OMAttribute paramLocked = parameterElement.getAttribute(new QName(
ATTRIBUTE_LOCKED));
Parameter parentParam = null;
if (parent != null) {
parentParam = parent.getParameter(parameter.getName());
}
if (paramLocked != null) {
String lockedValue = paramLocked.getAttributeValue();
if (BOOLEAN_TRUE.equals(lockedValue)) {
// if the parameter is locked at some level parameter value
// replace by that
if ((parent != null)
&& parent.isParameterLocked(parameter.getName())) {
throw new DeploymentException(Messages.getMessage(
DeploymentErrorMsgs.PARAMETER_LOCKED, parameter.getName()));
} else {
parameter.setLocked(true);
}
} else {
parameter.setLocked(false);
}
}
try {
if (parent != null) {
if ((parentParam == null)
|| !parent.isParameterLocked(parameter.getName())) {
parameterInclude.addParameter(parameter);
}
} else {
parameterInclude.addParameter(parameter);
}
} catch (AxisFault axisFault) {
throw new DeploymentException(axisFault);
}
}
}