Пример #1
0
 public static <T> T getInstance(
     Class<T> expectedType,
     String className,
     Collection<?> ctorObjs,
     Class<? extends T> defaultClass)
     throws TranslatorException {
   try {
     if (className == null) {
       if (defaultClass == null) {
         throw new TranslatorException(
             DataPlugin.Event.TEIID60004, DataPlugin.Util.gs(DataPlugin.Event.TEIID60004));
       }
       return expectedType.cast(defaultClass.newInstance());
     }
     return expectedType.cast(
         ReflectionHelper.create(
             className, ctorObjs, Thread.currentThread().getContextClassLoader()));
   } catch (TeiidException e) {
     throw new TranslatorException(DataPlugin.Event.TEIID60005, e);
   } catch (IllegalAccessException e) {
     throw new TranslatorException(DataPlugin.Event.TEIID60005, e);
   } catch (InstantiationException e) {
     throw new TranslatorException(DataPlugin.Event.TEIID60005, e);
   }
 }
Пример #2
0
 @SuppressWarnings("unused")
 public UpdateExecution createUpdateExecution(
     Command command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection)
     throws TranslatorException {
   throw new TranslatorException(
       DataPlugin.Event.TEIID60001,
       DataPlugin.Util.gs(DataPlugin.Event.TEIID60001, "createUpdateExecution")); // $NON-NLS-1$
 }
Пример #3
0
 public void addSchema(Schema schema) {
   if (this.schemas.put(schema.getName(), schema) != null) {
     throw new DuplicateRecordException(
         DataPlugin.Event.TEIID60012,
         DataPlugin.Util.gs(DataPlugin.Event.TEIID60012, schema.getName()));
   }
   this.schemaList.add(schema);
 }