use of org.teiid.net.socket.ObjectChannel in project teiid by teiid.
the class EmbeddedServer method startTransport.
private SocketListener startTransport(SocketConfiguration socketConfig, BufferManager bm, int maxODBCLobSize) {
InetSocketAddress address = null;
try {
address = new InetSocketAddress(socketConfig.getResolvedHostAddress(), socketConfig.getPortNumber());
} catch (UnknownHostException e) {
throw new TeiidRuntimeException(RuntimePlugin.Event.TEIID40065, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40065));
}
if (socketConfig.getProtocol() == WireProtocol.teiid) {
return new SocketListener(address, socketConfig, this.services, bm) {
@Override
public ChannelListener createChannelListener(ObjectChannel channel) {
// TODO: this is a little dirty, but allows us to inject the appropriate connection profile
SocketClientInstance instance = (SocketClientInstance) super.createChannelListener(channel);
instance.getWorkContext().setConnectionProfile(embeddedProfile);
return instance;
}
};
} else if (socketConfig.getProtocol() == WireProtocol.pg) {
ODBCSocketListener odbc = new ODBCSocketListener(address, socketConfig, this.services, bm, maxODBCLobSize, this.logon, driver);
return odbc;
}
// $NON-NLS-1$
throw new AssertionError("Unknown protocol " + socketConfig.getProtocol());
}
Aggregations