示例#1
0
  protected void doInitialise() throws InitialisationException {
    try {
      if (bpms == null) {
        bpms = createBpms();
      }
      if (bpms == null) {
        throw new ConfigurationException(
            MessageFactory.createStaticMessage(
                "The bpms property must be set for this connector."));
      }

      if (bpms instanceof Initialisable) {
        ((Initialisable) bpms).initialise();
      }

      // Set a callback so that the BPMS may generate messages within Mule.
      bpms.setMessageService(this);

      // The MuleClient is used as a global dispatcher.
      // TODO MULE-1221 It would be cleaner to use something like the dynamic:// transport
      if ((allowGlobalDispatcher == true) && (muleClient == null)) {
        muleClient = new MuleClient(muleContext);
      }
    } catch (Exception e) {
      throw new InitialisationException(e, this);
    }
  }
示例#2
0
  protected void doInitialise() throws InitialisationException {
    try {
      if (bpms == null) {
        if (bpmsClass != null) {
          logger.info("Instantiating BPMS from the default constructor for " + bpmsClass);
          bpms = (BPMS) ClassUtils.instanciateClass(bpmsClass, new Object[0]);
        } else {
          throw new ConfigurationException(
              MessageFactory.createStaticMessage(
                  "Either the bpms or bpmsClass property must be set for this connector."));
        }
      }

      // Set a callback so that the BPMS may generate messages within Mule.
      bpms.setMessageService(this);

      // The MuleClient is used as a global dispatcher.
      // TODO MULE-1221 It would be cleaner to use something like the dynamic:// transport
      if ((allowGlobalDispatcher == true) && (muleClient == null)) {
        muleClient = new MuleClient(false);
      }
    } catch (Exception e) {
      throw new InitialisationException(e, this);
    }
  }