当前位置: 首页>>代码示例>>Java>>正文


Java DataProviderException类代码示例

本文整理汇总了Java中com.lightstreamer.interfaces.data.DataProviderException的典型用法代码示例。如果您正苦于以下问题:Java DataProviderException类的具体用法?Java DataProviderException怎么用?Java DataProviderException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DataProviderException类属于com.lightstreamer.interfaces.data包,在下文中一共展示了DataProviderException类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getParam

import com.lightstreamer.interfaces.data.DataProviderException; //导入依赖的package包/类
private String getParam (Map params, String toGet, boolean required, String def) throws DataProviderException {
    String res = (String) params.get(toGet);
    if (res == null) {
        if (required) {
            throw new DataProviderException(toGet + noParam);
        } else {
            if (logger != null) {
                logger.warn(toGet + useDefault);
            }
            res = def;
        }
    }
    if (logger != null) {
        logger.debug(toGet+ ": " + res);
    }
    return res;
}
 
开发者ID:Lightstreamer,项目名称:Lightstreamer-example-StockList-adapter-JMS,代码行数:18,代码来源:StockQuotesJMSDataAdapter.java

示例2: init

import com.lightstreamer.interfaces.data.DataProviderException; //导入依赖的package包/类
public void init(Map params, File configDir) throws DataProviderException {
    
    // Logging configuration for the demo is carried out in the init
    // method of Metadata Adapter. In order to be sure that this method 
    // is executed after log configuration was completed, this parameter 
    // must be present in the Adapter Set configuration (adapters.xml):
    // <metadata_adapter_initialised_first>Y</metadata_adapter_initialised_first>
    logger = Logger.getLogger("LS_demos_Logger.Messenger");

    // Read the Adapter Set name, which is supplied by the Server as a parameter
    String adapterSetId = (String) params.get("adapters_conf.id");

    // Put a reference to this instance on a static map
    // to be read by the Metadata Adapter
    feedMap.put(adapterSetId, this);

    // Adapter ready
    logger.info("IMDataAdapter ready");

}
 
开发者ID:Lightstreamer,项目名称:Lightstreamer-example-Messenger-adapter-java,代码行数:21,代码来源:IMDataAdapter.java

示例3: init

import com.lightstreamer.interfaces.data.DataProviderException; //导入依赖的package包/类
public void init(Map params, File configDir) throws DataProviderException {

        // Logging configuration for the demo is carried out in the init
        // method of Metadata Adapter. In order to be sure that this method 
        // is executed after log configuration was completed, this parameter 
        // must be present in the Adapter Set configuration (adapters.xml):
        // <metadata_adapter_initialised_first>Y</metadata_adapter_initialised_first>
        logger = Logger.getLogger("LS_demos_Logger.RoundTrip");

        // Read the Adapter Set name, which is supplied by the Server as a parameter
        String adapterSetId = (String) params.get("adapters_conf.id");

        // Put a reference to this instance on a static map
        // to be read by the Metadata Adapter
        feedMap.put(adapterSetId, this);

        // Adapter ready
        logger.info("RounTripDataAdapter ready");

    }
 
开发者ID:Lightstreamer,项目名称:Lightstreamer-example-RoundTrip-adapter-java,代码行数:21,代码来源:RoundTripDataAdapter.java

示例4: init

import com.lightstreamer.interfaces.data.DataProviderException; //导入依赖的package包/类
@Override
public void init(Map params, File configDir) throws DataProviderException {
    String logConfig = (String) params.get("log_config");
    if (logConfig != null) {
        File logConfigFile = new File(configDir, logConfig);
        String logRefresh = (String) params.get("log_config_refresh_seconds");
        if (logRefresh != null) {
            DOMConfigurator.configureAndWatch(logConfigFile.getAbsolutePath(), Integer.parseInt(logRefresh) * 1000);
        } else {
            DOMConfigurator.configure(logConfigFile.getAbsolutePath());
        }
    } //else the bridge to logback is expected
    
    logger = Logger.getLogger(Constants.LOGGER_CAT);
    
    logger.info("Adapter Logger start.");
    
    // Read the Adapter Set name, which is supplied by the Server as a parameter
    String adapterSetId = (String) params.get("adapters_conf.id");
    
    // Put a reference to this instance on a static map
    // to be read by the Metadata Adapter
    feedMap.put(adapterSetId, this);
    
    
    logger.info("DartDataAdapter ready");
    
}
 
开发者ID:Lightstreamer,项目名称:BananaDarts-adapter-java,代码行数:29,代码来源:DartDataAdapter.java

示例5: init

import com.lightstreamer.interfaces.data.DataProviderException; //导入依赖的package包/类
/**
 * Called by Lightstreamer Kernel on start.
 */
public void init(Map params, File configDir) throws DataProviderException {
    //load log configuration
    String logConfig = (String) params.get("log_config");
    if (logConfig != null) {
        File logConfigFile = new File(configDir, logConfig);
        String logRefresh = (String) params.get("log_config_refresh_seconds");
        if (logRefresh != null) {
            DOMConfigurator.configureAndWatch(logConfigFile.getAbsolutePath(), Integer.parseInt(logRefresh) * 1000);
        } else {
            DOMConfigurator.configure(logConfigFile.getAbsolutePath());
        }
    }
    //get the logger
    logger = Logger.getLogger("LS_demos_Logger.StockQuotesJMS");

    //load JMS connections parameters
    String providerURL = getParam(params,"jmsUrl",true,null);
    String initialContextFactory = getParam(params,"initialContextFactory",true,null);
    String topicConnectionFactory = getParam(params,"topicConnectionFactory",true,null);
    String queueConnectionFactory = getParam(params,"queueConnectionFactory",true,null);
    String topic = getParam(params,"topicName",true,null);
    String queue = getParam(params,"queueName",true,null);
    //the size of the message pool
    this.msgPoolSize = getParam(params,"msgPoolSize",false,15);
    //in case of disconnection/failed_connection from/to JMS this is
    //the pause between each reconnection attempt
    this.recoveryPause = getParam(params,"recoveryPauseMillis",false,2000);

    logger.debug("Configuration read.");

    //create the JMS handler. The object will handle the instantiation of JMS-related objects
    jmsHandler = new JMSHandler(logger,initialContextFactory, providerURL,queueConnectionFactory, queue, topicConnectionFactory, topic);
    //the message listener that will receive JMS messages will be the StockQuotesJMSDataAdapter instance (this)
    jmsHandler.setListener(this);

    //this thread keeps on trying to connect to JMS until succedes. When connected
    //calls the onConnection method
    new ConnectionLoopTSQS(jmsHandler, recoveryPause, logger).start();

    logger.info("StockQuotesJMSDataAdapter ready.");
}
 
开发者ID:Lightstreamer,项目名称:Lightstreamer-example-StockList-adapter-JMS,代码行数:45,代码来源:StockQuotesJMSDataAdapter.java

示例6: init

import com.lightstreamer.interfaces.data.DataProviderException; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public void init(Map params, File configDir) throws DataProviderException {}
 
开发者ID:Lightstreamer,项目名称:Lightstreamer-example-FullScreenMario-adapter-java,代码行数:3,代码来源:DataAdapter.java

示例7: init

import com.lightstreamer.interfaces.data.DataProviderException; //导入依赖的package包/类
public void init(Map params, File configDir) throws DataProviderException {
}
 
开发者ID:Lightstreamer,项目名称:Lightstreamer-example-AMFHelloWorld-adapter-java,代码行数:3,代码来源:AMFHelloWorld.java


注:本文中的com.lightstreamer.interfaces.data.DataProviderException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。