@TranslatorProperty(display="Is Source Required For Metadata", advanced=true) @Override public boolean isSourceRequiredForMetadata() { return delegate.isSourceRequiredForMetadata(); } public void setSourceRequiredForMetadata(boolean value) {
@Override public void loadMetadata(MetadataFactory factory, ExecutionFactory executionFactory, Object connectionFactory) throws TranslatorException { if (executionFactory == null ) { throw new TranslatorException(QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30591, factory.getName())); } if (connectionFactory == null && executionFactory.isSourceRequiredForMetadata()) { throw new TranslatorException(QueryPlugin.Event.TEIID31097, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31097)); } ClassLoader originalCL = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(executionFactory.getClass().getClassLoader()); getMetadata(factory, executionFactory, connectionFactory); } finally { Thread.currentThread().setContextClassLoader(originalCL); } }
@Override public void loadMetadata(MetadataFactory factory, ExecutionFactory executionFactory, Object connectionFactory) throws TranslatorException { if (executionFactory == null ) { throw new TranslatorException(QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30591, factory.getName())); } if (connectionFactory == null && executionFactory.isSourceRequiredForMetadata()) { throw new TranslatorException(QueryPlugin.Event.TEIID31097, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31097)); } ClassLoader originalCL = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(executionFactory.getClass().getClassLoader()); getMetadata(factory, executionFactory, connectionFactory); } finally { Thread.currentThread().setContextClassLoader(originalCL); } }
@Override public void loadMetadata(MetadataFactory factory, ExecutionFactory executionFactory, Object connectionFactory) throws TranslatorException { if (executionFactory == null ) { throw new TranslatorException(QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30591, factory.getName())); } if (connectionFactory == null && executionFactory.isSourceRequiredForMetadata()) { throw new TranslatorException(QueryPlugin.Event.TEIID31097, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31097)); } ClassLoader originalCL = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(executionFactory.getClass().getClassLoader()); getMetadata(factory, executionFactory, connectionFactory); } finally { Thread.currentThread().setContextClassLoader(originalCL); } }
} catch (Throwable e) { if (executionFactory.isSourceRequiredForMetadata()) { throw new TranslatorException(QueryPlugin.Event.TEIID31178, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31178, factory.getName())); unwrapped = ((WrappedConnection)connection).unwrap(); } catch (Exception e) { if (executionFactory.isSourceRequiredForMetadata()) { throw new TranslatorException(QueryPlugin.Event.TEIID30477, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30477, factory.getName()));
} catch (Throwable e) { if (executionFactory.isSourceRequiredForMetadata()) { throw new TranslatorException(QueryPlugin.Event.TEIID31178, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31178, factory.getName())); unwrapped = ((WrappedConnection)connection).unwrap(); } catch (Exception e) { if (executionFactory.isSourceRequiredForMetadata()) { throw new TranslatorException(QueryPlugin.Event.TEIID30477, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30477, factory.getName()));
} catch (Throwable e) { if (executionFactory.isSourceRequiredForMetadata()) { throw new TranslatorException(QueryPlugin.Event.TEIID31178, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31178, factory.getName())); unwrapped = ((WrappedConnection)connection).unwrap(); } catch (ResourceException e) { if (executionFactory.isSourceRequiredForMetadata()) { throw new TranslatorException(QueryPlugin.Event.TEIID30477, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30477, factory.getName()));