本文整理汇总了Java中org.apache.axis2.engine.AxisConfiguration.getParameterValue方法的典型用法代码示例。如果您正苦于以下问题:Java AxisConfiguration.getParameterValue方法的具体用法?Java AxisConfiguration.getParameterValue怎么用?Java AxisConfiguration.getParameterValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axis2.engine.AxisConfiguration
的用法示例。
在下文中一共展示了AxisConfiguration.getParameterValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getUserStoreManager
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
private MultipleCredentialUserStoreManager getUserStoreManager() throws UserStoreException {
if (userStoreManager == null) {
synchronized (lock) {
if (userStoreManager == null) {
// read parameter from axis2.xml
AxisConfiguration axisConfiguration =
CarbonConfigurationContextFactory.getConfigurationContext()
.getAxisConfiguration();
String multipleCredentialDomain =
(String) axisConfiguration.getParameterValue(DOMAIN_PARAMETER);
if (multipleCredentialDomain == null) {
multipleCredentialDomain = MULTIPLE_CREDENTIAL_DOMAIN_NAME;
}
UserStoreManager storeManager = realm.getUserStoreManager();
UserStoreManager second =
storeManager.getSecondaryUserStoreManager(multipleCredentialDomain);
if (second != null) {
storeManager = second;
}
if (!(storeManager instanceof MultipleCredentialUserStoreManager)) {
String msg = "User store does not support multiple credentials.";
MultipleCredentialsNotSupportedException e =
new MultipleCredentialsNotSupportedException(
msg);
log.fatal(msg, e);
throw e;
}
userStoreManager = (MultipleCredentialUserStoreManager) storeManager;
}
}
}
return userStoreManager;
}
示例2: createAttachments
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public static Attachments createAttachments(MessageContext msgContext,
InputStream inStream,
String contentTypeString,
boolean fileCacheForAttachments,
String attachmentRepoDir,
String attachmentSizeThreshold,
int contentLength) {
LifecycleManager manager = null;
try {
AxisConfiguration configuration = msgContext.getRootContext().getAxisConfiguration();
manager = (LifecycleManager)configuration
.getParameterValue(DeploymentConstants.ATTACHMENTS_LIFECYCLE_MANAGER);
if (manager == null) {
manager = new LifecycleManagerImpl();
configuration.addParameter(DeploymentConstants.ATTACHMENTS_LIFECYCLE_MANAGER,
manager);
}
} catch (Exception e) {
if (log.isDebugEnabled()) {
log.debug("Exception getting Attachments LifecycleManager", e);
}
}
return new Attachments(manager,
inStream,
contentTypeString,
fileCacheForAttachments,
attachmentRepoDir,
attachmentSizeThreshold,
contentLength);
}
示例3: testCustomSOAPRoleConfiguration
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public void testCustomSOAPRoleConfiguration() throws Exception{
String filename =
AbstractTestCase.basedir + "/test-resources/deployment/soaproleconfiguration";
AxisConfiguration axisConfig = ConfigurationContextFactory
.createConfigurationContextFromFileSystem(filename , filename + "/axis2.xml")
.getAxisConfiguration();
RolePlayer rolePlayer = (RolePlayer)axisConfig.getParameterValue(Constants.SOAP_ROLE_PLAYER_PARAMETER);
assertNotNull(rolePlayer);
assertFalse(rolePlayer.isUltimateDestination());
assertEquals(1, rolePlayer.getRoles().size());
assertEquals("http://my/custom/role", rolePlayer.getRoles().get(0));
}
示例4: doInvoke
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public InvocationResponse doInvoke(MessageContext msgContext) throws AxisFault {
SOAPHeader header = msgContext.getEnvelope().getHeader();
if(configuration == null){
AxisConfiguration conf = msgContext.getConfigurationContext().getAxisConfiguration();
rolePlayer = (RolePlayer)conf.getParameterValue(Constants.SOAP_ROLE_PLAYER_PARAMETER);
configuration = conf;
}
// check whether another handler has explicitly set which addressing namespace to expect.
Iterator iterator = null;
String namespace = (String) msgContext.getProperty(WS_ADDRESSING_VERSION);
// check whether the service is configured to use a particular version of WS-Addressing,
// e.g. via JAX-WS annotations.
if (namespace == null) {
Parameter namespaceParam = msgContext.getParameter(WS_ADDRESSING_VERSION);
namespace = Utils.getParameterValue(namespaceParam);
}
if (namespace == null) {
namespace = Final.WSA_NAMESPACE;
iterator = header.getHeadersToProcess(rolePlayer, namespace);
if (!iterator.hasNext()) {
if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
log.debug("No headers present corresponding to " + namespace);
}
namespace = Submission.WSA_NAMESPACE;
iterator = header.getHeadersToProcess(rolePlayer, namespace);
}
}
else if (Final.WSA_NAMESPACE.equals(namespace) || Submission.WSA_NAMESPACE.equals(namespace)) {
iterator = header.getHeadersToProcess(rolePlayer, namespace);
if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
log.debug("The preconfigured namespace is, , " + namespace);
}
}
else {
if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
log.debug("The specified namespace is not supported by this handler, " + namespace);
}
return InvocationResponse.CONTINUE;
}
if (iterator.hasNext()) {
if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
log.debug(namespace +
" headers present in the SOAP message. Starting to process ...");
}
//Need to set these properties here, before we extract the WS-Addressing
//information, in case we throw a fault.
msgContext.setProperty(WS_ADDRESSING_VERSION, namespace);
msgContext.setProperty(DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.FALSE);
extractAddressingInformation(msgContext, iterator, namespace);
// check for reference parameters
if (!disableRefparamExtract) {
extractToEprReferenceParameters(msgContext.getTo(), header, namespace);
}
//We should only get to this point if we haven't thrown a fault.
msgContext.setProperty(IS_ADDR_INFO_ALREADY_PROCESSED, Boolean.TRUE);
}
else {
if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
log.debug("No headers present corresponding to " + namespace);
}
}
return InvocationResponse.CONTINUE;
}
示例5: getMessageBuilder
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
/**
* Initial work for a builder selector which selects the builder for a given message format
* based on the the content type of the recieved message. content-type to builder mapping can be
* specified through the Axis2.xml.
*
* @param type content-type
* @param msgContext the active MessageContext
* @return the builder registered against the given content-type
* @throws org.apache.axis2.AxisFault
*/
public static Builder getMessageBuilder(String type, MessageContext msgContext)
throws AxisFault {
boolean useFallbackBuilder = false;
AxisConfiguration configuration =
msgContext.getConfigurationContext().getAxisConfiguration();
Parameter useFallbackParameter = configuration.getParameter(Constants.Configuration.USE_DEFAULT_FALLBACK_BUILDER);
if (useFallbackParameter != null) {
useFallbackBuilder = JavaUtils.isTrueExplicitly(useFallbackParameter.getValue(), useFallbackBuilder);
}
String cType = getContentTypeForBuilderSelection(type, msgContext);
Builder builder = configuration.getMessageBuilder(cType, useFallbackBuilder);
if (builder != null) {
// Check whether the request has a Accept header if so use that as the response
// message type.
// If thats not present,
// Setting the received content-type as the messageType to make
// sure that we respond using the received message serialization format.
Object contentNegotiation = configuration
.getParameterValue(Constants.Configuration.ENABLE_HTTP_CONTENT_NEGOTIATION);
if (JavaUtils.isTrueExplicitly(contentNegotiation)) {
Map transportHeaders =
(Map) msgContext.getProperty(MessageContext.TRANSPORT_HEADERS);
if (transportHeaders != null) {
String acceptHeader = (String) transportHeaders.get(HTTPConstants.HEADER_ACCEPT);
if (acceptHeader != null) {
int index = acceptHeader.indexOf(";");
if (index > 0) {
acceptHeader = acceptHeader.substring(0, index);
}
String[] strings = acceptHeader.split(",");
for (String string : strings) {
String accept = string.trim();
// We dont want dynamic content negotoatin to work on text.xml as its
// ambiguos as to whether the user requests SOAP 1.1 or POX response
if (!HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(accept) &&
configuration.getMessageFormatter(accept) != null) {
type = string;
break;
}
}
}
}
}
msgContext.setProperty(Constants.Configuration.MESSAGE_TYPE, type);
}
return builder;
}
示例6: getBuilderFromSelector
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
/**
* Initial work for a builder selector which selects the builder for a given message format
* based on the the content type of the recieved message. content-type to builder mapping can be
* specified through the Axis2.xml.
*
* @param type content-type
* @param msgContext the active MessageContext
* @return the builder registered against the given content-type
* @throws AxisFault
*/
public static Builder getBuilderFromSelector(String type, MessageContext msgContext)
throws AxisFault {
boolean useFallbackBuilder = false;
AxisConfiguration configuration =
msgContext.getConfigurationContext().getAxisConfiguration();
Parameter useFallbackParameter = configuration.getParameter(Constants.Configuration.USE_DEFAULT_FALLBACK_BUILDER);
if (useFallbackParameter !=null){
useFallbackBuilder = JavaUtils.isTrueExplicitly(useFallbackParameter.getValue(),useFallbackBuilder);
}
Builder builder = configuration.getMessageBuilder(type,useFallbackBuilder);
if (builder != null) {
// Check whether the request has a Accept header if so use that as the response
// message type.
// If thats not present,
// Setting the received content-type as the messageType to make
// sure that we respond using the received message serialization format.
Object contentNegotiation = configuration
.getParameterValue(Constants.Configuration.ENABLE_HTTP_CONTENT_NEGOTIATION);
if (JavaUtils.isTrueExplicitly(contentNegotiation)) {
Map transportHeaders =
(Map)msgContext.getProperty(MessageContext.TRANSPORT_HEADERS);
if (transportHeaders != null) {
String acceptHeader = (String)transportHeaders.get(HTTPConstants.HEADER_ACCEPT);
if (acceptHeader != null) {
int index = acceptHeader.indexOf(";");
if (index > 0) {
acceptHeader = acceptHeader.substring(0, index);
}
String[] strings = acceptHeader.split(",");
for (String string : strings) {
String accept = string.trim();
// We dont want dynamic content negotoatin to work on text.xml as its
// ambiguos as to whether the user requests SOAP 1.1 or POX response
if (!HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(accept) &&
configuration.getMessageFormatter(accept) != null) {
type = string;
break;
}
}
}
}
}
msgContext.setProperty(Constants.Configuration.MESSAGE_TYPE, type);
}
return builder;
}