本文整理汇总了Java中org.apache.axis2.context.MessageContext.getConfigurationContext方法的典型用法代码示例。如果您正苦于以下问题:Java MessageContext.getConfigurationContext方法的具体用法?Java MessageContext.getConfigurationContext怎么用?Java MessageContext.getConfigurationContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axis2.context.MessageContext
的用法示例。
在下文中一共展示了MessageContext.getConfigurationContext方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findOperation
import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
public AxisOperation findOperation(AxisService service, MessageContext messageContext)
throws AxisFault {
RelatesTo relatesTo = messageContext.getRelatesTo();
if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
log.debug(messageContext.getLogIDString() +
" Checking for OperationContext using RelatesTo : " + relatesTo);
}
if ((relatesTo != null) && (relatesTo.getValue() != null)) {
ConfigurationContext configurationContext = messageContext.getConfigurationContext();
OperationContext operationContext =
configurationContext.getOperationContext(relatesTo.getValue());
if (operationContext != null) {
if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
log.debug(messageContext.getLogIDString() + " Found OperationContext: " +
operationContext);
}
return operationContext.getAxisOperation();
}
}
return null;
}
示例2: findService
import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
public AxisService findService(MessageContext messageContext) throws AxisFault {
RelatesTo relatesTo = messageContext.getRelatesTo();
if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
log.debug(messageContext.getLogIDString() +
" Checking for OperationContext using RelatesTo : " + relatesTo);
}
if ((relatesTo != null) && (relatesTo.getValue() != null)) {
ConfigurationContext configurationContext = messageContext.getConfigurationContext();
OperationContext operationContext =
configurationContext.getOperationContext(relatesTo.getValue());
if (operationContext != null) {
if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
log.debug(messageContext.getLogIDString() + " Found OperationContext: " +
operationContext);
}
return operationContext.getServiceContext().getAxisService();
}
}
return null;
}
示例3: createAndFillContexts
import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
private void createAndFillContexts(AxisService service,
MessageContext msgContext,
SessionContext sessionContext) throws AxisFault {
ServiceGroupContext serviceGroupContext;
AxisServiceGroup axisServiceGroup = service.getAxisServiceGroup();
ConfigurationContext configCtx = msgContext.getConfigurationContext();
serviceGroupContext = configCtx.createServiceGroupContext(axisServiceGroup);
msgContext.setServiceGroupContext(serviceGroupContext);
ServiceContext serviceContext = serviceGroupContext.getServiceContext(service);
msgContext.setServiceContext(serviceContext);
if (sessionContext != null) {
sessionContext.addServiceContext(serviceContext);
sessionContext.addServiceGroupContext(serviceGroupContext);
}
}
示例4: waitForReply
import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
private void waitForReply(MessageContext msgContext, String mailMessageID) throws AxisFault {
// piggy back message constant is used to pass a piggy back
// message context in asnych model
if (!(msgContext.getAxisOperation() instanceof OutInAxisOperation) &&
(msgContext.getProperty(org.apache.axis2.Constants.PIGGYBACK_MESSAGE) == null)) {
return;
}
ConfigurationContext configContext = msgContext.getConfigurationContext();
// if the mail message listner has not started we need to start it
if (!configContext.getListenerManager().isListenerRunning(MailConstants.TRANSPORT_NAME)) {
TransportInDescription mailTo =
configContext.getAxisConfiguration().getTransportIn(MailConstants.TRANSPORT_NAME);
if (mailTo == null) {
handleException("Could not find the transport receiver for " +
MailConstants.TRANSPORT_NAME);
}
configContext.getListenerManager().addListener(mailTo, false);
}
SynchronousCallback synchronousCallback = new SynchronousCallback(msgContext);
Map callBackMap = (Map) msgContext.getConfigurationContext().
getProperty(BaseConstants.CALLBACK_TABLE);
callBackMap.put(mailMessageID, synchronousCallback);
synchronized (synchronousCallback) {
try {
synchronousCallback.wait(msgContext.getOptions().getTimeOutInMilliSeconds());
} catch (InterruptedException e) {
handleException("Error occured while waiting ..", e);
}
}
if (!synchronousCallback.isComplete()){
// when timeout occurs remove this entry.
callBackMap.remove(mailMessageID);
handleException("Timeout while waiting for a response");
}
}
示例5: processMessage
import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
public void processMessage(MessageContext inMessageContext,
InputStream in,
OutputStream response) throws AxisFault {
if (this.confContext == null) {
this.confContext = inMessageContext.getConfigurationContext();
}
this.inMessageContext = inMessageContext;
EndpointReference to = inMessageContext.getTo();
String action = inMessageContext.getOptions().getAction();
processMessage(in, to, action, response);
}
示例6: findService
import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
public AxisService findService(MessageContext messageContext) throws AxisFault {
String serviceName;
String localPart = messageContext.getEnvelope().getSOAPBodyFirstElementLocalName();
if (localPart != null) {
OMNamespace ns = messageContext.getEnvelope().getSOAPBodyFirstElementNS();
if (ns != null) {
String filePart = ns.getNamespaceURI();
if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
log.debug(messageContext.getLogIDString() +
" Checking for Service using SOAP message body's first child's namespace : "
+ filePart);
}
ConfigurationContext configurationContext =
messageContext.getConfigurationContext();
String[] values = Utils.parseRequestURLForServiceAndOperation(filePart,
configurationContext.getServiceContextPath());
if (values[0] != null) {
serviceName = values[0];
AxisConfiguration registry =
configurationContext.getAxisConfiguration();
return registry.getService(serviceName);
}
}
}
return null;
}
示例7: replicate
import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
/**
* Replicates all serializable properties in the ConfigurationContext, ServiceGroupContext &
* ServiceContext
*
* @param msgContext The MessageContext associated with the ServiceContext,
* ServiceGroupContext and ConfigurationContext to be replicated
* @throws ClusteringFault If replication fails
*/
public static void replicate(MessageContext msgContext) throws ClusteringFault {
if (!canReplicate(msgContext)) {
return;
}
log.debug("Going to replicate state stored in ConfigurationContext," +
" ServiceGroupContext, ServiceContext associated with " + msgContext + "...");
ConfigurationContext configurationContext = msgContext.getConfigurationContext();
StateManager stateManager = getStateManager(msgContext);
if (stateManager == null) {
return;
}
List<AbstractContext> contexts = new ArrayList<AbstractContext>();
// Do we need to replicate state stored in ConfigurationContext?
if (!configurationContext.getPropertyDifferences().isEmpty()) {
contexts.add(configurationContext);
}
// Do we need to replicate state stored in ServiceGroupContext?
ServiceGroupContext sgContext = msgContext.getServiceGroupContext();
if (sgContext != null && !sgContext.getPropertyDifferences().isEmpty()) {
contexts.add(sgContext);
}
// Do we need to replicate state stored in ServiceContext?
ServiceContext serviceContext = msgContext.getServiceContext();
if (serviceContext != null && !serviceContext.getPropertyDifferences().isEmpty()) {
contexts.add(serviceContext);
}
// Do the actual replication here
if (!contexts.isEmpty()) {
AbstractContext[] contextArray = contexts.toArray(new AbstractContext[contexts.size()]);
stateManager.updateContexts(contextArray);
}
}
示例8: findForExistingOperationContext
import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
/**
* Returns as existing OperationContext related to this message if one exists.
* <p/>
* TODO - why both this and findOperationContext()? (GD)
*
* @param msgContext the MessageContext for which we'd like an OperationContext
* @return the OperationContext, or null
* @throws AxisFault
*/
public OperationContext findForExistingOperationContext(MessageContext msgContext)
throws AxisFault {
OperationContext operationContext;
if ((operationContext = msgContext.getOperationContext()) != null) {
return operationContext;
}
// If this message is not related to another one, or it is but not one emitted
// from the same operation, don't further look for an operation context or fault.
if (null != msgContext.getRelatesTo()) {
// So this message may be part of an ongoing MEP
ConfigurationContext configContext = msgContext.getConfigurationContext();
operationContext =
configContext.getOperationContext(msgContext.getRelatesTo().getValue());
if (null == operationContext && log.isDebugEnabled()) {
log.debug(msgContext.getLogIDString() +
" Cannot correlate inbound message RelatesTo value [" +
msgContext.getRelatesTo() + "] to in-progree MEP");
}
}
return operationContext;
}
示例9: findOperationContext
import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
/**
* Finds an OperationContext for an incoming message. An incoming message can be of two states.
* <p/>
* 1)This is a new incoming message of a given MEP. 2)This message is a part of an MEP which has
* already begun.
* <p/>
* The method is special cased for the two MEPs
* <p/>
* #IN_ONLY #IN_OUT
* <p/>
* for two reasons. First reason is the wide usage and the second being that the need for the
* MEPContext to be saved for further incoming messages.
* <p/>
* In the event that MEP of this operation is different from the two MEPs defaulted above the
* decision of creating a new or this message relates to a MEP which already in business is
* decided by looking at the WSA Relates TO of the incoming message.
*
* @param msgContext MessageContext to search
* @param serviceContext ServiceContext (TODO - why pass this? (GD))
* @return the active OperationContext
*/
public OperationContext findOperationContext(MessageContext msgContext,
ServiceContext serviceContext)
throws AxisFault {
OperationContext operationContext;
if (null == msgContext.getRelatesTo()) {
// Its a new incoming message so get the factory to create a new
// one
operationContext = serviceContext.createOperationContext(this);
} else {
// So this message is part of an ongoing MEP
ConfigurationContext configContext = msgContext.getConfigurationContext();
operationContext =
configContext.getOperationContext(msgContext.getRelatesTo().getValue());
if (null == operationContext) {
throw new AxisFault(Messages.getMessage("cannotCorrelateMsg",
this.name.toString(),
msgContext.getRelatesTo().getValue()));
}
}
return operationContext;
}
示例10: setupCorrectTransportOut
import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
/**
* Ensure that if the scheme of the To EPR for the response is different than the
* transport used for the request that the correct TransportOut is available
*/
private static void setupCorrectTransportOut(MessageContext context) throws AxisFault {
// Determine that we have the correct transport available.
TransportOutDescription transportOut = context.getTransportOut();
try {
EndpointReference responseEPR = context.getTo();
if (context.isServerSide() && responseEPR != null) {
if (!responseEPR.hasAnonymousAddress() && !responseEPR.hasNoneAddress()) {
URI uri = new URI(responseEPR.getAddress());
String scheme = uri.getScheme();
if ((transportOut == null) || !transportOut.getName().equals(scheme)) {
ConfigurationContext configurationContext =
context.getConfigurationContext();
transportOut = configurationContext.getAxisConfiguration()
.getTransportOut(scheme);
if (transportOut == null) {
throw new AxisFault("Can not find the transport sender : " + scheme);
}
context.setTransportOut(transportOut);
}
if (context.getOperationContext() != null) {
context.getOperationContext().setProperty(
Constants.DIFFERENT_EPR, Constants.VALUE_TRUE);
}
}
}
} catch (URISyntaxException urise) {
throw AxisFault.makeFault(urise);
}
}
示例11: invoke
import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
AxisService axisService = msgContext.getAxisService();
if (axisService == null || axisService.isClientSide()) {
return InvocationResponse.CONTINUE;
}
// Do not trace messages from admin services
if (axisService.getParent() != null) {
if (SystemFilter.isFilteredOutService(axisService.getAxisServiceGroup())) {
return InvocationResponse.CONTINUE;
}
}
ConfigurationContext configCtx = msgContext.getConfigurationContext();
TraceFilter traceFilter =
(TraceFilter) configCtx.getAxisConfiguration().
getParameter(TracerConstants.TRACE_FILTER_IMPL).getValue();
if (traceFilter.isFilteredOut(msgContext)) {
return InvocationResponse.CONTINUE;
}
if ((msgContext.getAxisOperation() != null) &&
(msgContext.getAxisOperation().getName() != null)) {
String operationName =
msgContext.getAxisOperation().getName().getLocalPart();
String serviceName = axisService.getName();
// Add the message id to the CircularBuffer.
// We need to track only the IN_FLOW msg, since with that sequence number,
// we can retrieve all other related messages from the persister.
appendMessage(msgContext.getConfigurationContext(),
serviceName, operationName,
storeMessage(serviceName, operationName, msgContext));
}
return InvocationResponse.CONTINUE;
}
示例12: Worker
import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
public Worker(MessageContext msgContext) {
this.msgContext = msgContext;
this.configurationContext = msgContext.getConfigurationContext();
}
示例13: loadThrottle
import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
/**
* Loads a throttle metadata for a particular throttle type
*
* @param messageContext - The messageContext
* @param throttleType - The type of throttle
* @return IPBaseThrottleConfiguration - The IPBaseThrottleConfiguration - load from AxisConfiguration
* @throws ThrottleException Throws if the throttle type is unsupported
*/
public Throttle loadThrottle(MessageContext messageContext,
int throttleType) throws ThrottleException {
Throttle throttle = null;
ConfigurationContext configContext = messageContext.getConfigurationContext();
//the Parameter which hold throttle ipbase object
// to get throttles map from the configuration context
Map throttles = (Map) configContext.getPropertyNonReplicable(ThrottleConstants.THROTTLES_MAP);
if (throttles == null) {
if (debugOn) {
log.debug("Couldn't find throttles object map .. thottlling will not be occurred ");
}
return null;
}
switch (throttleType) {
case ThrottleConstants.GLOBAL_THROTTLE: {
throttle =
(Throttle) throttles.get(ThrottleConstants.GLOBAL_THROTTLE_KEY);
break;
}
case ThrottleConstants.OPERATION_BASED_THROTTLE: {
AxisOperation axisOperation = messageContext.getAxisOperation();
if (axisOperation != null) {
QName opName = axisOperation.getName();
if (opName != null) {
AxisService service = (AxisService) axisOperation.getParent();
if (service != null) {
String currentServiceName = service.getName();
if (currentServiceName != null) {
throttle =
(Throttle) throttles.get(currentServiceName +
opName.getLocalPart());
}
}
}
} else {
if (debugOn) {
log.debug("Couldn't find axis operation ");
}
return null;
}
break;
}
case ThrottleConstants.SERVICE_BASED_THROTTLE: {
AxisService axisService = messageContext.getAxisService();
if (axisService != null) {
throttle =
(Throttle) throttles.get(axisService.getName());
} else {
if (debugOn) {
log.debug("Couldn't find axis service ");
}
return null;
}
break;
}
default: {
throw new ThrottleException("Unsupported Throttle type");
}
}
return throttle;
}