use of org.apache.synapse.transport.http.conn.ServerConnFactory in project wso2-synapse by wso2.
the class PassThroughListeningIOReactorManager method getSharedSSLIOReactor.
private ListeningIOReactor getSharedSSLIOReactor(NHttpServerEventHandler nHttpServerEventHandler, String endpointName, int port, SSLConfiguration sslConfiguration) throws Exception {
if (!isSharedSSLIOReactorInitiated.get()) {
if (sslPassThroughListenerConfiguration != null) {
try {
synchronized (this) {
sharedSSLListeningIOReactor = createListeningIOReactor(sslPassThroughListenerConfiguration);
ServerIODispatch serverIODispatch = new MultiListenerSSLServerIODispatch(portServerHandlerMapper, nHttpServerEventHandler, serverConnectionFactoryMapper);
startIOReactor(sharedSSLListeningIOReactor, serverIODispatch, "HTTPS");
isSharedSSLIOReactorInitiated.compareAndSet(false, true);
}
} catch (IOReactorException e) {
throw new IOReactorException("Error occurred when creating shared IO Reactor for non axis2 Listener " + endpointName, e);
}
} else {
throw new Exception("Cannot start Endpoint for" + endpointName + "Axis2 SSL Transport Listeners for PassThrough transport" + " not started correctly or not created the " + "IOReactor Configuration");
}
}
ServerConnFactory serverConnFactory = SSLConnectionUtils.getServerConnectionFactory(endpointName, sslPassThroughListenerConfiguration, sslConfiguration);
if (serverConnectionFactoryMapper.get(port) != null) {
throw new Exception("Cannot create ServerConnectionFactory for " + endpointName + "in port " + port + "already registered a server connection factory ");
} else {
serverConnectionFactoryMapper.put(port, serverConnFactory);
}
return sharedSSLListeningIOReactor;
}
use of org.apache.synapse.transport.http.conn.ServerConnFactory in project wso2-synapse by wso2.
the class MultiListenerSSLServerIODispatch method createConnection.
@Override
protected DefaultNHttpServerConnection createConnection(IOSession session) {
ServerConnFactory serverConnFactory;
SocketAddress socketAddress = session.getLocalAddress();
int port = ((InetSocketAddress) socketAddress).getPort();
serverConnFactory = endpointSSLConfigHolder.get(port);
if (serverConnFactory != null) {
return serverConnFactory.createConnection(session);
} else {
log.error("Cannot find Configured Server Connection Factory for port " + port);
}
return null;
}
Aggregations