public void setConnectionFactory(ConnectionFactory connectionFactory) {
this.connectionFactory = connectionFactory;
}
protected Connector getConnector() {
return Factory.createConnector(new ConnectionBuilder() {
public Connection createConnection() throws IOException {
return (connectionFactory == null) ?
new ConnectionFactory().newConnection() : connectionFactory.newConnection();
}
});