Пример #1
0
  protected void connectListeners() throws MuleException {
    @SuppressWarnings("unchecked")
    List<InboundEndpoint> endpoints = getIncomingEndpoints();

    for (InboundEndpoint endpoint : endpoints) {
      AbstractConnector connector = (AbstractConnector) endpoint.getConnector();
      MessageReceiver receiver = connector.getReceiver(this, endpoint);
      if (receiver != null && connector.isConnected()) {
        try {
          receiver.connect();
        } catch (Exception e) {
          throw new ModelException(
              MessageFactory.createStaticMessage(
                  "Failed to connect listener " + receiver + " for endpoint " + endpoint.getName()),
              e);
        }
      }
    }
  }
Пример #2
0
  protected void connectListeners() throws MuleException {
    InboundEndpoint endpoint;
    List endpoints = getIncomingEndpoints();

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