Package org.teiid.core

Examples of org.teiid.core.TeiidRuntimeException


      this.displayName = encodedData;
      return;
    }
   
    if (!encodedData.endsWith("}")) { //$NON-NLS-1$
      throw new TeiidRuntimeException("The description field = "+encodedData+" does not end with \"}\""); //$NON-NLS-1$ //$NON-NLS-2$
    }
    encodedData = encodedData.substring(1, encodedData.length()-1);
   
    int index = 0;
    int start = -1;
View Full Code Here


  public void start() {
    try {
      URL url = Thread.currentThread().getContextClassLoader().getResource(CoreConstants.SYSTEM_VDB);
      if (url == null) {
        throw new TeiidRuntimeException(RuntimeMetadataPlugin.Util.getString("system_vdb_not_found")); //$NON-NLS-1$
      }
      // uri conversion is only to remove the spaces in URL, note this only with above kind situation 
      URI uri = new URI(url.getProtocol(), url.getPath(), null);
      this.vdbRepository.setSystemStore(new IndexMetadataFactory(uri.toURL()).getMetadataStore(null));
    } catch (URISyntaxException e) {
      throw new TeiidRuntimeException(e, RuntimePlugin.Util.getString("system_vdb_load_error")); //$NON-NLS-1$
    } catch (IOException e) {
      throw new TeiidRuntimeException(e, RuntimePlugin.Util.getString("system_vdb_load_error")); //$NON-NLS-1$
    }
  }
View Full Code Here

            } else {
              this.bufferMgr.setStorageManager(new MemoryStorageManager());
            }
           
        } catch(TeiidComponentException e) {
            throw new TeiidRuntimeException(e, RuntimePlugin.Util.getString("LocalBufferService.Failed_initializing_buffer_manager._8")); //$NON-NLS-1$
        } catch(IOException e) {
            throw new TeiidRuntimeException(e, RuntimePlugin.Util.getString("LocalBufferService.Failed_initializing_buffer_manager._8")); //$NON-NLS-1$           
        }
    }
View Full Code Here

    public static ProcessorPlan helpPlan(String sql, QueryMetadataInterface md, List bindings, CapabilitiesFinder capFinder, String[] expectedAtomic, boolean shouldSucceed) {
        Command command;
        try {
            command = helpGetCommand(sql, md, bindings);
        } catch (TeiidException err) {
            throw new TeiidRuntimeException(err);
        }

        return helpPlanCommand(command, md, capFinder, null, expectedAtomic, shouldSucceed ? ComparisonMode.CORRECTED_COMMAND_STRING : ComparisonMode.FAILED_PLANNING);
    }
View Full Code Here

    } catch (QueryPlannerException e) {
      exception = e;
    } catch (TeiidComponentException e) {
      exception = e;
    } catch (Throwable e) {
      throw new TeiidRuntimeException(e);
    } finally {
            if(DEBUG) {
                System.out.println(analysisRecord.getDebugLog());
            }
    }
    if (!shouldSucceed) {
      assertNotNull("Expected exception but did not get one.", exception); //$NON-NLS-1$
      return null;
    }
    if (plan == null) {
      throw new TeiidRuntimeException(exception);
    }
    assertNotNull("Output elements are null", plan.getOutputElements()); //$NON-NLS-1$
    if(DEBUG) System.out.println("\n" + plan);   //$NON-NLS-1$
    return plan;
  }
View Full Code Here

    Method getter = null;
    boolean readOnly = false;
    if (type == Void.TYPE) { //check for setter
      Class<?>[] types = method.getParameterTypes();
      if (types.length != 1) {
        throw new TeiidRuntimeException("TranslatorProperty annotation should be placed on valid getter or setter method, " + method + " is not valid."); //$NON-NLS-1$ //$NON-NLS-2$
      }
      type = types[0];
      try {
        getter = instance.getClass().getMethod("get" + method.getName(), (Class[])null); //$NON-NLS-1$
      } catch (Exception e) {
        try {
          getter = instance.getClass().getMethod("get" + method.getName().substring(3), (Class[])null); //$NON-NLS-1$
        } catch (Exception e1) {
          //can't find getter, won't set the default value
        }
      }
    } else if (method.getParameterTypes().length != 0) {
      throw new TeiidRuntimeException("TranslatorProperty annotation should be placed on valid getter or setter method, " + method + " is not valid."); //$NON-NLS-1$ //$NON-NLS-2$
    } else {
      getter = method;
      try {
        TranslatorUtil.getSetter(instance.getClass(), method);
      } catch (Exception e) {
        readOnly = true;
      }
    }
    Object defaultValue = null;
    if (prop.required()) {
      if (prop.advanced()) {
        throw new TeiidRuntimeException("TranslatorProperty annotation should not both be advanced and required " + method); //$NON-NLS-1$
      }
    } else if (getter != null) {
      try {
        defaultValue = getter.invoke(instance, (Object[])null);
      } catch (Exception e) {
View Full Code Here

  void sendResult(Message result, boolean encrypt) {
    if (encrypt) {
      try {
        result.setContents(socketClientInstance.getCryptor().sealObject(result.getContents()));
      } catch (CryptoException e) {
        throw new TeiidRuntimeException(e);
      }
    }
    socketClientInstance.send(result, messageKey);
  }
View Full Code Here

  protected ClientServiceRegistry getClientServiceRegistry() {
    try {
      InitialContext ic = new InitialContext();
      return (ClientServiceRegistry)ic.lookup(TEIID_RUNTIME);
    } catch (NamingException e) {
      throw new TeiidRuntimeException(e);
    }
  }
View Full Code Here

        try {
            return QueryRewriter.rewriteCriteria(criteria, null, null, metadata);
        } catch(TeiidProcessingException e) {
            throw new QueryPlannerException(e, QueryPlugin.Util.getString("ERR.015.004.0023", criteria)); //$NON-NLS-1$
        } catch (TeiidComponentException e) {
          throw new TeiidRuntimeException(e);
        }
    }
View Full Code Here

  private static Expression evaluateIfPossible(Expression newExpr) {
    if (EvaluatableVisitor.isFullyEvaluatable(newExpr, true)) {
          try {
        return new Constant(Evaluator.evaluate(newExpr), newExpr.getType());
      } catch (TeiidException e) {
        throw new TeiidRuntimeException(e, "Unexpected Exception"); //$NON-NLS-1$
      }
        }
        return newExpr;
  }
View Full Code Here

TOP

Related Classes of org.teiid.core.TeiidRuntimeException

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.