use of org.apache.axis2.transport.CustomAxisConfigurator in project wso2-axis2-transports by wso2.
the class AxisTestClientContext method setUp.
@Setup
@SuppressWarnings("unused")
private void setUp(TransportDescriptionFactory tdf, AxisTestClientContextConfigurator[] configurators) throws Exception {
cfgCtx = ConfigurationContextFactory.createConfigurationContext(new CustomAxisConfigurator());
AxisConfiguration axisCfg = cfgCtx.getAxisConfiguration();
TransportOutDescription trpOutDesc = tdf.createTransportOutDescription();
axisCfg.addTransportOut(trpOutDesc);
sender = trpOutDesc.getSender();
sender.init(cfgCtx, trpOutDesc);
boolean useListener = false;
for (AxisTestClientContextConfigurator configurator : configurators) {
if (configurator.isTransportListenerRequired()) {
useListener = true;
break;
}
}
TransportInDescription trpInDesc;
if (useListener) {
trpInDesc = tdf.createTransportInDescription();
} else {
trpInDesc = null;
}
for (AxisTestClientContextConfigurator configurator : configurators) {
configurator.setupTransport(trpInDesc, trpOutDesc);
}
if (useListener) {
listenerManager = new ListenerManager();
listenerManager.init(cfgCtx);
cfgCtx.setTransportManager(listenerManager);
listenerManager.addListener(trpInDesc, false);
listenerManager.start();
}
}
use of org.apache.axis2.transport.CustomAxisConfigurator in project wso2-axis2-transports by wso2.
the class UDPTest method getClientCfgCtx.
public ConfigurationContext getClientCfgCtx() throws Exception {
ConfigurationContext cfgCtx = ConfigurationContextFactory.createConfigurationContext(new CustomAxisConfigurator());
AxisConfiguration axisCfg = cfgCtx.getAxisConfiguration();
axisCfg.engageModule("addressing");
TransportInDescription trpInDesc = new TransportInDescription("udp");
trpInDesc.setReceiver(new UDPListener());
axisCfg.addTransportIn(trpInDesc);
TransportOutDescription trpOutDesc = new TransportOutDescription("udp");
trpOutDesc.setSender(new UDPSender());
axisCfg.addTransportOut(trpOutDesc);
return cfgCtx;
}
Aggregations