本文整理汇总了Java中org.apache.axis2.description.Parameter.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java Parameter.setValue方法的具体用法?Java Parameter.setValue怎么用?Java Parameter.setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axis2.description.Parameter
的用法示例。
在下文中一共展示了Parameter.setValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: disableRESTCalls
import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
protected void disableRESTCalls(String serviceName, String scenrioId)
throws SecurityConfigException {
if (scenrioId.equals(SecurityConstants.USERNAME_TOKEN_SCENARIO_ID)) {
return;
}
try {
AxisService service = axisConfig.getServiceForActivation(serviceName);
if (service == null) {
throw new SecurityConfigException("nullService");
}
Parameter param = new Parameter();
param.setName(DISABLE_REST);
param.setValue(Boolean.TRUE.toString());
service.addParameter(param);
} catch (AxisFault e) {
log.error(e);
throw new SecurityConfigException("disablingREST", e);
}
}
示例2: 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;
}
示例3: setUp
import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
protected void setUp() throws Exception {
targetEPR =
new EndpointReference("http://127.0.0.1:"
+ (UtilServer.TESTING_PORT)
// + 8000
+ "/axis2/services/ComplexDataTypesDocLitBare");
stub = new org.tempuri.complex.ComplexDataTypesDocLitBareStub(null, targetEPR.getAddress());
String className = "org.tempuri.complex.ComplexDataTypesDocLitBare";
UtilServer.start();
Parameter generateBare = new Parameter();
generateBare.setName(Java2WSDLConstants.DOC_LIT_BARE_PARAMETER);
generateBare.setValue("true");
UtilServer.getConfigurationContext().getAxisConfiguration().addParameter(generateBare);
AxisService service = AxisService.createService(
className, UtilServer.getConfigurationContext().getAxisConfiguration());
service.addParameter(generateBare);
service.setName("ComplexDataTypesDocLitBare");
service.setClassLoader(Thread.currentThread().getContextClassLoader());
UtilServer.deployService(service);
}
示例4: testAddParameterServiceLockedAtAxisConfig
import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
public void testAddParameterServiceLockedAtAxisConfig() {
try {
Parameter para = new Parameter();
para.setValue(null);
para.setName("PARA_NAME");
para.setLocked(true);
reg.addParameter(para);
AxisService service = new AxisService("Service1");
reg.addService(service);
service.addParameter(para);
fail("This should fails with Parmter is locked can not overide");
} catch (AxisFault axisFault) {
}
}
示例5: overrideCallbackHandler
import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
public static void overrideCallbackHandler(AxisService service) throws AxisFault {
Parameter cbHandlerParam = service.getParameter(WSHandlerConstants.PW_CALLBACK_REF);
CallbackHandler handler = null;
if (cbHandlerParam != null) {
handler = (CallbackHandler) cbHandlerParam;
service.removeParameter(cbHandlerParam);
if (log.isDebugEnabled()) {
log.debug("removedParameter");
}
}
CallbackHandler cb = null;
if (handler != null) {
cb = handler;
} else {
cb = new IPPasswordCallbackHandler();
}
Parameter param = new Parameter();
param.setName(WSHandlerConstants.PW_CALLBACK_REF);
param.setValue(cb);
service.addParameter(param);
if (log.isDebugEnabled()) {
log.debug("addedParameter");
}
}
示例6: getParameter
import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
/**
* Generate a parametes object
*
* @param key
* @param value
*/
private Parameter getParameter(String key, Object value) {
Parameter myParameter = new Parameter();
myParameter.setName(key);
myParameter.setValue(value);
return myParameter;
}
示例7: serviceUpdate
import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
public void serviceUpdate(AxisEvent axisEvent, AxisService axisService) {
if(SystemFilter.isFilteredOutService(axisService.getAxisServiceGroup()) ||
axisService.isClientSide()) {
return;
}
if (axisEvent.getEventType() == AxisEvent.SERVICE_DEPLOY) {
for (Iterator iter = axisService.getOperations(); iter.hasNext();) {
AxisOperation op = (AxisOperation) iter.next();
setCountersAndProcessors(op) ;
}
// set counters for default operation in case of JAX-WS backends
// see
// see ESBJAVA-2327
if (JavaUtils.isTrueExplicitly(axisService.getParameterValue("disableOperationValidation"))){
AxisOperation defaultOp = (AxisOperation) axisService.getParameterValue("_default_mediate_operation_");
if(defaultOp != null ){
setCountersAndProcessors(defaultOp);
}
}
// Service response time processor
Parameter responseTimeProcessor = new Parameter();
responseTimeProcessor.setName(StatisticsConstants.SERVICE_RESPONSE_TIME_PROCESSOR);
responseTimeProcessor.setValue(new ResponseTimeProcessor());
try {
axisService.addParameter(responseTimeProcessor);
} catch (AxisFault axisFault) { // will not occur
}
}
}
示例8: deactivateMyRoleEndpoint
import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
public void deactivateMyRoleEndpoint(QName processID, Endpoint endpoint) {
if (log.isDebugEnabled()) {
log.debug("Deactivating my role endpoint for process: " + processID + " service: " +
endpoint.serviceName + " and port: " + endpoint.portName);
}
Integer tenantId = bpelServer.getMultiTenantProcessStore().getTenantId(processID);
BPELProcessProxy processProxy = getBPELProcessProxy(tenantId.toString(), endpoint.serviceName, endpoint
.portName);
if (processProxy != null) {
ProcessConfigurationImpl processConf =
(ProcessConfigurationImpl) processProxy.getProcessConfiguration();
if (processConf.isUndeploying()) {
AxisService service = processProxy.getAxisService();
Parameter param = service.getParameter(CarbonConstants.PRESERVE_SERVICE_HISTORY_PARAM);
param.setValue("false");
}
removeBPELProcessProxyAndAxisService(tenantId.toString(), endpoint.serviceName, endpoint.portName);
updateServiceList(
((ProcessConfigurationImpl) processProxy.getProcessConfiguration()).getTenantId(),
endpoint,
STATE.REMOVE);
serviceEprMap.remove(processProxy);
} // else this method also get called for the retired processes where there could be an
// active version of the same process type. Since there is only one service for a
// particular process type, processProxy will be null for all the endpoints except for 1.
}
示例9: setConfigContext
import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
public void setConfigContext(ConfigurationContext configContext) {
// setting ServletContext into configctx
configContext.setProperty(HTTPConstants.MC_HTTP_SERVLETCONTEXT,
config.getServletContext());
Parameter servletConfigParam = new Parameter();
servletConfigParam.setName(HTTPConstants.HTTP_SERVLETCONFIG);
servletConfigParam.setValue(config);
try {
configContext.getAxisConfiguration().addParameter(servletConfigParam);
} catch (AxisFault axisFault) {
log.error(axisFault.getMessage(), axisFault);
}
super.setConfigContext(configContext);
}
示例10: testAddParameterModuleLockedAtAxisConfig
import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
public void testAddParameterModuleLockedAtAxisConfig() {
try {
Parameter para = new Parameter();
para.setValue(null);
para.setName("PARA_NAME");
para.setLocked(true);
reg.addParameter(para);
AxisModule module = new AxisModule("Service1");
module.setParent(reg);
module.addParameter(para);
fail("This should fails with Parmter is locked can not overide");
} catch (AxisFault axisFault) {
}
}
示例11: init
import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
public void init(ConfigurationContext configContext,
AxisModule module) throws AxisFault {
AxisConfiguration axisConfig = configContext.getAxisConfiguration();
{
AtomicInteger globalRequestCounter = new AtomicInteger(0);
Parameter globalRequestCounterParam = new Parameter();
globalRequestCounterParam.setName(StatisticsConstants.GLOBAL_REQUEST_COUNTER);
globalRequestCounterParam.setValue(globalRequestCounter);
axisConfig.addParameter(globalRequestCounterParam);
}
{
AtomicInteger globalResponseCounter = new AtomicInteger(0);
Parameter globalResponseCounterParam = new Parameter();
globalResponseCounterParam.setName(StatisticsConstants.GLOBAL_RESPONSE_COUNTER);
globalResponseCounterParam.setValue(globalResponseCounter);
axisConfig.addParameter(globalResponseCounterParam);
}
{
AtomicInteger globalFaultCounter = new AtomicInteger(0);
Parameter globalFaultCounterParam = new Parameter();
globalFaultCounterParam.setName(StatisticsConstants.GLOBAL_FAULT_COUNTER);
globalFaultCounterParam.setValue(globalFaultCounter);
axisConfig.addParameter(globalFaultCounterParam);
}
{
ResponseTimeProcessor responseTimeProcessor = new ResponseTimeProcessor();
Parameter responseTimeProcessorParam = new Parameter();
responseTimeProcessorParam.setName(StatisticsConstants.RESPONSE_TIME_PROCESSOR);
responseTimeProcessorParam.setValue(responseTimeProcessor);
axisConfig.addParameter(responseTimeProcessorParam);
}
}
示例12: configure
import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
public void configure(EndpointDescription endpointDescription) {
MTOM mtomAnnoation =
(MTOM) ((EndpointDescriptionJava) endpointDescription).getAnnoFeature(MTOMFeature.ID);
AxisService service = endpointDescription.getAxisService();
//Disable MTOM
Parameter enableMTOM = new Parameter(Constants.Configuration.ENABLE_MTOM, Boolean.FALSE);
Parameter threshold = new Parameter(Constants.Configuration.MTOM_THRESHOLD, 0);
if (mtomAnnoation == null) {
throw ExceptionFactory.
makeWebServiceException(Messages.getMessage("mtomAnnotationErr"));
}
//Enable MTOM.
if (mtomAnnoation.enabled()) {
if (log.isDebugEnabled()) {
log.debug("Enabling MTOM via annotation.");
}
enableMTOM.setValue(Boolean.TRUE);
}
//Set the threshold value.
if (mtomAnnoation.threshold() > 0) {
if (log.isDebugEnabled()) {
log.debug("Setting MTOM threshold to [" + mtomAnnoation.threshold() + "].");
}
threshold.setValue(mtomAnnoation.threshold());
}
try {
service.addParameter(enableMTOM);
service.addParameter(threshold);
}
catch (Exception e) {
throw ExceptionFactory.makeWebServiceException(Messages.getMessage("mtomEnableErr"),
e);
}
}
示例13: addToAxisService
import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
private void addToAxisService() {
// Add a reference to this EndpointDescription object to the AxisService
if (axisService != null) {
Parameter parameter = new Parameter();
parameter.setName(EndpointDescription.AXIS_SERVICE_PARAMETER);
parameter.setValue(this);
try {
axisService.addParameter(parameter);
} catch (AxisFault e) {
throw ExceptionFactory.makeWebServiceException(Messages.getMessage("endpointDescriptionErr5", EndpointDescription.AXIS_SERVICE_PARAMETER), e);
}
}
}
示例14: applySecurityParameters
import org.apache.axis2.description.Parameter; //导入方法依赖的package包/类
private void applySecurityParameters(AxisService service, SecurityScenario secScenario,
Policy policy) {
try {
UserRealm userRealm = (UserRealm) PrivilegedCarbonContext.getThreadLocalCarbonContext()
.getUserRealm();
UserRegistry govRegistry = (UserRegistry) PrivilegedCarbonContext
.getThreadLocalCarbonContext().getRegistry(RegistryType.SYSTEM_GOVERNANCE);
String serviceGroupId = service.getAxisServiceGroup().getServiceGroupName();
String serviceName = service.getName();
SecurityConfigParams configParams =
SecurityConfigParamBuilder.getSecurityParams(getSecurityConfig(policy));
// Set Trust (Rahas) Parameters
if (secScenario.getModules().contains(SecurityConstants.TRUST_MODULE)) {
AxisModule trustModule = service.getAxisConfiguration()
.getModule(SecurityConstants.TRUST_MODULE);
if (log.isDebugEnabled()) {
log.debug("Enabling trust module : " + SecurityConstants.TRUST_MODULE);
}
service.disengageModule(trustModule);
service.engageModule(trustModule);
Properties cryptoProps = new Properties();
cryptoProps.setProperty(ServerCrypto.PROP_ID_PRIVATE_STORE,
configParams.getPrivateStore());
cryptoProps.setProperty(ServerCrypto.PROP_ID_DEFAULT_ALIAS,
configParams.getKeyAlias());
if (configParams.getTrustStores() != null) {
cryptoProps.setProperty(ServerCrypto.PROP_ID_TRUST_STORES,
configParams.getTrustStores());
}
service.addParameter(RahasUtil.getSCTIssuerConfigParameter(
ServerCrypto.class.getName(), cryptoProps, -1, null, true, true));
service.addParameter(RahasUtil.getTokenCancelerConfigParameter());
}
// Authorization
AuthorizationManager manager = userRealm.getAuthorizationManager();
String resourceName = serviceGroupId + "/" + serviceName;
removeAuthorization(userRealm, serviceGroupId, serviceName);
String allowRolesParameter = configParams.getAllowedRoles();
if (allowRolesParameter != null) {
if (log.isDebugEnabled()) {
log.debug("Authorizing roles " + allowRolesParameter);
}
String[] allowRoles = allowRolesParameter.split(",");
if (allowRoles != null) {
for (String role : allowRoles) {
manager.authorizeRole(role, resourceName,
UserCoreConstants.INVOKE_SERVICE_PERMISSION);
}
}
}
// Password Callback Handler
ServicePasswordCallbackHandler handler =
new ServicePasswordCallbackHandler(configParams, serviceGroupId, serviceName,
govRegistry, userRealm);
Parameter param = new Parameter();
param.setName(WSHandlerConstants.PW_CALLBACK_REF);
param.setValue(handler);
service.addParameter(param);
} catch (Throwable e) {
//TODO: Copied from 4.2.2.
//TODO: Not sure why we are catching throwable. Need to check error handling is correct
String msg = "Cannot apply security parameters";
log.error(msg, e);
}
}
示例15: 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;
}