示例#1
0
  public final void start() throws MuleException {
    if (!connected.get()) {
      startOnConnect = true;

      // Make sure we are connected
      try {
        connect();
      } catch (Exception e) {
        throw new LifecycleException(e, this);
      }
      return;
    }

    if (stopped.compareAndSet(true, false)) {
      doStart();
    }
  }
示例#2
0
  public final void stop() {
    try {
      if (connected.get()) {
        disconnect();
      }
    } catch (Exception e) {
      // TODO MULE-863: What should we really do?
      logger.error(e.getMessage(), e);
    }

    if (stopped.compareAndSet(false, true)) {
      try {
        doStop();
      } catch (MuleException e) {
        // TODO MULE-863: What should we really do?
        logger.error(e.getMessage(), e);
      }
    }
  }