示例#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);
    }
  }
 @Override
 protected void doSetUp() throws Exception {
   super.doSetUp();
   queueProfile = QueueProfile.newInstancePersistingToDefaultMemoryQueueStore(muleContext);
   queueStatistics = new TestQueueStatistics();
   queueTimeout = muleContext.getConfiguration().getDefaultQueueTimeout();
   lifeCycleState = new TestLifeCycleState();
   super.doSetUp();
   ((Initialisable) messageProcessor).initialise();
   ((Startable) messageProcessor).start();
   lifeCycleState.start();
 }