use of org.apache.synapse.message.senders.blocking.BlockingMsgSender in project wso2-synapse by wso2.
the class ScheduledMessageProcessor method initMessageSender.
private BlockingMsgSender initMessageSender(Map<String, Object> params) {
String axis2repo = (String) params.get(ForwardingProcessorConstants.AXIS2_REPO);
String axis2Config = (String) params.get(ForwardingProcessorConstants.AXIS2_CONFIG);
sender = new BlockingMsgSender();
if (axis2repo != null) {
sender.setClientRepository(axis2repo);
}
if (axis2Config != null) {
sender.setAxis2xml(axis2Config);
}
sender.init();
return sender;
}
use of org.apache.synapse.message.senders.blocking.BlockingMsgSender in project wso2-synapse by wso2.
the class CallMediator method init.
public void init(SynapseEnvironment synapseEnvironment) {
this.synapseEnv = synapseEnvironment;
if (endpoint != null) {
endpoint.init(synapseEnvironment);
}
if (blocking) {
try {
configCtx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(clientRepository != null ? clientRepository : DEFAULT_CLIENT_REPO, axis2xml != null ? axis2xml : DEFAULT_AXIS2_XML);
blockingMsgSender = new BlockingMsgSender();
blockingMsgSender.setConfigurationContext(configCtx);
blockingMsgSender.init();
} catch (AxisFault axisFault) {
String msg = "Error while initializing the Call mediator";
log.error(msg, axisFault);
throw new SynapseException(msg, axisFault);
}
} else {
synapseEnvironment.updateCallMediatorCount(true);
}
}
use of org.apache.synapse.message.senders.blocking.BlockingMsgSender in project wso2-synapse by wso2.
the class CalloutMediator method init.
public void init(SynapseEnvironment synEnv) {
try {
configCtx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(clientRepository != null ? clientRepository : DEFAULT_CLIENT_REPO, axis2xml != null ? axis2xml : DEFAULT_AXIS2_XML);
if (serviceURL != null) {
serviceURL = changeEndPointReference(serviceURL);
}
blockingMsgSender = new BlockingMsgSender();
blockingMsgSender.setConfigurationContext(configCtx);
blockingMsgSender.init();
EndpointDefinition endpointDefinition = null;
if (serviceURL != null) {
// If Service URL is specified, it is given the highest priority
endpoint = new AddressEndpoint();
endpointDefinition = new EndpointDefinition();
endpointDefinition.setAddress(serviceURL);
((AddressEndpoint) endpoint).setDefinition(endpointDefinition);
isWrappingEndpointCreated = true;
} else if (endpoint == null && endpointKey == null) {
// Use a default endpoint in this case - i.e. the To header
endpoint = new DefaultEndpoint();
endpointDefinition = new EndpointDefinition();
((DefaultEndpoint) endpoint).setDefinition(endpointDefinition);
isWrappingEndpointCreated = true;
}
if (endpointDefinition != null && isSecurityOn()) {
endpointDefinition.setSecurityOn(true);
if (wsSecPolicyKey != null) {
endpointDefinition.setWsSecPolicyKey(wsSecPolicyKey);
} else {
if (inboundWsSecPolicyKey != null) {
endpointDefinition.setInboundWsSecPolicyKey(inboundWsSecPolicyKey);
}
if (outboundWsSecPolicyKey != null) {
endpointDefinition.setOutboundWsSecPolicyKey(outboundWsSecPolicyKey);
}
}
}
} catch (AxisFault e) {
String msg = "Error initializing callout mediator : " + e.getMessage();
log.error(msg, e);
throw new SynapseException(msg, e);
}
}
Aggregations