lib/runtime/adapters.js
function loadAdapter(type, location) {
    var options = adapterConfig[type];
    try {
        var modulePath = adapterModulePath(type, options);

        global.JuttleAdapterAPI = JuttleAdapterAPI;

        var start = new Date();

        if (!options.builtin) {
            checkCompatible(type, modulePath, location);
        }

        var init = require(modulePath);

        var loaded = new Date();
        var adapter = init(options);

        global.JuttleAdapterAPI = undefined;

        if (adapter.name !== type) {
            throw new Error('adapter name ', adapter.name, ' != type ', type);
        }
        var initialized = new Date();

        logger.debug(adapter.name, 'adapter loaded in', (loaded - start), 'ms,',
                     'initialized in', (initialized - loaded), 'ms');

        register(adapter.name, adapter);

        return adapter;
    } catch (err) {
        logger.error('error loading adapter ' + type + ': ' + err.message);
        throw err;
    }
}
function loadAdapter(type, location) {
    var options = adapterConfig[type];
    try {
        var modulePath = adapterModulePath(type, options);

        global.JuttleAdapterAPI = JuttleAdapterAPI;

        var start = new Date();

        if (!options.builtin) {
            checkCompatible(type, modulePath, location);
        }

        var init = require(modulePath);

        var loaded = new Date();
        var adapter = init(options);

        global.JuttleAdapterAPI = undefined;

        if (adapter.name !== type) {
            throw new Error('adapter name ', adapter.name, ' != type ', type);
        }
        var initialized = new Date();

        logger.debug(adapter.name, 'adapter loaded in', (loaded - start), 'ms,',
                     'initialized in', (initialized - loaded), 'ms');

        register(adapter.name, adapter);

        return adapter;
    } catch (err) {
        logger.error('error loading adapter ' + type + ': ' + err.message);
        throw err;
    }
}
function loadAdapter ( type , location ) { var options = adapterConfig [ type ] ; try { var modulePath = adapterModulePath ( type , options ) ; global . JuttleAdapterAPI = JuttleAdapterAPI ; var start = new Date ( ) ; if ( ! options . builtin ) { checkCompatible ( type , modulePath , location ) ; } var init = require ( modulePath ) ; var loaded = new Date ( ) ; var adapter = init ( options ) ; global . JuttleAdapterAPI = undefined ; if ( adapter . name !== type ) { throw new Error ( 'adapter name ' , adapter . name , ' != type ' , type ) ; } var initialized = new Date ( ) ; logger . debug ( adapter . name , 'adapter loaded in' , ( loaded - start ) , 'ms,' , 'initialized in' , ( initialized - loaded ) , 'ms' ) ; register ( adapter . name , adapter ) ; return adapter ; } catch ( err ) { logger . error ( 'error loading adapter ' + type + ': ' + err . message ) ; throw err ; } }
Load the adapter of the given type.
Load the adapter of the given type .