Ejemplo n.º 1
0
  /**
   * Configures a started manager. This method will throw InitialisationException if the current
   * manager is already started
   *
   * @param synchronous whether to start the manager in synchronous mode
   * @param serverUrl the url used to receive client requests, or null if the server listening
   *     components should not be set up
   * @return the configured manager
   * @throws UMOException if the manager is already started or it fails to start
   */
  public UMOManager createStartedManager(boolean synchronous, String serverUrl, String modeltype)
      throws UMOException {
    if (manager.isStarted()) {
      throw new InitialisationException(new Message(Messages.MANAGER_ALREADY_STARTED), this);
    }
    if (serverUrl == null) {
      serverUrl = "";
    }
    MuleManager.getConfiguration().setServerUrl(serverUrl);
    MuleManager.getConfiguration().setSynchronous(synchronous);
    if (!MODEL_NOT_SET.equals(modeltype)) {
      model = ModelFactory.createModel(modeltype);
    } else {
      model = ModelFactory.createModel("seda");
    }
    manager.registerModel(model);

    manager.start();
    return manager;
  }
Ejemplo n.º 2
0
 public void registerModel(String modelType, String name) throws UMOException {
   UMOModel model = ModelFactory.createModel(modelType);
   model.setName(name);
   manager.registerModel(model);
 }