當前位置: 首頁>>代碼示例>>Java>>正文


Java AisBus類代碼示例

本文整理匯總了Java中dk.dma.ais.bus.AisBus的典型用法代碼示例。如果您正苦於以下問題:Java AisBus類的具體用法?Java AisBus怎麽用?Java AisBus使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AisBus類屬於dk.dma.ais.bus包,在下文中一共展示了AisBus類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: makeConfiguration

import dk.dma.ais.bus.AisBus; //導入依賴的package包/類
@Test
public void makeConfiguration() throws FileNotFoundException, JAXBException {
    String filename = "src/main/resources/aisview-test.xml";
    AisViewConfiguration conf = new AisViewConfiguration();
    AisBusConfiguration aisBusConf = new AisBusConfiguration();
    conf.setAisbusConfiguration(aisBusConf);
    
    // Provider
    TcpClientProviderConfiguration reader = new TcpClientProviderConfiguration();
    reader.getHostPort().add("ais163.sealan.dk:4712");
    aisBusConf.getProviders().add(reader);
    
    AisViewConfiguration.save(filename, conf);
    
    conf = AisViewConfiguration.load(filename);
    AisBus aisBus = conf.getAisbusConfiguration().getInstance();
    Assert.assertNotNull(aisBus);
}
 
開發者ID:dma-ais,項目名稱:AisAnalysis,代碼行數:19,代碼來源:ConfigurationTest.java

示例2: provideAisBus

import dk.dma.ais.bus.AisBus; //導入依賴的package包/類
@Bean
public AisBus provideAisBus() {
    AisBus aisBus = null;
    try {
        AisBusConfiguration aisBusConf = AisBusConfiguration.load(aisBusConfiguration());
        aisBus = aisBusConf.getInstance();
    } catch (Exception e) {
        LOG.error("Failed to create AisBus", e);
        exit(-1);
    }
    return aisBus;
}
 
開發者ID:dma-ais,項目名稱:AisTrack,代碼行數:13,代碼來源:AisTrackServiceConfiguration.java

示例3: provideAisBus

import dk.dma.ais.bus.AisBus; //導入依賴的package包/類
@Bean
public AisBus provideAisBus() {
    AisBus aisBus = null;
    try {
        AisBusConfiguration aisBusConf = AisBusConfiguration.load(ClassLoader.getSystemResourceAsStream("aisbus.xml"));
        aisBus = aisBusConf.getInstance();
    } catch (Exception e) {
        LOG.error("Failed to create AisBus", e);
        exit(-1);
    }
    return aisBus;
}
 
開發者ID:dma-ais,項目名稱:AisTrack,代碼行數:13,代碼來源:AisTrackServiceTestConfiguration.java

示例4: setAisBus

import dk.dma.ais.bus.AisBus; //導入依賴的package包/類
void setAisBus(AisBus aisBus) {
    this.aisBus = aisBus;
}
 
開發者ID:dma-ais,項目名稱:AisTrack,代碼行數:4,代碼來源:AisTrackService.java

示例5: getAisBus

import dk.dma.ais.bus.AisBus; //導入依賴的package包/類
AisBus getAisBus() {
    return aisBus;
}
 
開發者ID:dma-ais,項目名稱:AisTrack,代碼行數:4,代碼來源:AisTrackService.java

示例6: makeConfiguration

import dk.dma.ais.bus.AisBus; //導入依賴的package包/類
@Test
public void makeConfiguration() throws FileNotFoundException, JAXBException {
    String filename = "src/main/resources/coverage-test.xml";
    AisCoverageConfiguration conf = new AisCoverageConfiguration();
    AisBusConfiguration aisBusConf = new AisBusConfiguration();

    // Provider
    TcpClientProviderConfiguration reader = new TcpClientProviderConfiguration();
    reader.getHostPort().add("ais163.sealan.dk:65262");
    aisBusConf.getProviders().add(reader);

    // Unfiltered consumer
    DistributerConsumerConfiguration unfilteredDist = new DistributerConsumerConfiguration();
    unfilteredDist.setName("UNFILTERED");
    aisBusConf.getConsumers().add(unfilteredDist);

    // Filtered consumer
    DistributerConsumerConfiguration filteredDist = new DistributerConsumerConfiguration();
    filteredDist.setName("FILTERED");
    DuplicateFilterConfiguration duplicateFilter = new DuplicateFilterConfiguration();
    filteredDist.getFilters().add(duplicateFilter);
    aisBusConf.getConsumers().add(filteredDist);
    conf.setAisbusConfiguration(aisBusConf);

    conf.setLatSize(1.5);
    conf.setLonSize(1.5);
    DatabaseConfiguration dbConf = new DatabaseConfiguration();
    conf.setDatabaseConfiguration(dbConf);
    // dbConf.set
    // dbConf.setName("MongoDB");
    // dbConf.setAddr("localhost");
    // dbConf.setPort(9999);
    // conf.setDatabase("MemoryOnly");

    AisCoverageConfiguration.save(filename, conf);

    conf = AisCoverageConfiguration.load(filename);
    AisBus aisBus = conf.getAisbusConfiguration().getInstance();
    DistributerConsumer filtered = (DistributerConsumer) aisBus.getConsumer("FILTERED");
    Assert.assertNotNull(filtered);
    DistributerConsumer unfiltered = (DistributerConsumer) aisBus.getConsumer("UNFILTERED");
    Assert.assertNotNull(unfiltered);
}
 
開發者ID:dma-ais,項目名稱:AisCoverage,代碼行數:44,代碼來源:ConfigurationTest.java


注:本文中的dk.dma.ais.bus.AisBus類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。