@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); } }
public AbstractVDBDeployer() { repositories.put("ddl", new DDLMetadataRepository()); //$NON-NLS-1$ repositories.put("native", new NativeMetadataRepository()); //$NON-NLS-1$ repositories.put("ddl-file", new DDLFileMetadataRepository()); //$NON-NLS-1$ repositories.put("udf", new UDFMetadataRepository()); //$NON-NLS-1$ }
@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); } }
return new ChainingMetadataRepository(Arrays.asList(new NativeMetadataRepository(), new DirectQueryMetadataRepository()));
@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); } }