Package org.jboss.deployers.spi

Examples of org.jboss.deployers.spi.DeploymentException


    return metadataRepository;
  }
 
  public void addVDB(VDBMetaData vdb, MetadataStoreGroup stores, LinkedHashMap<String, Resource> visibilityMap, UDFMetaData udf, ConnectorManagerRepository cmr) throws DeploymentException {
    if (getVDB(vdb.getName(), vdb.getVersion()) != null) {
      throw new DeploymentException(RuntimePlugin.Util.getString("duplicate_vdb", vdb.getName(), vdb.getVersion())); //$NON-NLS-1$
    }
   
    // get the system VDB metadata store
    if (this.systemStore == null) {
      throw new DeploymentException(RuntimePlugin.Util.getString("system_vdb_load_error")); //$NON-NLS-1$
   
   
    if (this.odbcEnabled && odbcStore == null) {
      this.odbcStore = getODBCMetadataStore();
    }
View Full Code Here


    boolean preview = deployment.isPreview();
   
    if (!preview) {
      List<String> errors = deployment.getValidityErrors();
      if (errors != null && !errors.isEmpty()) {
        throw new DeploymentException(RuntimePlugin.Util.getString("validity_errors_in_vdb", deployment)); //$NON-NLS-1$
      }
    }
   
    // get the metadata store of the VDB (this is build in parse stage)
    MetadataStoreGroup store = unit.getAttachment(MetadataStoreGroup.class);
   
    // add required connector managers; if they are not already there
    for (Translator t: deployment.getOverrideTranslators()) {
      VDBTranslatorMetaData data = (VDBTranslatorMetaData)t;
     
      String type = data.getType();
      Translator parent = this.translatorRepository.getTranslatorMetaData(type);
      if ( parent == null) {
        throw new DeploymentException(RuntimePlugin.Util.getString("translator_type_not_found", unit.getName())); //$NON-NLS-1$
      }
     
      Set<String> keys = parent.getProperties().stringPropertyNames();
      for (String key:keys) {
        if (data.getPropertyValue(key) == null && parent.getPropertyValue(key) != null) {
View Full Code Here

    }
  }
 
  private ExecutionFactory<Object, Object> getExecutionFactory(String name, TranslatorRepository repo, VDBMetaData deployment, IdentityHashMap<Translator, ExecutionFactory<Object, Object>> map, HashSet<String> building) throws DeploymentException {
    if (!building.add(name)) {
      throw new DeploymentException(RuntimePlugin.Util.getString("recursive_delegation", deployment.getName(), deployment.getVersion(), building)); //$NON-NLS-1$
    }
    Translator translator = repo.getTranslatorMetaData(name);
    if (translator == null) {
      translator = this.translatorRepository.getTranslatorMetaData(name);
    }
    if (translator == null) {
      throw new DeploymentException(RuntimePlugin.Util.getString("translator_not_found", deployment.getName(), deployment.getVersion(), name)); //$NON-NLS-1$
    }
    ExecutionFactory<Object, Object> ef = map.get(translator);
    if ( ef == null) {
      ef = TranslatorUtil.buildExecutionFactory(translator);
      if (ef instanceof DelegatingExecutionFactory) {
View Full Code Here

    private boolean buildDynamicMetadataStore(final VFSDeploymentUnit unit, final VDBMetaData vdb, final MetadataStoreGroup vdbStore, final ConnectorManagerRepository cmr) throws DeploymentException {
      boolean asynch = false;
      // make sure we are configured correctly first
    for (final ModelMetaData model:vdb.getModelMetaDatas().values()) {
        if (model.getSourceNames().isEmpty()) {
          throw new DeploymentException(RuntimePlugin.Util.getString("fail_to_deploy", vdb.getName()+"-"+vdb.getVersion(), model.getName())); //$NON-NLS-1$ //$NON-NLS-2$
        }
           
        final boolean cache = "cached".equalsIgnoreCase(vdb.getPropertyValue("UseConnectorMetadata")); //$NON-NLS-1$ //$NON-NLS-2$
        final File cacheFile = buildCachedModelFileName(unit, vdb, model.getName());
        boolean loaded = false;
View Full Code Here

      // load the UDF
      for(Model model:vdb.getModels()) {
        if (model.getModelType().equals(Model.Type.FUNCTION)) {
          String path = ((ModelMetaData)model).getPath();
          if (path == null) {
            throw new DeploymentException(RuntimePlugin.Util.getString("invalid_udf_file", model.getName())); //$NON-NLS-1$
          }
          udf.buildFunctionModelFile(model.getName(), path);
        }
      }   
     
View Full Code Here

    if (vdbMO != null) {
      VDBMetaData vdb = (VDBMetaData) vdbMO.getAttachment();
      for (Model m : vdb.getModels()) {
        ManagedObject mo = this.mof.initManagedObject(m, ModelMetaData.class, m.getName(),m.getName());
        if (mo == null) {
          throw new DeploymentException("could not create managed object"); //$NON-NLS-1$
        }
        managedObjects.put(mo.getName(), mo);
      }
     
      for (Translator t: vdb.getOverrideTranslators()) {
        ManagedObject mo = this.mof.initManagedObject(t, VDBTranslatorMetaData.class, t.getName(), t.getName());
        if (mo == null) {
          throw new DeploymentException("could not create managed object"); //$NON-NLS-1$
        }
        managedObjects.put(mo.getName(), mo);       
      }
    }
  } 
View Full Code Here

  public void deploy(DeploymentUnit unit, TranslatorMetaDataGroup group) throws DeploymentException {

    for (TranslatorMetaData data:group.getTranslators()) {
      String translatorName = data.getName();
      if (translatorName == null) {
        throw new DeploymentException(RuntimePlugin.Util.getString("name_not_found", unit.getName())); //$NON-NLS-1$
      }
     
      String type = data.getType();
      Translator parent = this.translatorRepository.getTranslatorMetaData(type);
      if ( parent == null) {
        throw new DeploymentException(RuntimePlugin.Util.getString("translator_type_not_found", unit.getName())); //$NON-NLS-1$
      }
     
      // fill with default properties ignoring the overridden ones.
      Set<String> keys = parent.getProperties().stringPropertyNames();
      for (String key:keys) {
View Full Code Here

    ExecutionFactory executionFactory;
    try {
      String executionClass = data.getPropertyValue(TranslatorMetaData.EXECUTION_FACTORY_CLASS);
      Object o = ReflectionHelper.create(executionClass, null, Thread.currentThread().getContextClassLoader());
      if(!(o instanceof ExecutionFactory)) {
        throw new DeploymentException(RuntimePlugin.Util.getString("invalid_class", executionClass));//$NON-NLS-1$ 
      }
     
      executionFactory = (ExecutionFactory)o;
      injectProperties(executionFactory, data);
      executionFactory.start();
      return executionFactory;
    } catch (TeiidException e) {
      throw new DeploymentException(e);
    } catch (InvocationTargetException e) {
      throw new DeploymentException(e);
    } catch (IllegalAccessException e) {
      throw new DeploymentException(e);
    }
  }
View Full Code Here

     
      if (value != null) {
        Method setterMethod = getSetter(ef.getClass(), method);
        setterMethod.invoke(ef, convert(value, method.getReturnType()));
      } else if (tp.required()) {
        throw new DeploymentException(RuntimePlugin.Util.getString("required_property_not_exists", tp.display())); //$NON-NLS-1$
      }
    }
    caseInsensitivProps.remove(Translator.EXECUTION_FACTORY_CLASS);
    if (!caseInsensitivProps.isEmpty()) {
      LogManager.logWarning(LogConstants.CTX_RUNTIME, RuntimePlugin.Util.getString("undefined_translator_props", caseInsensitivProps.keySet(), data.getName())); //$NON-NLS-1$
View Full Code Here

      return clazz.getMethod(setter, method.getReturnType());
    } catch (NoSuchMethodException e) {
      try {
        return clazz.getMethod(method.getName(), method.getReturnType());
      } catch (NoSuchMethodException e1) {
        throw new DeploymentException(RuntimePlugin.Util.getString("no_set_method", setter, method.getName())); //$NON-NLS-1$
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.jboss.deployers.spi.DeploymentException

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.