示例#1
0
  protected void disconnectListeners() throws MuleException {
    @SuppressWarnings("unchecked")
    List<InboundEndpoint> endpoints = getIncomingEndpoints();

    for (InboundEndpoint endpoint : endpoints) {
      MessageReceiver receiver =
          ((AbstractConnector) endpoint.getConnector()).getReceiver(this, endpoint);
      if (receiver != null) {
        try {
          receiver.disconnect();
        } catch (Exception e) {
          throw new ModelException(
              MessageFactory.createStaticMessage(
                  "Failed to disconnect listener "
                      + receiver
                      + " for endpoint "
                      + endpoint.getName()),
              e);
        }
      }
    }
  }
示例#2
0
  protected void disconnectListeners() throws MuleException {
    InboundEndpoint endpoint;
    List endpoints = getIncomingEndpoints();

    for (Iterator it = endpoints.iterator(); it.hasNext(); ) {
      endpoint = (InboundEndpoint) it.next();
      MessageReceiver receiver =
          ((AbstractConnector) endpoint.getConnector()).getReceiver(this, endpoint);
      if (receiver != null) {
        try {
          receiver.disconnect();
        } catch (Exception e) {
          throw new ModelException(
              MessageFactory.createStaticMessage(
                  "Failed to disconnect listener "
                      + receiver
                      + " for endpoint "
                      + endpoint.getName()),
              e);
        }
      }
    }
  }