Search in sources :

Example 1 with JBossLogger

use of org.teiid.runtime.JBossLogger in project teiid by teiid.

the class TeiidExtension method initialize.

@Override
public void initialize(ExtensionContext context) {
    final SubsystemRegistration subsystem = context.registerSubsystem(TEIID_SUBSYSTEM, TEIID_VERSION);
    LogManager.setLogListener(new JBossLogger());
    subsystem.registerXMLElementWriter(TeiidSubsystemParser.INSTANCE);
    // Main Teiid system, with children query engine and translators, register only if this is a server
    subsystem.registerSubsystemModel(new TeiidSubsytemResourceDefinition(context.getProcessType().isServer()));
}
Also used : JBossLogger(org.teiid.runtime.JBossLogger) SubsystemRegistration(org.jboss.as.controller.SubsystemRegistration)

Example 2 with JBossLogger

use of org.teiid.runtime.JBossLogger in project teiid by teiid.

the class ConvertVDB method convert.

public static String convert(File f) throws VirtualDatabaseException, ConnectorManagerException, TranslatorException, IOException, URISyntaxException, MalformedURLException, AdminException, Exception, FileNotFoundException {
    LogManager.setLogListener(new JBossLogger() {

        @Override
        public boolean isEnabled(String context, int level) {
            return false;
        }
    });
    EmbeddedConfiguration ec = new EmbeddedConfiguration();
    ec.setUseDisk(false);
    ec.setCacheFactory(new CacheFactory() {

        @Override
        public <K, V> Cache<K, V> get(String name) {
            return new MockCache<>(name, 10);
        }

        @Override
        public void destroy() {
        }
    });
    MyServer es = new MyServer();
    LogManager.setLogListener(new JBossLogger() {

        @Override
        public boolean isEnabled(String context, int level) {
            return false;
        }
    });
    es.start(ec);
    try {
        return es.convertVDB(new FileInputStream(f));
    } finally {
        es.stop();
    }
}
Also used : JBossLogger(org.teiid.runtime.JBossLogger) EmbeddedConfiguration(org.teiid.runtime.EmbeddedConfiguration) CacheFactory(org.teiid.cache.CacheFactory) FileInputStream(java.io.FileInputStream) LRUCache(org.teiid.core.util.LRUCache) Cache(org.teiid.cache.Cache)

Aggregations

JBossLogger (org.teiid.runtime.JBossLogger)2 FileInputStream (java.io.FileInputStream)1 SubsystemRegistration (org.jboss.as.controller.SubsystemRegistration)1 Cache (org.teiid.cache.Cache)1 CacheFactory (org.teiid.cache.CacheFactory)1 LRUCache (org.teiid.core.util.LRUCache)1 EmbeddedConfiguration (org.teiid.runtime.EmbeddedConfiguration)1