本文整理匯總了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);
}
示例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;
}
示例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;
}
示例4: setAisBus
import dk.dma.ais.bus.AisBus; //導入依賴的package包/類
void setAisBus(AisBus aisBus) {
this.aisBus = aisBus;
}
示例5: getAisBus
import dk.dma.ais.bus.AisBus; //導入依賴的package包/類
AisBus getAisBus() {
return aisBus;
}
示例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);
}