Beispiel #1
0
  /**
   * Returns the current stream connection that is opened.
   *
   * @return a stream connection, can be a cached one, never <code>null</code>.
   * @throws IOException in case of I/O problems creating the stream connection.
   */
  private StreamConnection getStreamConnection() throws IOException {
    if (this.connection == null) {
      final String uri = this.config.getConnectionURI();

      if (LOG.isLoggable(Level.INFO)) {
        LOG.info("Connecting to " + uri);
      }

      this.connection = createStreamConnection(uri);
    }
    return this.connection;
  }