Package org.tuba.plugins.util

Examples of org.tuba.plugins.util.PluginManager


   * @throws IntegrationException
   */
  private boolean prepareIntegration(XMLReference reference)
      throws IntegrationException {
    boolean hasChanged = false;
    PluginManager pluginManager = PluginManager.getInstance();
    List<XMLArtefactOperation> operations = reference.getOperations();
   
    XMLProvider xmlProvider = reference.getProvider();
    if (xmlProvider == null) {
      // TODO externalize
      String message = "there is no provider"; //$NON-NLS-1$
      showError(message);
      throw new MissingProviderException();
    }
    String id = xmlProvider.getId();
    MetaProvider provider = pluginManager.getProvider(id);
    if (provider == null) {
      // TODO externalize
      String message = "can't insantiate provider '" + id + "'"; //$NON-NLS-1$ //$NON-NLS-2$
      showError(message);
      throw new MissingProviderException(id);
    }

    String firstArtefactType = provider.getProvidedArtefactType();
    checkOperationOrder(firstArtefactType, operations);

    String lastRepresentationType = firstArtefactType;
    if (!operations.isEmpty()) {
      id = operations.get(operations.size() - 1).getId();
      lastRepresentationType = pluginManager.getArtefactOperation(id)
          .getTargetType();
    }

    XMLIntegrator integrator = reference.getIntegrator();
    if (integrator == null
View Full Code Here


    }
  }

  private void checkOperationOrder(String beginType,
      List<XMLArtefactOperation> operations) throws IntegrationException {
    PluginManager pluginManager = PluginManager.getInstance();
    for (XMLArtefactOperation operation : operations) {
      MetaArtefactOperation operationMetaData = pluginManager
          .getArtefactOperation(operation.getId());
      if (operationMetaData == null) {
        // TODO externalize
        String message = "don't know operation: " + operation.getId(); //$NON-NLS-1$
        showError(message);
View Full Code Here

  private String targetType;

  public MetaArtefactOperation(IConfigurationElement element)
      throws ExtensionException {
    super(element);
    PluginManager pluginManager = PluginManager.getInstance();
    sourceType = element.getAttribute(SOURCE_TYPE);
    if (!pluginManager.existArtefactType(sourceType)) {
      String message = generateExceptionMessage(sourceType);
      throw new ExtensionException(message);
    }
    targetType = element.getAttribute(TARGET_TYPE);
    if (!pluginManager.existArtefactType(targetType)) {
      String message = generateExceptionMessage(targetType);
      throw new ExtensionException(message);
    }
  }
View Full Code Here

TOP

Related Classes of org.tuba.plugins.util.PluginManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.