'Closes all gateway connections. A connection will be reopened if
necessary (e.g., if a :class:`JavaMethod` is called).
:param keep_callback_server: if `True`, the callback server is not
shut down.'

def close(self, keep_callback_server=False):

    self._gateway_client.close()
    if (not keep_callback_server):
        self.shutdown_callback_server()
